Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitk::ImageToOpenCVImageFilter Class Reference

A pseudo-filter for creating OpenCV images from MITK images with the option of copying data or referencing it. More...

#include <mitkImageToOpenCVImageFilter.h>

Inheritance diagram for mitk::ImageToOpenCVImageFilter:
Collaboration diagram for mitk::ImageToOpenCVImageFilter:

Public Types

typedef itk::RGBPixel< unsigned char > UCRGBPixelType
 
typedef itk::RGBPixel< unsigned short > USRGBPixelType
 
typedef itk::RGBPixel< float > FloatRGBPixelType
 
typedef itk::RGBPixel< double > DoubleRGBPixelType
 

Public Member Functions

 mitkClassMacroItkParent (ImageToOpenCVImageFilter, itk::Object)
 
Pointer Clone () const
 
void SetImage (mitk::Image *_Image)
 set the input MITK image More...
 
mitk::ImageGetImage ()
 get the input MITK image More...
 
bool CheckImage (mitk::Image *image)
 get the input MITK image More...
 
cv::Mat GetOpenCVMat ()
 
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 openCV image. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

template<typename TPixel , unsigned int VImageDimension>
void ItkImageProcessing (itk::Image< TPixel, VImageDimension > *image)
 
 ImageToOpenCVImageFilter ()
 
 ~ImageToOpenCVImageFilter () override
 

Protected Attributes

mitk::WeakPointer< mitk::Imagem_Image
 
cv::Mat m_OpenCVImage
 

Detailed Description

A pseudo-filter for creating OpenCV images from MITK images with the option of copying data or referencing it.

Definition at line 31 of file mitkImageToOpenCVImageFilter.h.

Member Typedef Documentation

◆ DoubleRGBPixelType

typedef itk::RGBPixel< double > mitk::ImageToOpenCVImageFilter::DoubleRGBPixelType

Definition at line 37 of file mitkImageToOpenCVImageFilter.h.

◆ FloatRGBPixelType

typedef itk::RGBPixel< float > mitk::ImageToOpenCVImageFilter::FloatRGBPixelType

Definition at line 36 of file mitkImageToOpenCVImageFilter.h.

◆ UCRGBPixelType

typedef itk::RGBPixel< unsigned char > mitk::ImageToOpenCVImageFilter::UCRGBPixelType

Definition at line 34 of file mitkImageToOpenCVImageFilter.h.

◆ USRGBPixelType

typedef itk::RGBPixel< unsigned short > mitk::ImageToOpenCVImageFilter::USRGBPixelType

Definition at line 35 of file mitkImageToOpenCVImageFilter.h.

Constructor & Destructor Documentation

◆ ImageToOpenCVImageFilter()

mitk::ImageToOpenCVImageFilter::ImageToOpenCVImageFilter ( )
protected

◆ ~ImageToOpenCVImageFilter()

mitk::ImageToOpenCVImageFilter::~ImageToOpenCVImageFilter ( )
overrideprotected

Member Function Documentation

◆ CheckImage()

bool mitk::ImageToOpenCVImageFilter::CheckImage ( mitk::Image image)

get the input MITK image

◆ Clone()

Pointer mitk::ImageToOpenCVImageFilter::Clone ( ) const

◆ GetImage()

mitk::Image* mitk::ImageToOpenCVImageFilter::GetImage ( )

get the input MITK image

◆ GetOpenCVMat()

cv::Mat mitk::ImageToOpenCVImageFilter::GetOpenCVMat ( )

RUNS the conversion and returns the produced image as cv::Mat.

Returns
the produced OpenCVImage or an empty image if an error occured

◆ ItkImageProcessing()

template<typename TPixel , unsigned int VImageDimension>
void mitk::ImageToOpenCVImageFilter::ItkImageProcessing ( itk::Image< TPixel, VImageDimension > *  image)
protected

the actual templated conversion method

◆ mitkClassMacroItkParent()

mitk::ImageToOpenCVImageFilter::mitkClassMacroItkParent ( ImageToOpenCVImageFilter  ,
itk::Object   
)

◆ New()

static Pointer mitk::ImageToOpenCVImageFilter::New ( )
static

◆ SetImage()

void mitk::ImageToOpenCVImageFilter::SetImage ( mitk::Image _Image)

set the input MITK image

◆ SetInputFromTimeSlice()

void mitk::ImageToOpenCVImageFilter::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 openCV image.

This methods sets the input. Call GetOpenCVMat() to get the image.

Parameters
mitkImage- the image that should be converted to an openCVImage
timeStep- the time step, which is converted to openCV
slice- the slice which is converted to openCV

Member Data Documentation

◆ m_Image

mitk::WeakPointer<mitk::Image> mitk::ImageToOpenCVImageFilter::m_Image
protected

Saves if the filter should copy the data or just reference it

Definition at line 86 of file mitkImageToOpenCVImageFilter.h.

◆ m_OpenCVImage

cv::Mat mitk::ImageToOpenCVImageFilter::m_OpenCVImage
protected

Definition at line 87 of file mitkImageToOpenCVImageFilter.h.


The documentation for this class was generated from the following file: