Mrtransform error

Hi, everyone
I’m trying to register my study specific template (i.e. wmfod_template.mif) to the FMRIB58_FA.nii.gz, and I encountered with this error below:

mrtransform: [ERROR] -reorient_fod yes/no needs to be explicitly specified for images with 45 volumes

I’ve searched in the forum, and found no related posts.
This is the commands I used:

mrconvert wmfod_template.mif wmfod_template_bad_strides.nii.gz
mrconvert wmfod_template_bad_strides.nii.gz wmfod_template.nii.gz -strides -1,2,3,4
mrconvert wmfod_template.nii.gz l0image.nii.gz -coord 3 0
flirt -ref FMRIB58_FA.nii.gz -in l0image.nii.gz -out l0image_MNI.nii.gz -omat wmfod_template_2_MNI.mat -dof 12
fnirt --ref=FMRIB58_FA.nii.gz --in=l0image.nii.gz --aff=wmfod_template_2_MNI.mat --cout=warps_wmfod_template_2_MNI
warpinit FMRIB58_FA.nii.gz identity_warp_MNI.nii
applywarp --ref=FMRIB58_FA.nii.gz --in=identity_warp_MNI.nii --warp=warps_wmfod_template_2_MNI.nii.gz --out=mrtrix_warp_wmfod_template2MNI.nii.gz
mrtransform wmfod_template.mif -warp mrtrix_warp_wmfod_template2MNI.nii.gz -template FMRIB58_FA.nii.gz wmfod_template_MNI.nii.gz
mrconvert -datatype uint32 wmfod_template_MNI.nii.gz wmfod_template_MNI.mif

I guess it is something incorrect with the warpinit? But I don’t know how to amend, it would be appreciated if anyone could help.

Best wishes,
Yuting

1 Like

I tried to fix this error, according to Max’s suggestion, and revised my command:

mrtransform wmfod_template.mif -warp mrtrix_warp_wmfod_template2MNI.nii.gz -template FMRIB58_FA.nii.gz wmfod_template_MNI.nii.gz -reorient_fod yes

And it worked, but the effcet was not good.

How can I optimize the result?

I finally figured out what’s the problem is!!! It is something wrong with the warpinit, turns out that I put the wrong image in, it should be warpinit source.nii identity_warp_[].nii.
Here is all of my codes about registration, I would be glad, if someone finds it helpful.

And this is the final effect of my registration work, it seems nice.

2 Likes