mbcx9rb9
2018-06-11 14:17:59 UTC
I have a multicomponent nifti image. It's a 3D volume and each voxel contains
3 values. I can then either save this to disk as a multicomponent nifti
image or as 3 single component images.
Using fslhd, I verify that all the headers of the single- and
multi-component files are identical, except for the obvious fact that one is
single component and the other is multi (e.g., dim0=3 vs. dim0=5). One thing
that is particularly important is that they both are in RAS, as shown in
this snippet:
qform_xorient Right-to-Left
qform_yorient Anterior-to-Posterior
qform_zorient Superior-to-Inferior
I read and reorient the images with a templated method:
typedef itk::ImageFileReader<ITKImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(filename);
reader->Update();
ITKImageType::Pointer itk_image_orig = reader->GetOutput();
typename
itk::OrientImageFilter<ITKImageType,ITKImageType>::Pointer orienter =
itk::OrientImageFilter<ITKImageType,ITKImageType>::New();
orienter->UseImageDirectionOn();
orienter->SetInput(itk_image_orig);
orienter->SetDesiredCoordinateOrientation(
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RAS);
orienter->Update();
ITKImageType::Pointer itk_image = orienter->GetOutput();
std::cout << "\nflip axis:\n" << orienter->GetFlipAxes() << "\n";
Where the template is:
- itk::Image<float, 3> for the single component images
or
- itk::VectorImage<float, 3> for the multi component images
========
The problem
========
The images are given in RAS and the desired output is RAS, so no changes
should take place.
output for single component images: "flip axis: [0, 0, 0]"
output for multi component images: "flip axis: [0, 0, 1]"
This is causing problems as the origin moves accordingly for multicomponent
images. Is there any obvious reason as to why this is happening? Have I made
a mistake somewhere? Is this a bug?
Thanks
--
Sent from: http://itk-users.7.n7.nabble.com/
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
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://www.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:
https://itk.org/mailman/listinfo/insight-users
3 values. I can then either save this to disk as a multicomponent nifti
image or as 3 single component images.
Using fslhd, I verify that all the headers of the single- and
multi-component files are identical, except for the obvious fact that one is
single component and the other is multi (e.g., dim0=3 vs. dim0=5). One thing
that is particularly important is that they both are in RAS, as shown in
this snippet:
qform_xorient Right-to-Left
qform_yorient Anterior-to-Posterior
qform_zorient Superior-to-Inferior
I read and reorient the images with a templated method:
typedef itk::ImageFileReader<ITKImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(filename);
reader->Update();
ITKImageType::Pointer itk_image_orig = reader->GetOutput();
typename
itk::OrientImageFilter<ITKImageType,ITKImageType>::Pointer orienter =
itk::OrientImageFilter<ITKImageType,ITKImageType>::New();
orienter->UseImageDirectionOn();
orienter->SetInput(itk_image_orig);
orienter->SetDesiredCoordinateOrientation(
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RAS);
orienter->Update();
ITKImageType::Pointer itk_image = orienter->GetOutput();
std::cout << "\nflip axis:\n" << orienter->GetFlipAxes() << "\n";
Where the template is:
- itk::Image<float, 3> for the single component images
or
- itk::VectorImage<float, 3> for the multi component images
========
The problem
========
The images are given in RAS and the desired output is RAS, so no changes
should take place.
output for single component images: "flip axis: [0, 0, 0]"
output for multi component images: "flip axis: [0, 0, 1]"
This is causing problems as the origin moves accordingly for multicomponent
images. Is there any obvious reason as to why this is happening? Have I made
a mistake somewhere? Is this a bug?
Thanks
--
Sent from: http://itk-users.7.n7.nabble.com/
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
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://www.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:
https://itk.org/mailman/listinfo/insight-users