Dear list,

I would like to import an 3D ITK image of PixelType 
<itk::CovariantVector<float, 3> to a mitk::Image. In my case the ITK 
image is the output of itk::GradientImageFilter.

As mitk::ImportImage() does not support the conversion (see the error 
below), i tried splitting the ITK image into scalar fields and building 
a multi-channel mitk::Image with this scalar fields as channels. While 
splitting the vector field works fine using ITK iterators, I can't 
figure out how to build a mutli-channel mitk::Image and add the 
resulting scalar fields as channels.

May you give me an example of how to accomplish this? There may also be 
a smarter way to get it out of the ITK vector field without splitting...

Some Code:
void ItkGradientField::execute( mitk::Image::Pointer inputImage ) {
        FloatImage3dType::Pointer itkImage = FloatImage3dType::New();
        mitk::CastToItkImage( inputImage, itkImage );

        typedef itk::GradientImageFilter<FloatImage3dType, float, float> 
GradientType;
        GradientType::Pointer gradientFilter = GradientType::New();
        gradientFilter->SetInput( itkImage );

        gradientFilter->Update();

        /* not supported */
        //mitk::Image::Pointer result = mitk::ImportItkImage( 
gradientFilter->GetOutput() );

        QList<FloatImage3dType::Pointer> splittedImages = 
splitGradientResultImage( gradientFilter->GetOutput() );

        mitk::Image::Pointer result = mitk::ImportItkImage( splittedImages[0] );

        /* How to add splittedImages[n] as channels to result ??? */

        storeOutputImage(result);
}


Error when calling mitk::ImportImage():
An error occurred. You should save all data and quit the program to 
prevent possible data loss.
See the error log for details.

/data/development/mitk/mitk-0.14-src/Core/Code/IO/mitkPixelType.cpp:255:
itk::ERROR: PixelType(0x7fff8acdb670): Pixel type currently not supported.


Thanks in advance,
Simon



-- 
Simon Eck
Dipl. Ing. (FH) Technische Informatik
Hauptstraße 141
69517 Gorxheimertal

0176 21050561
[email protected]

------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to