Dear List,

I've built an 3D-ITK-Image with the itk::TileImageFilter out of 10 
2D-ITK-Ultrasound-Images (to build a test-volume). Now I want to convert this 
3D-ITK-Image back to an 3D-MITK-Image to display it in MITK. Therefor I use 
mitk::ImportItkImage, but I got always an error by doing it in this way. What 
do I wrong? Is there another way to do such the conversion? 


Here my code for the conversion:

queue<itk::Image<unsigned char, 2>::Pointer> m_ImageStack = 
m_QueueManager->GetImageQueue();    //Get the Image-Queue (2D-ITK-Images)

  if(m_ImageStack.size() >= 10){

          //create the ITK-3D-Volume  
          itk::Image<unsigned char, 3>* itkVolume = TileFilter();

         //Cast from ITK to MITK
         cout << "CastToMITKImage" << endl;
         mitk::Image::Pointer mitkVolume = 
mitk::ImportItkImage<itk::Image<unsigned char, 3>>(itkVolume); //Error
         cout << "finished" << endl;

..and here is the code to create the ITK-Volume:

itk::Image<unsigned char, 3>* QmitkUltrasoundReconstructionView::TileFilter()
{
  typedef unsigned char PixelType;
  enum { InputImageDimension = 2 };
  enum { OutputImageDimension = 3 };

  typedef itk::Image<PixelType,InputImageDimension> InputImageType;
  typedef itk::Image<PixelType,OutputImageDimension> OutputImageType;
  typedef itk::TileImageFilter<InputImageType,OutputImageType> TilerType;


  itk::FixedArray<unsigned int,3> layout;
  layout[0] = 1;
  layout[1] = 1;
  layout[2] = 0;

  //// Tile the input images
  TilerType::Pointer tiler = TilerType::New();
  unsigned int f = 0;
  for (int i=0; i< m_ImageStack.size(); i++)
  {
     
    tiler->SetInput(f++, m_ImageStack.front());
    m_ImageStack.pop();
  }

 tiler->SetLayout(layout);
  tiler->SetDefaultPixelValue(0);
  tiler->Update();
  return tiler->GetOutput();

}

Best regards

Matthias Mucha
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to