Re: [fiji-devel] TransformJ Affine without changing image size

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [fiji-devel] TransformJ Affine without changing image size

dscho
Hi Sam,

On Fri, 21 Feb 2014, Sam Lord wrote:

> (I posted this to the ImageJ list, but then realized it's probably better
> posted here. Sorry.)

Actually, it is not *better*.

As Fiji is a distribution of ImageJ with a couple of plugins, fiji-devel
is an excellent place to discuss the development of that distribution
(i.e. issues regarding fiji-compat or fiji-lib and incompatibilities
between bare-bones ImageJ and Fiji -- which should not exist and therefore
are bugs to be fixed in Fiji) while the ImageJ list is an excellent place
to discuss ImageJ plugins.

For example, the developer of TransformJ is not a member of the fiji-devel
mailing list because he does not develop Fiji. He develops the ImageJ
plugin TransformJ.

> I like being able to use TransformJ Affine to apply an affine matrix to an
> image. However, when I deselect the "Adjust Size to Fit Results" option, it
> returns a blank image (all pixels have value 0). Is it possible to return a
> transformed image with the same dimensions, so I can merge channels with
> another color? (I am using this to manually register color channels.)

That sounds like a bug in TransformJ to me. Do you have a small example image
with a recorded macro demonstrating the bug?

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: [fiji-devel] TransformJ Affine without changing image size

samjlord
Johannes Schindelin wrote
ImageJ list is an excellent place to discuss ImageJ plugins.

For example, the developer of TransformJ is not a member of the fiji-devel
mailing list because he does not develop Fiji. He develops the ImageJ
plugin TransformJ.
OK, thanks Johannes!

Johannes Schindelin wrote
> I like being able to use TransformJ Affine to apply an affine matrix to an
> image. However, when I deselect the "Adjust Size to Fit Results" option, it
> returns a blank image (all pixels have value 0). Is it possible to return a
> transformed image with the same dimensions, so I can merge channels with
> another color? (I am using this to manually register color channels.)

That sounds like a bug in TransformJ to me. Do you have a small example image
with a recorded macro demonstrating the bug?
OK, here is a link to two images and a simple macro that runs the transform with and without the adjust feature: https://dl.dropboxusercontent.com/u/538627/sam%20transformj.zip

When the "adjust" option is not called, the resulting image is blank.

Thanks!

-Sam
Reply | Threaded
Open this post in threaded view
|

Re: [fiji-devel] TransformJ Affine without changing image size

dscho
Hi Sam,

On Mon, 24 Feb 2014, samjlord wrote:

> Johannes Schindelin wrote
>
> > [Actually, Sam wrote]
> >
> >> I like being able to use TransformJ Affine to apply an affine matrix
> >> to an image. However, when I deselect the "Adjust Size to Fit
> >> Results" option, it returns a blank image (all pixels have value 0).
> >> Is it possible to return a transformed image with the same
> >> dimensions, so I can merge channels with another color? (I am using
> >> this to manually register color channels.)
> >
> > That sounds like a bug in TransformJ to me. Do you have a small
> > example image with a recorded macro demonstrating the bug?
>
> OK, here is a link to two images and a simple macro that runs the transform
> with and without the adjust feature:
> https://dl.dropboxusercontent.com/u/538627/sam%20transformj.zip
>
> When the "adjust" option is not called, the resulting image is blank.

The simplified matrix is

        0.99 0.01 0  0
        0.01 1.02 0 -0.08
        0    0    1 -4.12

(I leave out the last line because it is immutable).

Keep in mind that this is really a rotation (the first three columns; and
I use the term "rotation" very liberally here) and a translation (the last
column).

Having three rows, it actually operates in 3D.

Please now note that the translation in z is -4.12. In other words, the
(two-dimensional) image is transformed by (very minimal) shearing and then
moving it 4 units down in z. That is well outside the original bounding
box (which is in the z = 0 plane), therefore you will only see the
background (= black) unless you adjust the bounding box to fit the result.

If you replace the -4.1165132 in your original matrix by 0, you will see
the result you expected.

Ciao,
Johannes

P.S.: And there is no bug for me to fix! Yay!

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: [fiji-devel] TransformJ Affine without changing image size

samjlord
Johannes Schindelin wrote
Having three rows, it actually operates in 3D.

Please now note that the translation in z is -4.12. In other words, the
(two-dimensional) image is transformed by (very minimal) shearing and then
moving it 4 units down in z. That is well outside the original bounding
box (which is in the z = 0 plane), therefore you will only see the
background (= black) unless you adjust the bounding box to fit the result.

If you replace the -4.1165132 in your original matrix by 0, you will see
the result you expected.
Hi Johannes,

Thanks for the pointer. I had somehow put that -4 translation in z instead of y. Thanks. works great when I put it in the right place.

-Sam