[Insight-developers] Orientation information being lost

Richard Beare richard.beare at gmail.com
Mon Mar 15 19:11:25 EDT 2010


The problem appears to have been related to the sform and qform codes
being set to 0, which I think happened during conversion phases that
weren't anything to do with ITK. A code of 0 means that the
orientation matrices aren't set, so presumably ITK's nifti writer
inserts some defaults. Once I fixed that problem the filter behaved as
expected.

On Tue, Mar 16, 2010 at 5:50 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> Hi Richard,
>
>
> Image direction, along with origin, and spacing should be
> copied automatically by "CopyInformation()" which in turn
> is invoked by the call
>
>     ProcessObject::GenerateOutputInformation().
>
> In line 1108 of the file itkProcessObject.cxx
>
>
> Are you overloading this method ?
> (the method GenerateOutputInformation())
>
> and if so:
>
> A) Are you calling the method
>
>        ProcessObject::GenerateOutputInformation().
>
>     from your overloaded method ?
>
> or
>
>
> B)  Are you calling CopyInformation() yourself
>     from your overloaded method ?
>
>
>
> Please let us know,
>
>
>      Thanks
>
>
>            Luis
>
>
> -------------------------------------------------------------------------------
>
> On Tue, Mar 9, 2010 at 1:12 AM, Richard Beare <richard.beare at gmail.com> wrote:
>> Hi,
>> I'm using a seeed region growing filter (one of mine) to carry out a
>> simple segmentation. The filter doesn't do anything unusual in terms
>> of creating output images, simply using the AllocateOutputs() call.
>> The input image and input seeds have the following orientation
>> information reported by fslhd:
>>
>> qform_name     Unknown
>> qform_code     0
>> qto_xyz:1      0.027032  0.000000  0.000000  0.000000
>> qto_xyz:2      0.000000  0.027032  0.000000  0.000000
>> qto_xyz:3      0.000000  0.000000  0.027032  0.000000
>> qto_xyz:4      0.000000  0.000000  0.000000  1.000000
>> qform_xorient  Left-to-Right
>> qform_yorient  Posterior-to-Anterior
>> qform_zorient  Inferior-to-Superior
>> sform_name     Unknown
>> sform_code     0
>> sto_xyz:1      0.000000  0.000000  0.000000  0.000000
>> sto_xyz:2      0.000000  0.000000  0.000000  0.000000
>> sto_xyz:3      0.000000  0.000000  0.000000  0.000000
>> sto_xyz:4      0.000000  0.000000  0.000000  0.000000
>> sform_xorient  Unknown
>> sform_yorient  Unknown
>> sform_zorient  Unknown
>>
>>
>> My output has the following orientation, even if I do a
>> CopyInformation call using the input image as the template:
>>
>> qform_name     Aligned Anat
>> qform_code     2
>> qto_xyz:1      -0.027032  0.000000  0.000000  -0.000000
>> qto_xyz:2      0.000000  -0.027032  0.000000  -0.000000
>> qto_xyz:3      0.000000  0.000000  0.027032  0.000000
>> qto_xyz:4      0.000000  0.000000  0.000000  1.000000
>> qform_xorient  Right-to-Left
>> qform_yorient  Anterior-to-Posterior
>> qform_zorient  Inferior-to-Superior
>> sform_name     Scanner Anat
>> sform_code     1
>> sto_xyz:1      -0.027032  0.000000  0.000000  -0.000000
>> sto_xyz:2      0.000000  -0.027032  0.000000  -0.000000
>> sto_xyz:3      0.000000  0.000000  0.027032  0.000000
>> sto_xyz:4      0.000000  0.000000  0.000000  1.000000
>> sform_xorient  Right-to-Left
>> sform_yorient  Anterior-to-Posterior
>> sform_zorient  Inferior-to-Superior
>> file_type      NIFTI-1+
>> file_code      1
>>
>> Is this something to do with sform information not being set? Any
>> suggestions as to the correct way to deal with this?
>> _______________________________________________
>> 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.html
>>
>> 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
>>
>


More information about the Insight-developers mailing list