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.
$ mri_info template.nii.gz 
Volume information for template.nii.gz
          type: nii
    dimensions: 142 x 151 x 104
   voxel sizes: 1.7000, 1.7000, 1.7000
          type: FLOAT (3)
           fov: 241.400
           dof: 0
        xstart: -120.7, xend: 120.7
        ystart: -128.4, yend: 128.4
        zstart: -88.4, zend: 88.4
            TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 
degrees
       nframes: 1
       PhEncDir: UNKNOWN
ras xform present
    xform info: x_r =  -0.0506, y_r =   0.0557, z_r =   0.9972, c_r =    -1.2606
              : x_a =  -0.9987, y_a =  -0.0028, z_a =  -0.0505, c_a =    14.0143
              : x_s =   0.0000, y_s =   0.9984, z_s =  -0.0558, c_s =   -13.0322
Orientation   : PSR
Primary Slice Direction: sagittal

voxel to ras transform:
               -0.0860   0.0948   1.6952   -90.4587
               -1.6978  -0.0048  -0.0859   139.3876
                0.0000   1.6973  -0.0949  -136.2474
                0.0000   0.0000   0.0000     1.0000

voxel-to-ras determinant -4.913

ras to voxel transform:
               -0.0298  -0.5875  -0.0000    79.1956
                0.0328  -0.0017   0.5873    83.2187
                0.5866  -0.0297  -0.0328    52.7279
                0.0000   0.0000   0.0000     1.0000

$ mri_info label.nii.gz 
Volume information for label.nii.gz
          type: nii
    dimensions: 182 x 218 x 182
   voxel sizes: 1.0000, 1.0000, 1.0000
          type: FLOAT (3)
           fov: 182.000
           dof: 0
        xstart: -91.0, xend: 91.0
        ystart: -109.0, yend: 109.0
        zstart: -91.0, zend: 91.0
            TR: 1000.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 
degrees
       nframes: 1
       PhEncDir: UNKNOWN
ras xform present
    xform info: x_r =  -1.0000, y_r =   0.0000, z_r =   0.0000, c_r =    -1.0000
              : x_a =   0.0000, y_a =   1.0000, z_a =   0.0000, c_a =   -17.0000
              : x_s =   0.0000, y_s =   0.0000, z_s =   1.0000, c_s =    19.0000
Orientation   : LAS
Primary Slice Direction: axial

voxel to ras transform:
               -1.0000   0.0000   0.0000    90.0000
                0.0000   1.0000   0.0000  -126.0000
                0.0000   0.0000   1.0000   -72.0000
                0.0000   0.0000   0.0000     1.0000

voxel-to-ras determinant -1

ras to voxel transform:
               -1.0000   0.0000   0.0000    90.0000
               -0.0000   1.0000  -0.0000   126.0000
               -0.0000  -0.0000   1.0000    72.0000
                0.0000   0.0000   0.0000     1.0000
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
-- 
Seung-Goo KIM

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply via email to