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

Filter for creating MITK RGB Images from an OpenCV image. More...

#include <mitkOpenCVToMitkImageFilter.h>

Inheritance diagram for mitk::OpenCVToMitkImageFilter:
Collaboration diagram for mitk::OpenCVToMitkImageFilter:

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 Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 

Public Member Functions

 mitkClassMacro (OpenCVToMitkImageFilter, ImageSource)
 
Pointer Clone () const
 
void SetOpenCVImage (const IplImage *image)
 
void SetOpenCVMat (const cv::Mat &image)
 
virtual cv::Mat GetOpenCVMat ()
 
OutputImageTypeGetOutput (void)
 
void InsertOpenCVImageAsMitkTimeSlice (const cv::Mat openCVImage, Image::Pointer mitkImage, int timeStep)
 Convenient method to insert an openCV image as a slice at a certain time step into a 3D or 4D mitk::Image. More...
 
- Public Member Functions inherited from mitk::ImageSource
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 

Static Public Member Functions

template<typename TPixel , unsigned int VImageDimension>
static Image::Pointer ConvertCVMatToMitkImage (const cv::Mat input)
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 OpenCVToMitkImageFilter ()
 
 ~OpenCVToMitkImageFilter () override
 
void GenerateData () override
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
 ~ImageSource () override
 
void GenerateData () override
 A version of GenerateData() specific for image processing filters. More...
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 

Protected Attributes

Image::Pointer m_Image
 
cv::Mat m_OpenCVMat
 
std::mutex m_ImageMutex
 
std::mutex m_OpenCVMatMutex
 

Additional Inherited Members

- Static Protected Member Functions inherited from mitk::ImageSource
static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Filter for creating MITK RGB Images from an OpenCV image.

Definition at line 37 of file mitkOpenCVToMitkImageFilter.h.

Member Typedef Documentation

◆ DoubleRGBPixelType

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

Definition at line 43 of file mitkOpenCVToMitkImageFilter.h.

◆ FloatRGBPixelType

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

Definition at line 42 of file mitkOpenCVToMitkImageFilter.h.

◆ UCRGBPixelType

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

Definition at line 40 of file mitkOpenCVToMitkImageFilter.h.

◆ USRGBPixelType

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

Definition at line 41 of file mitkOpenCVToMitkImageFilter.h.

Constructor & Destructor Documentation

◆ OpenCVToMitkImageFilter()

mitk::OpenCVToMitkImageFilter::OpenCVToMitkImageFilter ( )
protected

◆ ~OpenCVToMitkImageFilter()

mitk::OpenCVToMitkImageFilter::~OpenCVToMitkImageFilter ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::OpenCVToMitkImageFilter::Clone ( ) const

◆ ConvertCVMatToMitkImage()

template<typename TPixel , unsigned int VImageDimension>
static Image::Pointer mitk::OpenCVToMitkImageFilter::ConvertCVMatToMitkImage ( const cv::Mat  input)
static

the static function for the conversion

◆ GenerateData()

void mitk::OpenCVToMitkImageFilter::GenerateData ( )
overrideprotected

◆ GetOpenCVMat()

virtual cv::Mat mitk::OpenCVToMitkImageFilter::GetOpenCVMat ( )
virtual

◆ GetOutput()

OutputImageType* mitk::OpenCVToMitkImageFilter::GetOutput ( void  )

◆ InsertOpenCVImageAsMitkTimeSlice()

void mitk::OpenCVToMitkImageFilter::InsertOpenCVImageAsMitkTimeSlice ( const cv::Mat  openCVImage,
Image::Pointer  mitkImage,
int  timeStep 
)

Convenient method to insert an openCV image as a slice at a certain time step into a 3D or 4D mitk::Image.

Parameters
openCVImage- the image that is inserted into the mitk Image
mitkImage- pointer to the mitkImage, which is changed by this method!
timeStep- the time step, at which the openCVImage is inserted
Attention
The parameter mitkImage will be changed!

◆ mitkClassMacro()

mitk::OpenCVToMitkImageFilter::mitkClassMacro ( OpenCVToMitkImageFilter  ,
ImageSource   
)

◆ New()

static Pointer mitk::OpenCVToMitkImageFilter::New ( )
static

◆ SetOpenCVImage()

void mitk::OpenCVToMitkImageFilter::SetOpenCVImage ( const IplImage *  image)

sets an iplimage as input

◆ SetOpenCVMat()

void mitk::OpenCVToMitkImageFilter::SetOpenCVMat ( const cv::Mat &  image)

sets an opencv mat as input (will be used if OpenCVImage Ipl image is 0)

Member Data Documentation

◆ m_Image

Image::Pointer mitk::OpenCVToMitkImageFilter::m_Image
protected

Definition at line 88 of file mitkOpenCVToMitkImageFilter.h.

◆ m_ImageMutex

std::mutex mitk::OpenCVToMitkImageFilter::m_ImageMutex
protected

Definition at line 91 of file mitkOpenCVToMitkImageFilter.h.

◆ m_OpenCVMat

cv::Mat mitk::OpenCVToMitkImageFilter::m_OpenCVMat
protected

Definition at line 89 of file mitkOpenCVToMitkImageFilter.h.

◆ m_OpenCVMatMutex

std::mutex mitk::OpenCVToMitkImageFilter::m_OpenCVMatMutex
protected

Definition at line 92 of file mitkOpenCVToMitkImageFilter.h.


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