[ITK Community] OrientImageFilter ASL >> RAI wrong output?

p.wettmann at hispeed.ch p.wettmann at hispeed.ch
Thu Nov 28 10:32:39 EST 2013


hi,

I intend to read an arbitrary MRI file (e.g. RAI, ASL, ...) and convert it to RAI for further use. If i enter RAI, use orientImageFilter, output is correct RAI. However, if i enter ASL, output is not RAI. L/R axis is inverse. If I use LAI or a axis flip afterwards, the image seems to be correct, despite the fact that it is shifted.

Here a code snipets:

         typedef short PixelType;
         const unsigned int VolumeDimension = 3;
         typedef itk::Image< PixelType, VolumeDimension > ImageType;
         typedef itk::ImageSeriesReader< ImageType > 	ReaderType;

         [...]

         ReaderType::Pointer reader = ReaderType::New();

         itk::OrientImageFilter<ImageType,ImageType>::Pointer orienter =
         itk::OrientImageFilter<ImageType,ImageType>::New();

         FlipImageFilterType::Pointer flipFilter
            = FlipImageFilterType::New ();

         [...]

         reader->SetFileNames(fileNamesNew);
         reader->Update();

         rval = reader->GetOutput();

         orienter->UseImageDirectionOn();
         orienter->SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RAI);
         //orienter->SetDesiredCoordinateOrientationToAxial();
         orienter->SetInput(rval);
         orienter->Update();

         rval = orienter->GetOutput();

//         itk::FixedArray<bool, 3> flipAxes;
//         flipAxes[0] = true;
//         flipAxes[1] = false;
//         flipAxes[2] = false;

//         flipFilter->SetInput(rval);
//         flipFilter->SetFlipAxes(flipAxes);


Am I missing something? This is my first e-mail to a mailing list, so please let me know any improvements of posting or style. :)

Thanks for any help!

Pascal




More information about the Community mailing list