19 #include <itkImportImageFilter.h>
20 #include <itkRGBPixel.h>
26 : m_OpenCVImage(nullptr)
75 std::cout <<
"Caught exception [from AccessFixedTypeByItk]: \n" << e.what() <<
"\n";
89 mat = cv::Mat ( img,
false );
90 cvReleaseImageHeader( &img );
96 template<
typename TPixel,
unsigned int VImageDimension>
99 m_OpenCVImage = itk::OpenCVImageBridge::ITKImageToIplImage(image);
104 m_sliceSelector->SetInput(mitkImage);
105 m_sliceSelector->SetSliceNr(slice);
106 m_sliceSelector->SetTimeNr(timeStep);
107 m_sliceSelector->Update();
108 this->
SetImage(m_sliceSelector->GetOutput());
void ItkImageProcessing(itk::Image< TPixel, VImageDimension > *image)
#define MITK_ACCESSBYITK_PIXEL_TYPES_SEQ
DataCollection - Class to facilitate loading/accessing structured data.
mitk::WeakPointer< mitk::Image > m_Image
void SetInputFromTimeSlice(Image::Pointer mitkImage, int timeStep, int slice)
Convenient method to set a certain slice of a 3D or 4D mitk::Image as input to convert it to an openC...
bool CheckImage(mitk::Image *image)
get the input MITK image
void SetImage(mitk::Image *_Image)
set the input MITK image
itk::RGBPixel< unsigned short > USRGBPixelType
IplImage * GetOpenCVImage()
#define AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq)
Access a mitk-image with known type (pixel type and dimension) by an itk-image.
itk::RGBPixel< float > FloatRGBPixelType
Image class for storing images.
ImageToOpenCVImageFilter()
~ImageToOpenCVImageFilter()
Exception class thrown in AccessByItk macros.
itk::RGBPixel< double > DoubleRGBPixelType
unsigned int GetDimension() const
Get dimension of the image.
itk::RGBPixel< unsigned char > UCRGBPixelType