users > Domain of inverse coordinate transformation
Showing 1-4 of 4 posts
Display:
Results per page:
Dec 10, 2015  08:12 PM | Max Nikitchenko - Harvard
Domain of inverse coordinate transformation
Hi,

I'm confused with what is the domain of the inverse coordinate transform. I would assume that it corresponds to the domain of the floating image, but using streamxform with such coordinates results in an error. To be specific, here is the example.

The target_source_warp_m0g80c8e1e-1x52r3.list xform for the non-linear registration of source to target contains the following information:
warp/registration:
    domain: 494.76 1121.19 274
    reference study: target.nrrd
        495.56 x 1121.99 x 276 microns (621 x 1406 x 138 slices)
    floating study: images/source.nrrd
        531.37 x 1036.17 x 360 microns (700 x 1365 x 180 slices)
(I also included the meta-data from the .nrrd files).
If I transform coordinates from the reference to the floating space, and keep the the coordinates within the domain given in the registration file, everything goes well:
echo 494 1121 274 | streamxform target_source_warp_m0g80c8e1e-1x52r3.list
# 551.15 1072.35 35 347.59
However, the inverse coordinate transform gives an error:
echo 500 700 10 | streamxform -- --inverse target_source_warp_m0g80c8e1e-1x52r3.list
# 490 750 0 FAILED

What am I missing?

Thank you,
Max
Dec 11, 2015  03:12 PM | Greg Jefferis
RE: Domain of inverse coordinate transformation
Hi Max,

I think you have the forward/inverse transform correctly defined but this is a source of endless confusion, so it would be good to check carefully. See e.g. https://github.com/jefferislab/BridgingRegistrations#3d-coordinates.

However assuming that you have that correct, there are other potential reasons for failure.

Inversion can fail if there is folding in the deformation field (which can sometimes happen in difficult regions).

But the most likely reason to my mind is that the test point in source coordinates that you are trying to map onto target coordinates simply does not transform into the target domain. If you take your original source and reformatted image data, could you find this point 500 700 10 in the reformatted image?

For example maybe slice 5 (z pos 10) is blank or simply not matched on that edge (x=500) to any place in the target image.

As ever, Torsten may have more to advise.

Best wishes,

Greg.
Dec 11, 2015  11:12 PM | Torsten Rohlfing
RE: Domain of inverse coordinate transformation
I think Greg got it exactly right - yes, the input of the inverse transform is the coordinate space of the floating image, BUT the effective domain of the transform is the intersection of the floating image domain with the image (in the function sense; https://en.wikipedia.org/wiki/Image_(mat...) of the reference image domain in the floating image under the forward transform.

In simpler terms, imagine both reference and floating image are identical squares, and the transform is a rotation around the image center, say by 45 degrees. Then all corners of the floating image are outside the area covered by the transformed reference image. For affine transformations that doesn't matter, since you can apply the transformation matrix regardless of where you are. But for a warp transform, at points where the forward transformation doesn't map to, you know nothing about the transformation, thus there can be no inverse transformation at those points.

Makes sense?

Torsten
Dec 19, 2015  01:12 PM | Max Nikitchenko - Harvard
RE: Domain of inverse coordinate transformation
Dear Torsten and Greg,

Thank you very much for your quick responses! Before replying, I wanted to check your suggestions -- you were right. I didn't expect the registration to transform the floating stack as much as it did. As a result, some z-plains weren't mapped at all, hence my confusion.

Max