[ITK-users] OrientImageFilter flipping VectorImage
mbcx9rb9
richard.brown at ucl.ac.uk
Mon Jun 11 10:12:07 EDT 2018
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/
More information about the Insight-users
mailing list