Hi All,
I am very new to writing code etc so I apologise if I have overlooked something obvious. I've been learning Java and am starting to get comfortable with creating functional swing interfaces, however I'm encountering some issues when I try and get these functioning within ImageJ (in NetBeans). I have read and been using the Writing Image J Plugins Tutorial and this has been a real help. I am using Image J to develop an educational resource whereby students will be presented with a GUI which allows them to choose a treatment, this will then call up appropriate images sequences which they then perform measurements (size/count) using. These measurements will be entered into a table and a plot facility will allow them to visualise the results of their experiment. My plan is to achieve this by creating Image J plugins, however I have several questions - Firstly, is what I describe (very briefly) achievable using Image J plugins (Image J seems to largely be made up of plugins so I couldn't find a reason why this shouldn't be feasible)? I've been using Swing to create GUI's as I found this creates a nicer looking interface (this may well just be my inexperience using AWT), however I see that PlugInFrame is AWT based and if I try to bring the Swing designed windows into a PlugInFrame this does not work (perhaps not surprisingly). Therefore should I be switching to AWT for this project or can I continue using Swing and get Image J functions working with this? What are the advantages/disadvantages of using the Image J PlugInFrame as opposed to my own JFrame? I would also like to embed the Image J image windows within a window to provide some control over the layout of various components (i.e. a control bar for play/pause/measure options positioned next to the window – I was going to hide the main Image J window to provide control over the features available). Is this possible and if so what is the best way of achieving it? Many thanks for reading and I would appreciate any advice you can provide. Cheers, Oli Oliver Tills http://vimeo.com/channels/embryonicdevelopment Videos of developing aquatic embryos produced in our lab -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Oliver,
On Wed, 2 Jan 2013, Oliver Tills wrote: > I am very new to writing code etc so I apologise if I have overlooked > something obvious. I've been learning Java and am starting to get > comfortable with creating functional swing interfaces, however I'm > encountering some issues when I try and get these functioning within > ImageJ (in NetBeans). I have read and been using the Writing Image J > Plugins Tutorial and this has been a real help. > > I am using Image J to develop an educational resource whereby students > will be presented with a GUI which allows them to choose a treatment, > this will then call up appropriate images sequences which they then > perform measurements (size/count) using. These measurements will be > entered into a table and a plot facility will allow them to visualise > the results of their experiment. My plan is to achieve this by creating > Image J plugins, however I have several questions - > > Firstly, is what I describe (very briefly) achievable using Image J > plugins (Image J seems to largely be made up of plugins so I couldn't > find a reason why this shouldn't be feasible)? to. The MDI approach (i.e. decorate ImageJ's ImageWindows) did not work for me, as ImageCanvas does not implement everything for a well-behaved AWT component. Besides, there are still problems with mixing AWT and Swing components (ImageJ is almost completely relying on AWT). > I've been using Swing to create GUI's as I found this creates a nicer > looking interface (this may well just be my inexperience using AWT), > however I see that PlugInFrame is AWT based and if I try to bring the > Swing designed windows into a PlugInFrame this does not work (perhaps > not surprisingly). Therefore should I be switching to AWT for this > project or can I continue using Swing and get Image J functions working > with this? What are the advantages/disadvantages of using the Image J > PlugInFrame as opposed to my own JFrame? The common strategy is to use different windows for the Swing stuff and control the AWT windows containing the images (and control the plugins working on them) through the code triggered by the Swing components. > I would also like to embed the Image J image windows within a window to > provide some control over the layout of various components (i.e. a > control bar for play/pause/measure options positioned next to the window > – I was going to hide the main Image J window to provide control over > the features available). Is this possible and if so what is the best > way of achieving it? The current design of ImageJ does not allow that, really. There are hacks e.g. to make an MDI interface for web applets, but they all have their shortcomings because the architecture of ImageJ really calls for SDI (i.e. all windows and control components are in separate windows). So in the short run, I would suggest to keep your GUI in a window separate from the images and interact with the images and plugins via the API provided by ij.IJ and ij.WindowManager. Ciao, Johannes -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Johnanes,
Thanks for this advice, it is much appreciated. On 03/01/2013 17:12, "Johannes Schindelin" <[hidden email]> wrote: >Hi Oliver, > >On Wed, 2 Jan 2013, Oliver Tills wrote: > >> I am very new to writing code etc so I apologise if I have overlooked >> something obvious. I've been learning Java and am starting to get >> comfortable with creating functional swing interfaces, however I'm >> encountering some issues when I try and get these functioning within >> ImageJ (in NetBeans). I have read and been using the Writing Image J >> Plugins Tutorial and this has been a real help. >> >> I am using Image J to develop an educational resource whereby students >> will be presented with a GUI which allows them to choose a treatment, >> this will then call up appropriate images sequences which they then >> perform measurements (size/count) using. These measurements will be >> entered into a table and a plot facility will allow them to visualise >> the results of their experiment. My plan is to achieve this by creating >> Image J plugins, however I have several questions - >> >> Firstly, is what I describe (very briefly) achievable using Image J >> plugins (Image J seems to largely be made up of plugins so I couldn't >> find a reason why this shouldn't be feasible)? > >It can be achieved, but it would be hard to do exactly the way you want it >to. The MDI approach (i.e. decorate ImageJ's ImageWindows) did not work >for me, as ImageCanvas does not implement everything for a well-behaved >AWT component. Besides, there are still problems with mixing AWT and Swing >components (ImageJ is almost completely relying on AWT). This was my fear. I guess I just wanted the added structure/control that MDI would provide. I suppose careful placement of individual windows might provide a good enough alternative. Is it possible to anchor windows (Swing and AWT including StackWindows to particular positions on the screen (with some standardisation for use with different screen resolutions)? > >> I've been using Swing to create GUI's as I found this creates a nicer >> looking interface (this may well just be my inexperience using AWT), >> however I see that PlugInFrame is AWT based and if I try to bring the >> Swing designed windows into a PlugInFrame this does not work (perhaps >> not surprisingly). Therefore should I be switching to AWT for this >> project or can I continue using Swing and get Image J functions working >> with this? What are the advantages/disadvantages of using the Image J >> PlugInFrame as opposed to my own JFrame? > >The common strategy is to use different windows for the Swing stuff and >control the AWT windows containing the images (and control the plugins >working on them) through the code triggered by the Swing components. Great, this was as I suspected. > >> I would also like to embed the Image J image windows within a window to >> provide some control over the layout of various components (i.e. a >> control bar for play/pause/measure options positioned next to the window >> I was going to hide the main Image J window to provide control over >> the features available). Is this possible and if so what is the best >> way of achieving it? > >The current design of ImageJ does not allow that, really. There are hacks >e.g. to make an MDI interface for web applets, but they all have their >shortcomings because the architecture of ImageJ really calls for SDI (i.e. >all windows and control components are in separate windows). > >So in the short run, I would suggest to keep your GUI in a window separate >from the images and interact with the images and plugins via the API >provided by ij.IJ and ij.WindowManager. > >Ciao, >Johannes Cheers, Oli -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Oliver,
On Thu, 3 Jan 2013, Oliver Tills wrote: > Hi Johnanes, almost ;-) > Is it possible to anchor windows (Swing and AWT including StackWindows > to particular positions on the screen (with some standardisation for use > with different screen resolutions)? You can place windows using the setLocation() method, and you can add listeners for certain events. Unfortunately, there seems no good way to track window movements, but I'd recommend against enforcing a given arrangement in any case (it can be really annoying when software does that). Better to do it automatically upon startup and maybe have a button to re-arrange. Ciao, Johannes -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
hi everyone I'm a phd student in vet histopathology and I' m approaching fractal analysis, I'd like to know if is possible to define the scaling window in imagej, something like fanal+, developed in jürgen W Dollinger et al 1998 J. Phys. A: Math. Gen. 31 3839 doi:10.1088/0305-4470/31/16/012 Bi-asymptotic fractals: Fractals between lower and upper bounds Jürgen W Dollinger, Ralf Metzler and Theo F Nonnenmacher Thank you in advance for your attention, moreover I' d like to emphasize how interesting and professional questions and answers on the mailing list are thank you carlo bianco bologna university -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On Thursday 03 Jan 2013 20:28:32 carlo bianco wrote:
> I'd like to know if is possible to define the scaling window in > imagej, something like fanal+, developed in > jürgen W Dollinger et al 1998 J. Phys. A: Math. Gen. 31 3839 > doi:10.1088/0305-4470/31/16/012 Bi-asymptotic fractals: Fractals between > lower and upper bounds > Jürgen W Dollinger, Ralf Metzler and Theo F Nonnenmacher Hi Carlo, If you are talking about the box counting command in IJ, it has not been implemented yet. Currently you need to define what are the box sizes used in the analysis and the slope will be computed over that range. It might be useful to define the ranges over which the plot approaches a line considering the resolution of the image as well as the size of the structural units in the objects you are analysing (and the size of the object of course). You will find that for most biological objects that might be fractal (in an operational sense) the "fractal regime" spans about one or at most 2 orders of magnitude (for obvious reasons, but that is rarely discussed in relation to what people seem to want to analyse). Regards Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by carlo bianco
Hi everybody,
My goal is to use ImageJ/Fiji to compare images of the same object taken in different times, so I want to align them using ROI. I found this http://fiji.sc/wiki/index.php/Align_Image_by_line_ROI that is almost pefect but can't handle RGB images. Are there any alternatives? Thanks in advance! -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Riccardo,
have you checked this: http://fiji.sc/wiki/index.php/Landmark_Correspondences ? Instead of a line you would use points, but that shouldn't make it more difficult. The benefit is that the plugin offers more choices for the desired transformation model and that it can handle all types of images. Best, Stephan On Sat, 2013-01-05 at 16:22 +0100, Riccardo Cabbri wrote: > Hi everybody, > My goal is to use ImageJ/Fiji to compare images of the same object taken > in different times, so I want to align them using ROI. > I found this http://fiji.sc/wiki/index.php/Align_Image_by_line_ROI that > is almost pefect but can't handle RGB images. > Are there any alternatives? > Thanks in advance! > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Stephan,
thanks for the advice! Your plugin works very well, but I don't have so many secure correspondence points on my images, so I am thinking about the possibility of converting some lines in a group of points. Do you think that a couple of lines would generate enough points for the plugin?(maybe it is possible to have one point for every pixel of the line). Is there a way to do this in imagej? Many thanks! Riccardo On 07/01/2013 00:21, Stephan Saalfeld wrote: > Hi Riccardo, > > have you checked this: > > http://fiji.sc/wiki/index.php/Landmark_Correspondences > > ? Instead of a line you would use points, but that shouldn't make it > more difficult. The benefit is that the plugin offers more choices for > the desired transformation model and that it can handle all types of > images. > > Best, > Stephan > > > > > > > On Sat, 2013-01-05 at 16:22 +0100, Riccardo Cabbri wrote: >> Hi everybody, >> My goal is to use ImageJ/Fiji to compare images of the same object taken >> in different times, so I want to align them using ROI. >> I found this http://fiji.sc/wiki/index.php/Align_Image_by_line_ROI that >> is almost pefect but can't handle RGB images. >> Are there any alternatives? >> Thanks in advance! >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Stephan Saalfeld
Riccardo,
a single line segment makes only two points. You can just set the start and end-point of the line and then estimate a translation (shift only), rigid transformation (shift and rotation), or similarity transformation (shift, rotation, and isotropic scale). For higher order transformations, you need more points that are not on a single line. If you have more than one line segment, you can convert them to start and end points each and you will be fine. Read about the Roi methods---it's probably fairly easy to do. Best, Stephan On Fri, 2013-01-11 at 15:09 +0100, Riccardo Cabbri wrote: > Hi Stephan, > thanks for the advice! > Your plugin works very well, but I don't have so many secure > correspondence points on my images, so I am thinking about the > possibility of converting some lines in a group of points. > Do you think that a couple of lines would generate enough points for the > plugin?(maybe it is possible to have one point for every pixel of the line). > Is there a way to do this in imagej? > Many thanks! > Riccardo > > On 07/01/2013 00:21, Stephan Saalfeld wrote: > > Hi Riccardo, > > > > have you checked this: > > > > http://fiji.sc/wiki/index.php/Landmark_Correspondences > > > > ? Instead of a line you would use points, but that shouldn't make it > > more difficult. The benefit is that the plugin offers more choices for > > the desired transformation model and that it can handle all types of > > images. > > > > Best, > > Stephan > > > > > > > > > > > > > > On Sat, 2013-01-05 at 16:22 +0100, Riccardo Cabbri wrote: > >> Hi everybody, > >> My goal is to use ImageJ/Fiji to compare images of the same object taken > >> in different times, so I want to align them using ROI. > >> I found thishttp://fiji.sc/wiki/index.php/Align_Image_by_line_ROI that > >> is almost pefect but can't handle RGB images. > >> Are there any alternatives? > >> Thanks in advance! > >> > >> -- > >> ImageJ mailing list:http://imagej.nih.gov/ij/list.html > > -- > > ImageJ mailing list:http://imagej.nih.gov/ij/list.html > > > > ____________________________________________________________________________________ > > Your personal email. Anytime, anywhere. > > Ridiculously affordable at $19.95. No contracts. > > http://www.getpeek.com/lavabit.html > > ____________________________________________________________________________________ > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Probably I didn't explain well my problem in the previous emails.
I don't need higher order transformation, shift and rotation are enough. This is why I'm trying to find a way to register my images in the simpliest and fastest method possible with a few ROI. The plugin that is closer to my needs is "Align images by line ROI" but with RGB support. Maybe there's nothing like this out there...but why not give it a try in this super-helpful mailinglist? Many thanks for your time Stephan and thanks to anyone will answer! Riccardo On 11/01/2013 15:22, Stephan Saalfeld wrote: > Riccardo, > > a single line segment makes only two points. You can just set the start > and end-point of the line and then estimate a translation (shift only), > rigid transformation (shift and rotation), or similarity transformation > (shift, rotation, and isotropic scale). For higher order > transformations, you need more points that are not on a single line. > > If you have more than one line segment, you can convert them to start > and end points each and you will be fine. > > Read about the Roi methods---it's probably fairly easy to do. > > Best, > Stephan > > > > > On Fri, 2013-01-11 at 15:09 +0100, Riccardo Cabbri wrote: >> Hi Stephan, >> thanks for the advice! >> Your plugin works very well, but I don't have so many secure >> correspondence points on my images, so I am thinking about the >> possibility of converting some lines in a group of points. >> Do you think that a couple of lines would generate enough points for the >> plugin?(maybe it is possible to have one point for every pixel of the line). >> Is there a way to do this in imagej? >> Many thanks! >> Riccardo >> >> On 07/01/2013 00:21, Stephan Saalfeld wrote: >>> Hi Riccardo, >>> >>> have you checked this: >>> >>> http://fiji.sc/wiki/index.php/Landmark_Correspondences >>> >>> ? Instead of a line you would use points, but that shouldn't make it >>> more difficult. The benefit is that the plugin offers more choices for >>> the desired transformation model and that it can handle all types of >>> images. >>> >>> Best, >>> Stephan >>> >>> >>> >>> >>> >>> >>> On Sat, 2013-01-05 at 16:22 +0100, Riccardo Cabbri wrote: >>>> Hi everybody, >>>> My goal is to use ImageJ/Fiji to compare images of the same object taken >>>> in different times, so I want to align them using ROI. >>>> I found thishttp://fiji.sc/wiki/index.php/Align_Image_by_line_ROI that >>>> is almost pefect but can't handle RGB images. >>>> Are there any alternatives? >>>> Thanks in advance! >>>> >>>> -- >>>> ImageJ mailing list:http://imagej.nih.gov/ij/list.html >>> -- >>> ImageJ mailing list:http://imagej.nih.gov/ij/list.html >>> >>> ____________________________________________________________________________________ >>> Your personal email. Anytime, anywhere. >>> Ridiculously affordable at $19.95. No contracts. >>> http://www.getpeek.com/lavabit.html >>> ____________________________________________________________________________________ >> > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > ____________________________________________________________________________________ > Before digital, there was mechanical. View and purchase fascinating mechanical > antique pocket watches and vintage wrist watches. Visit Bogoff Antiques today. > http://www.bogoff.com > ____________________________________________________________________________________ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Stephan Saalfeld
Hi Riccardo,
On Thu, 17 Jan 2013, Riccardo Cabbri wrote: > I sent you an e-mail a few months ago about your plugin "Align Image by > line ROI". Generally it is a better idea to send such mails to the mailing list. I am often too busy to take care of all the Fiji issues, but thankfully others can help, too, if you let them. Besides, if I resolve a problem but only one person knows about it, it is a less good use of my time than if there is a public record. > We need to compare pictures of honeybee's brood combs to study the > effect on brood of treatments against varroosis (a disease also called > "the beekeeper's plague" for its severity) and Nosemosis type C (an > emergent pathogen for honeybees in europe). > > A plugin for Fiji to do so already exists, but I don't want to use it > because it is proprietary software (I am a free software lover and an > enthusiast debian user from many years). > > In these weeks I wrote a macro set that almost completely replace it, > the missing part is some code that align the images taken in different > times, so I can mark some cells on the comb as ROI and then I can locate > them on the subsequent pictures. > > Looking for something like this I found your plugin that works perfectly > for my needs except for the fact that handles only grayscale images. Do > you think that it is possible to obtain RGB aligned images? In another thread [*1*], Stephan Saalfeld pointed to the Landmark Correspondences plugin: http://fiji.sc/Landmark_Correspondences It is not only more powerful than the Align by Line ROI plugin, but it can do exactly the same things, too. By selecting two points in each image (which is basically the same as selecting a line) you have all you need to run the Landmark Correspondences plugin. It will ask you for a source image (which is the one that will be transformed) and a template image (onto which it will be transformed). The transformation method does not matter since you only provide two points and there is only one solution. Same for alpha and mesh resolution. The only thing to be careful about is the transformation class: if you choose "Rigid", it will only translate and rotate, but not scale. "Similarity" will scale, too. In case that it is more convenient for you to let the user choose line ROIs over point ROIs, feel free to use this macro to convert all line ROIs in all open images to point ROIs: -- snip -- function lineToPointROI() { if (selectionType() != 5) return; // only works on line ROIs getSelectionCoordinates(x, y); makeSelection("point", x, y); } for (id = 1; id <= nImages(); id++) { selectImage(id); lineToPointROI(); } -- snap -- Ciao, Johannes Footnote *1*: http://thread.gmane.org/gmane.comp.java.imagej/27052 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
I was making mistakes in selecting points, so the plugin "Landmark
Correspondences" returned that I didn't have enough points. This is why I was stuck with the idea that I needed to use "Align image with line ROI". Now always works as expected. So sorry for my mistake and for bothering you. Many thanks to all, Riccardo On 17/01/2013 18:08, Johannes Schindelin wrote: > Hi Riccardo, > > On Thu, 17 Jan 2013, Riccardo Cabbri wrote: > >> I sent you an e-mail a few months ago about your plugin "Align Image by >> line ROI". > Generally it is a better idea to send such mails to the mailing list. I am > often too busy to take care of all the Fiji issues, but thankfully others > can help, too, if you let them. > > Besides, if I resolve a problem but only one person knows about it, it is > a less good use of my time than if there is a public record. > >> We need to compare pictures of honeybee's brood combs to study the >> effect on brood of treatments against varroosis (a disease also called >> "the beekeeper's plague" for its severity) and Nosemosis type C (an >> emergent pathogen for honeybees in europe). >> >> A plugin for Fiji to do so already exists, but I don't want to use it >> because it is proprietary software (I am a free software lover and an >> enthusiast debian user from many years). >> >> In these weeks I wrote a macro set that almost completely replace it, >> the missing part is some code that align the images taken in different >> times, so I can mark some cells on the comb as ROI and then I can locate >> them on the subsequent pictures. >> >> Looking for something like this I found your plugin that works perfectly >> for my needs except for the fact that handles only grayscale images. Do >> you think that it is possible to obtain RGB aligned images? > In another thread [*1*], Stephan Saalfeld pointed to the Landmark > Correspondences plugin: > > http://fiji.sc/Landmark_Correspondences > > It is not only more powerful than the Align by Line ROI plugin, but it can > do exactly the same things, too. > > By selecting two points in each image (which is basically the same as > selecting a line) you have all you need to run the Landmark > Correspondences plugin. It will ask you for a source image (which is the > one that will be transformed) and a template image (onto which it will be > transformed). The transformation method does not matter since you only > provide two points and there is only one solution. Same for alpha and mesh > resolution. > > The only thing to be careful about is the transformation class: if you > choose "Rigid", it will only translate and rotate, but not scale. > "Similarity" will scale, too. > > In case that it is more convenient for you to let the user choose line > ROIs over point ROIs, feel free to use this macro to convert all line ROIs > in all open images to point ROIs: > > -- snip -- > function lineToPointROI() { > if (selectionType() != 5) > return; // only works on line ROIs > getSelectionCoordinates(x, y); > makeSelection("point", x, y); > } > > for (id = 1; id<= nImages(); id++) { > selectImage(id); > lineToPointROI(); > } > -- snap -- > > Ciao, > Johannes > > Footnote *1*: http://thread.gmane.org/gmane.comp.java.imagej/27052 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Riccardo,
On Thu, 17 Jan 2013, Riccardo Cabbri wrote: > I was making mistakes in selecting points, so the plugin "Landmark > Correspondences" returned that I didn't have enough points. Oh, that explains it! > This is why I was stuck with the idea that I needed to use "Align image > with line ROI". > > Now always works as expected. Great! > So sorry for my mistake and for bothering you. No need to be sorry, you did not bother me. It actually bothered me that I did not have time to work on this, especially since it turned out to be a very small change in the plugin. For what it's worth, I uploaded an updated version that does not only support color images, but it also has checkboxes to turn off scaling or rotation if needed, thanks to Michel Teussink. Ciao, Johannes -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |