Re: Help with Align image by line ROI

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/Advice-for-GUI-plugin-development-tp5001300p5001457.html

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