[MINC-users] Issue with itk_convert_xfm

Andrew Wood andrew at biospective.com
Thu Jan 14 15:18:15 EST 2016


Hi all,

I came across a set of transforms generated by ANTs which I've been trying
to convert and use on minc volumes. There seems to be a bug in one or more
of the tools I'm using, where applying the transforms to nifti volumes does
not give the same result as applying them to minc volumes.

Likely culprits:
- itk_convet_xfm
- mnc2nii or nii2mnc
- antsApplyTransforms
- mincresample

Somewhere along the way, several components of the transforms get inverted.
Here is an example:

$ make_phantom phantom.mnc
$ param2xfm -translation 10 10 10 trans.xfm

# Apply the xfm
$ mincresample -use_input_sampling -transform trans.xfm phantom.mnc out.mnc

# Do the same transform in nifti space
$ itk_convert_xfm trans.xfm trans.mat
$ mnc2nii phantom.mnc phantom.nii
$ antsApplyTransforms --input phantom.nii \
--transform trans.mat \
--output out.nii \
--reference-image phantom.nii

# Open result in a minc+nifti-friendly viewer, or convert back to minc
$ nii2mnc out.nii thru_nifti.mnc
$ register out.mnc thru_nifti.mnc

The result of this for me is that the z component of the transform was
inverted, but the x and y components are OK.

>From experimenting with various simple transforms, it seems that the
following components are inverted:
   - z translation
   - z rotation
   - x,y,z scale
   - x shear

Has anybody else noticed or dealt with this before?

Thanks,
Andrew


More information about the MINC-users mailing list