Hi Simon, sorry for the late response! Did you solve your problem in the meantime?
Could you try to convert your image from itk::CovariantVector<float, 3> to itk::Vector<float, 3> before importing it to MITK? Best regards Klaus Fritzsche -----Ursprüngliche Nachricht----- Von: Simon Eck [mailto:[email protected]] Gesendet: Montag, 10. Mai 2010 16:04 An: [email protected] Betreff: [mitk-users] Create multi-channel mitk::Image from ITK vector field 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 Biomedical Computer Vision Group Im Neuenheimer Feld 267 69120 Heidelberg [email protected] ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
