Re: grid aligner plugin error

Posted by Nico Stuurman on
URL: http://imagej.273.s1.nabble.com/grid-aligner-plugin-error-tp5015194p5015222.html

> I've got grid aligner working now ( I just removed it and reinstalled it
> under FIJI and it works now.
> The alignment between my images looks perfect, but it looks like the
> plugin
> is changing my intensity values.
>    Is this normal?  as an example I drew  a line in the raw data and the
> aligned data in the aligned data the min and max are 0 and 257 where as in
> the original raw data they are 250.69 and 386.89
>
>> Looks like you are working with images of type float (32-bit images).  I
>> never tried those, and certainly did not provide a code-path for them, so
>> it is unclear what will happen.  You could try converting first to 16-bit
>> images.
>   The images I'm using are 16-bit (they come from an andor ixon camera) What
> I am seeing is that after calculating the transform when I apply it the new
> image is registered fine, but when I look at the image histograms, the
> histogram for channel 2 is always a series of discrete spikes, where as in
> the original image it was a smooth looking histogram. The histogram for
> channel 1 remains unchanged. Please let me know what you think..

Hmm.  I can indeed reproduce this odd behavior.  I seem to be getting
discrete values spaced at 256 intervals (as if the affine transform
takes place in 8 bit and the result is scaled back to 16-bit).  The code
uses the java class java.awt.image.AffineTransformOp to execute the
affine transform. That class has a setting for the method of "filling
in" pixel values.  By changing the method from Bicubic to Bilinear, the
behavior improves, and I no longer see discrete values in the output.  I
made that changed code available as version 0.13.

Eventually, it would be nice for the plugin to be transformed into a
Fiji plugin and to use imglib2 (or Image Ops) to execute the affine
transform.  Maybe when I retire... (or if anyone else feels up to the
task, code is available here:
https://valelab.ucsf.edu/svn/valelabtools/IJPlugins/GridAligner/src/).

Best,

Nico

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html