[Insight-users] itk::OrientImageFilter

Xavier Planes xplanes at cistib.upf.edu
Mon Feb 2 10:01:56 EST 2009


Hi,

                I've tried to use the filter itk::OrientImageFilter. I've read a several documentation about DICOM orientation standards, tried some source code examples and read several emails in the mailing list without success...  . My main goal is to be able to transform the DICOM volume image that can be in any DICOM orientation (LPS, RAS, RAI, LPI, ...) to an itk Volume image always oriented in the same way (for example LPS).

                I've tried this code:

                typedef itk::OrientedImage<dcmAPI::PixelType, 3> OrientedVolumeType;
                typedef itk::ImageSeriesReader< OrientedVolumeType > VolumeReader;

                VolumeReader::Pointer volumeReader = VolumeReader::New();
                itk::GDCMImageIO::Pointer dicomIO = itk::GDCMImageIO::New();
                volumeReader->SetImageIO( dicomIO );
                volumeReader->SetFileNames( sliceFilePaths );
                volumeReader->Update();
                OrientedVolumeType::Pointer volume = volumeReader->GetOutput();

itk::OrientImageFilter<VolumeType,VolumeType>::Pointer orienter = itk::OrientImageFilter<VolumeType,VolumeType>::New();
                orienter->UseImageDirectionOn();
                orienter->SetDesiredCoordinateOrientation( itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_LPS);
                orienter->SetInput(volume);
                orienter->Update();

                It works fine with RAI input image orientation. However, it doesn't work for RSA input image orientation because the output image is not in LPS orientation. I've used VolView to check that the input images are correct and it works fine: the VTK output image is always in the same orientation.

I've also debugged a little bit with DICOM RSA input orientation. The itk::OrientImageFilter does this steps:

1.       RSA -> RAS. Permute Y And Z axis

2.       RAS -> LAS. Flip X axis

3.       LAS -> LPS. Flip Y axis
However the output is not correct. It seems that when input image is permuted (Y and Z axis), the orientation of the third axis is also indirectly flipped (X). So after the permute filter, the image orientation is not RAS, as it was expected by the filter.

I was thinking to create a table for permutation and flipping parameters depending on each orientation. However I don't have sample DICOM data for all the possible orientations.

Has anybody tried this filter? Has anybody tried RSA orientation input image? Do you know what input image orientations have been tried?

Thanks!
Xavi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090202/a1a5fce8/attachment.htm>


More information about the Insight-users mailing list