Dear List,

I was trying to apply some RGBA image interaction between mitk and itk using 
the mitk::DataStorage and thus the CastToItkImage function of mitkImageCast.h. 
I figured out, that all functions are defined for itk::Image with 
itk::RGB<uchar> pixels. But unfortunately explicit functions for 
itk::RGBA<uchar> are missing.

I don't know where to send the change request so I just write this mail.

This following code to enable itk::RGBA casting can and should be included in 
the mitkImageCastPart4.cpp for future mitk versions.

typedef itk::Image<itk::RGBAPixel<unsigned char>, 2>  itkImageRGBAUC2;
typedef itk::Image<itk::RGBAPixel<unsigned char>, 3>  itkImageRGBAUC3;

namespace mitk
{

template <> void CastToItkImage<itkImageRGBAUC2>(const mitk::Image * mitkImage, 
itk::SmartPointer<itkImageRGBAUC2>& itkOutputImage)
{
  typedef itkImageRGBAUC2 ItkOutputImageType;
  AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, 
(itk::RGBAPixel<unsigned char>), 
(::itk::GetImageDimension<ItkOutputImageType>::ImageDimension), itkOutputImage);
}

template <> void CastToItkImage<itkImageRGBAUC3>(const mitk::Image * mitkImage, 
itk::SmartPointer<itkImageRGBAUC3>& itkOutputImage)
{
  typedef itkImageRGBAUC3 ItkOutputImageType;
  AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, 
(itk::RGBAPixel<unsigned char>), 
(::itk::GetImageDimension<ItkOutputImageType>::ImageDimension), itkOutputImage);
}
}

Regards,
Matthias

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to