Dear Keshav,

maybe it is a problem coming from the ITK image type you use. Could you try 
using 

typedef itk::Image<itk::RGBPixel<unsigned char>, 2>  ImageType;
 ImageType::Pointer itkImage = ImageType::New();

instead and then try AccessByItk(...)?

Regards, 
Tobias

------------------------------------------------------------
Tobias Schwarz
DKFZ
German Cancer Research Center (Deutsches Krebsforschungszentrum) 
Member of the Helmholtz Association
Division of Medical & Biological Informatics E130
Im Neuenheimer Feld 280
D-69120 Heidelberg
Phone: 49-(0)6221-42-2353
Fax: 49-(0)6221-42-2345
E-Mail: [email protected]
Web: www.dkfz.de
Confidentiality Note: This message is intended only for the use of the named 
recipient(s) and may obtain confidential and/or privileged information. If you 
are not the intended recipient, please contact the sender and delete the 
message. Any unauthorized use of the information contained in this message is 
prohibited.

-----Ursprüngliche Nachricht-----
Von: Keshav Chintamani [mailto:[email protected]] 
Gesendet: Montag, 12. Juli 2010 15:09
An: mitk-users
Betreff: [mitk-users] [mitk] Converting 2D mitk image (RGB) to itk image using 
mtik::CastToItkImage

Dear mitk users

I am trying convert a 2D mitk image obtaining using the OpenCVToMitkImageFilter 
(from a video device):

          m_Filter=mitk::OpenCVToMitkImageFilter::New();
          //Input grabbed OpenCV image to the filter
          m_Filter->SetOpenCVImage(img);
          m_Filter->Update();
 
I am able to add and view the 2D mitk image in the datastorage.

I want to apply a filter on this mitk image (thresholding) and I understand 
that I need to cast it into an itk image. I used the following steps:

-------------------------------------------------------------------------------------------------------
typedef unsigned char PixelType;
const unsigned int Dimension = 2;
typedef itk::Image< PixelType, Dimension > ImageType;
 ImageType::Pointer itkImage = ImageType::New();

mitk::CastToItkImage(mitkImage.GetPointer(),itkImage);//Method if mitkimagetype 
is known
--------------------------------------------------------------------------------------------------------
I used this method since the pixel time/dimension of mitkImage is known. 

I get the following message: 

WARNING: In 
..\..\..\CAMDASS_Plugins\camdass.video.widget\src\internal\CamdassVideoWidgetView.cpp,
 line 350
Pixel type class itk::RGBPixel<unsigned char> not supported by AccessByItk

I get the same message when I use the AccessByItk() macro as well. If the Pixel 
type RGBPixel is not supported by the macro, is there another way I can convert 
my mitk image to an itk image?


Any help is appreciated!

-Keshav


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to