Mrconvert warp_image.mif into .nii.gz


I had the warps for each subject in a population from population_template output.
And, I converted one of these warps in .mif into nifti format via mrconvert.

Then, i tried to use mrtransform in order to apply registration by using warps. -warp_full option doesn’t work with .nii.gz so i reconverted it into .mif. Then, i noticed that the nifti and .mif warp images that i had , don’t contain linear transform matrix in the header and I had this error with mrtransform: « no linear transform found in initialisation syn warps image header »

when i check the warp image with mrinfo, that i converted from .mif into .nii.gz and reconverted from .nii.gz into .mif, don’t have any linear1 and linear2 matrix.

I had already extract the linear transformation matrix with warp images from population_template . So , is there any solution to get .mif warp image with linear transformation in it by using linear transformation matrix? or how can i get the .mif warp image containing linear transform matrix.


Converting from .mif to .nii gets rid of the header sections containing linear1 and linear2.

Do you still have the linear transformations from the population template temporary directory?

If you had them, you could calculate the halfway forward and halfway inverse transformations using transformcalc and manually add them to the header by converting the warps to .mih files in which you can add them as plain text:

fod_reorientation: 1
linear1: 0.96696915614105183 0.026820292680387825 -0.0018544509350943011 -0.29572993102134726
linear1: -0.031779066901726716 0.97163945660436346 -0.049435657406263406 -3.3967963023556806
linear1: -0.0078951544534489326 0.041231975415890687 0.99290726704689913 -0.93466948793584514
linear2: 1.0332252862043321 -0.028541840948719751 0.00050868892195938956 0.20908027883589017
linear2: 0.034139208721286229 1.0260753825035938 0.051150819674266705 3.5432741614991126
linear2: 0.0067980630508964971 -0.042836283508544154 1.0050233289219757 0.79586890149571943

I am not sure how to get the transformations if you discarded those. I would probably redo the nonlinear registration of each image to the template.

Note that you can compress .mif files by converting them to .mif.gz


Thank you very much8 !
it worked well i had the .mif with transformations in header now.