[Insight-developers] problems with MGH IO module

Richard Beare richard.beare at gmail.com
Tue Sep 24 23:59:51 EDT 2013


Thanks,
I've tested this with my data and it seems to fix the problem.

Thanks!


On Wed, Sep 25, 2013 at 7:46 AM, Jean-Christophe Fillion-Robin <
jchris.fillionr at kitware.com> wrote:

> Hi Richard,
>
> There is currently a patch being reviewed, could you test that that it fix
> the problem for you ?
> See http://review.source.kitware.com/#/c/12771/
>
> Thanks
> Jc
>
>
> On Tue, Sep 24, 2013 at 5:15 PM, Richard Beare <richard.beare at gmail.com>wrote:
>
>> Hi,
>> I'm having problems with the MGH IO module enabled under ITK 4.5 that I'm
>> using to process Freesurfer data. I'm not sure who is looking after this
>> code.
>>
>> The first problem (minor), is that the freesurfer filenames like
>> aparc.a2009s+aseg.mgz  seem to not pass the modules readability test.
>> Copying to a name without + or . seems to solve the problem.
>>
>> The more serious problem is lack of origin preservation. My input has the
>> following, reported by mri_info:
>>
>>           type: MGH
>>     dimensions: 256 x 256 x 256
>>    voxel sizes: 1.0000, 1.0000, 1.0000
>>           type: UCHAR (0)
>>            fov: 256.000
>>            dof: 0
>>         xstart: -128.0, xend: 128.0
>>         ystart: -128.0, yend: 128.0
>>         zstart: -128.0, zend: 128.0
>>             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 =  -1.0000, y_r =   0.0000, z_r =   0.0000, c_r =
>> 6.7153
>>               : x_a =   0.0000, y_a =   0.0000, z_a =   1.0000, c_a =
>> 12.4186
>>               : x_s =   0.0000, y_s =  -1.0000, z_s =   0.0000, c_s =
>> -8.1481
>>
>> talairach xfm :
>> /home/rbeare/NCIdv0_scratch/ADNIMRI/Freesurfer//0720/mri/transforms/talairach.xfm
>> Orientation   : LIA
>> Primary Slice Direction: coronal
>>
>> voxel to ras transform:
>>                -1.0000   0.0000   0.0000   134.7153
>>                 0.0000   0.0000   1.0000  -115.5814
>>                 0.0000  -1.0000   0.0000   119.8519
>>                 0.0000   0.0000   0.0000     1.0000
>>
>> My output is:
>>
>> Volume information for /tmp/h.mgz
>>           type: MGH
>>     dimensions: 256 x 256 x 256
>>    voxel sizes: 1.0000, 1.0000, 1.0000
>>           type: INT (1)
>>            fov: 256.000
>>            dof: 1
>>         xstart: -128.0, xend: 128.0
>>         ystart: -128.0, yend: 128.0
>>         zstart: -128.0, zend: 128.0
>>             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 =  -1.0000, y_r =  -0.0000, z_r =  -0.0000, c_r =
>> -6.7153
>>               : x_a =   0.0000, y_a =   0.0000, z_a =   1.0000, c_a =
>> -12.4186
>>               : x_s =   0.0000, y_s =  -1.0000, z_s =   0.0000, c_s =
>> -8.1481
>>
>> talairach xfm :
>> Orientation   : LIA
>> Primary Slice Direction: coronal
>>
>> voxel to ras transform:
>>                -1.0000  -0.0000  -0.0000   121.2847
>>                 0.0000   0.0000   1.0000  -140.4185
>>                 0.0000  -1.0000   0.0000   119.8519
>>                 0.0000   0.0000   0.0000     1.0000
>>
>> voxel-to-ras determinant -1
>>
>>
>> The output segmentation image does not align with the original in
>> freeview.
>>
>> If I display the images within the ITK code I get the expected matrices:
>> input
>>   RequestedRegion:
>>     Dimension: 3
>>     Index: [0, 0, 0]
>>     Size: [256, 256, 256]
>>   Spacing: [1, 1, 1]
>>   Origin: [-134.715, 115.581, 119.852]
>>   Direction:
>> 1 -5.36551e-19 0
>> 0 -0 -1
>> 5.36551e-19 -1 0
>>
>>   IndexToPointMatrix:
>> 1 -5.36551e-19 0
>> 0 0 -1
>> 5.36551e-19 -1 0
>>
>> output:
>>   RequestedRegion:
>>     Dimension: 3
>>     Index: [0, 0, 0]
>>     Size: [256, 256, 256]
>>   Spacing: [1, 1, 1]
>>   Origin: [-134.715, 115.581, 119.852]
>>   Direction:
>> 1 -5.36551e-19 0
>> 0 -0 -1
>> 5.36551e-19 -1 0
>>
>>   IndexToPointMatrix:
>> 1 -5.36551e-19 0
>> 0 0 -1
>> 5.36551e-19 -1 0
>>
>> If I use mri_convert to convert aseg.mgz to aseg.nii.gz and convert the
>> processed image back to mgz, everything works as expected.
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
>>
>>
>
>
> --
> +1 919 869 8849
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130925/1c062201/attachment.htm>


More information about the Insight-developers mailing list