Hi Bruce,
Thank you for response. This is the output message:
$ mri_convert -rt nearest --like template.nii.gz label.nii.gz label_nn.nii.gz mri_convert -rt nearest --like template.nii.gz label.nii.gz label_nn.nii.gz $Id: mri_convert.c,v 1.179.2.7 2012/09/05 21:55:16 mreuter Exp $ reading from label.nii.gz... TR=1000.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (0, 1, 0) k_ras = (0, 0, 1) INFO: transform src into the like-volume: template.nii.gz writing to label_nn.nii.gz...
It doesn’t print out interpolation method for reslicing, which I see when running mri_convert without “—like” switch. And the output (label_nn.nii.gz) has mixed labels due to linear interpolation.
Just in case, please find the attached for the header information of the two image files.
Best, -SG
Hi Seung-Goo
I would have that that your command line would work as is. Can you send us the full screen output? cheers Bruce On Fri, 16 Oct 2015, Seung-Goo KIM wrote:
Dear all, I wish to know whether mri_convert provide a nifty way to reslice and crop a NIFTI image with labels (positive integers) with “—like” and “-rt” options. It seems like “—like” option overrides “-rt” option, thus the result from such a command:
mri_convert -rt nearest —like ${referenceImage} ${inputImage} ${outputImage}is resampled with trilinear interpolation. I don’t know if I did something wrong (maybe file format?) or this is a bug in mri_convert. Of course, one can write a script that creates binary images for each label values, transforms it (using "mri_convert —like"), threshold it (like value>0.1), and finally finds the label with the highest value (probability) for each voxel in the reference space. But I believe there should be a simpler and faster way to do this with mri_convert or any other program in freesurfer :) FIY, the version of freesurfer package I use is "Linux-centos6_x86_64-stable-pub-v5.3.0”. Best regards, -- Seung-Goo KIM
freesurfer@nmr.mgh.harvard.edu