users > applying computed registration to different images
Showing 1-3 of 3 posts
Jan 30, 2018 03:01 PM | Andrea Urru
applying computed registration to different images
Hi, I used the Fiji GUI. I registered the image and I have the
corresponding output files. I would like to know if I can use these
files to apply the same transformation to another stack, and how.
Thank you in advance,
Andrea
Andrea
Feb 1, 2018 05:02 AM | Torsten Rohlfing
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
Mar 7, 2018 09:03 AM | Greg Jefferis
RE: applying computed registration to different images
Originally posted by Torsten Rohlfing:
Just to add that if you were using the Fiji CMTK registration GUI your output registrations will be stored in a folder like so:
if the root folder of your registration project is called myregfolder.
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.
Just to add that if you were using the Fiji CMTK registration GUI your output registrations will be stored in a folder like so:
myregfolder/Registration/warp/NCD6RLH_NCD6RLH_sclrev01_warp_m0g40c4e1e-1x16r3.list
if the root folder of your registration project is called myregfolder.