users

users >

**RE: applying computed registration to different images**Jan 31, 2018 09:01 PM | Torsten Rohlfing -

*Google LLC*RE: applying computed registration to different images

Hi Andrea -

Yes, you should be able to apply the same transformations to different image stacks.

Look for the "reformatx" binary. The general command line syntax is like so:

reformatx -o OUT --floating FLT REF XFORMS

where

OUT is the path/filename of the output image, FLT is the floating (or moving) image, and REF is the reference (or fixed) image. Basically, the floating image is resliced to the space of the reference image (you can configure what type of interpolation is used in the process; see output of "reformatx --help" for details.

Further, XFORMS is a series of one or more transformations, which are applied in concatentation. Each of the transformations can be prefixed with "-i" (or "--inverse", if you prefer), to apply the inverse transform instead. Note that only linear (affine or rigid) transformations can be exactly inverted. For nonrigid (warp) transformations, the inverse is approximated numerically, which takes a lot more time and may fail if the transformation is non-invertible or otherwise poorly behaved.

As a specific example, note that if

reformatx --floating A B X1 X2 X3

reslices B to A, then the following will reslice A to B:

reformatx --floating B A -i X3 -i X2 -i X1

That is, to invert a series of transformations, you'd have to invert each one *and* reverse the order of transformations. (I suspect that's way more than you needed to know).

Hope this helps! As for where Fiji actually has CMTK store the transformations you need, and how they are named, that would need to be answered by someone else.

Best,

Torsten

Yes, you should be able to apply the same transformations to different image stacks.

Look for the "reformatx" binary. The general command line syntax is like so:

reformatx -o OUT --floating FLT REF XFORMS

where

OUT is the path/filename of the output image, FLT is the floating (or moving) image, and REF is the reference (or fixed) image. Basically, the floating image is resliced to the space of the reference image (you can configure what type of interpolation is used in the process; see output of "reformatx --help" for details.

Further, XFORMS is a series of one or more transformations, which are applied in concatentation. Each of the transformations can be prefixed with "-i" (or "--inverse", if you prefer), to apply the inverse transform instead. Note that only linear (affine or rigid) transformations can be exactly inverted. For nonrigid (warp) transformations, the inverse is approximated numerically, which takes a lot more time and may fail if the transformation is non-invertible or otherwise poorly behaved.

As a specific example, note that if

reformatx --floating A B X1 X2 X3

reslices B to A, then the following will reslice A to B:

reformatx --floating B A -i X3 -i X2 -i X1

That is, to invert a series of transformations, you'd have to invert each one *and* reverse the order of transformations. (I suspect that's way more than you needed to know).

Hope this helps! As for where Fiji actually has CMTK store the transformations you need, and how they are named, that would need to be answered by someone else.

Best,

Torsten

## Threaded View

Title | Author | Date |
---|---|---|

Andrea Urru |
Jan 30, 2018 | |

Torsten Rohlfing |
Jan 31, 2018 | |

Greg Jefferis |
Mar 7, 2018 | |