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,
Dear freesurfer developers,
Following the previous e-mail, it seems like a variable handling bug.
From the mri_convert.c, lines from 2588 to 2606 appear to be the part that handles “out_like” option. the variable “resample_type_val” in line 2605 should contain the user-specified value, but it seems it doesn’t (although I’m not very good at reading c codes..).
Please correct me if I’m wrong and just me using mri_convert in a wrong way.
Best,
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