Hi Bin,

we are currently working on a bugfix for this issue. The problem is the casting 
of a multi-component mitk Image ( i.e. a RGB Image ) to a corresponding 
itkImage.

But it works well on scalar (grey-value) images as the ones you attached to the 
posting.  So a quick solution for your problem is to convert the input image to 
a real grey-value image.  The reason that the bug occurs for you would imply 
that the images you are using are stored as RGB images.

Best,

Jan

Von: bin.lv [mailto:[email protected]]
Gesendet: Mittwoch, 18. Juli 2012 12:33
An: [email protected]
Betreff: [mitk-users] access 2D mitk image to itk image

Hi All,

I want to convert the MITK image to  ITK image in order to do image processing 
with some ITK filters. The codes is like as following:
...
mitk::Image* mitkImage = dynamic_cast<mitk::Image*>( data );
AccessByItk_2( mitkImage, ItkFunction, para1, para2);
...

template < typename TPixel, unsigned int VImageDimension >
void QmitkSegmentationView::ItkFunction( itk::Image< TPixel, VImageDimension >* 
itkImage, int para1, int para2)
{
....itkImage....
}

It works OK while reading the 3D images. But when the input becomes 2D image, 
the itkImage is not same as mitkImage, Attached is a example data. I didn't do 
any image processing on the images, just convert the image form mitkimage to 
itkimage. Does anyone tell me how to fix it? Thank you in advence!

Best,
Bin

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to