Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Filter for creating MITK RGB Images from an OpenCV image. More...
#include <mitkOpenCVToMitkImageFilter.h>
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< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
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< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
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 () |
OutputImageType * | GetOutput (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 |
OutputType * | GetOutput () |
Get the output data of this image source object. More... | |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
virtual itk::DataObject::Pointer | MakeOutput (DataObjectPointerArraySizeType idx) override |
Make a DataObject of the correct type to used as the specified output. More... | |
virtual itk::DataObject::Pointer | MakeOutput (const DataObjectIdentifierType &name) override |
virtual vtkImageData * | GetVtkImageData () |
virtual const vtkImageData * | GetVtkImageData () const |
Public Member Functions inherited from mitk::BaseDataSource | |
OutputType * | GetOutput () |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (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 () | |
virtual | ~OpenCVToMitkImageFilter () |
virtual void | GenerateData () override |
A version of GenerateData() specific for image processing filters. More... | |
Protected Member Functions inherited from mitk::ImageSource | |
ImageSource () | |
virtual | ~ImageSource () |
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... | |
virtual 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 () | |
virtual | ~BaseDataSource () |
Protected Attributes | |
Image::Pointer | m_Image |
cv::Mat | m_OpenCVMat |
itk::FastMutexLock::Pointer | m_ImageMutex |
itk::FastMutexLock::Pointer | m_OpenCVMatMutex |
Additional Inherited Members | |
Static Protected Member Functions inherited from mitk::ImageSource | |
static 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 () |
Filter for creating MITK RGB Images from an OpenCV image.
Definition at line 39 of file mitkOpenCVToMitkImageFilter.h.
typedef itk::RGBPixel< double > mitk::OpenCVToMitkImageFilter::DoubleRGBPixelType |
Definition at line 45 of file mitkOpenCVToMitkImageFilter.h.
typedef itk::RGBPixel< float > mitk::OpenCVToMitkImageFilter::FloatRGBPixelType |
Definition at line 44 of file mitkOpenCVToMitkImageFilter.h.
typedef itk::RGBPixel< unsigned char > mitk::OpenCVToMitkImageFilter::UCRGBPixelType |
Definition at line 42 of file mitkOpenCVToMitkImageFilter.h.
typedef itk::RGBPixel< unsigned short > mitk::OpenCVToMitkImageFilter::USRGBPixelType |
Definition at line 43 of file mitkOpenCVToMitkImageFilter.h.
|
protected |
Definition at line 29 of file mitkOpenCVToMitkImageFilter.cpp.
References m_ImageMutex, m_OpenCVMatMutex, and mitk::New().
|
protectedvirtual |
Definition at line 35 of file mitkOpenCVToMitkImageFilter.cpp.
Pointer mitk::OpenCVToMitkImageFilter::Clone | ( | ) | const |
|
static |
the static function for the conversion
Definition at line 124 of file mitkOpenCVToMitkImageFilter.cpp.
References mitk::GrabItkImageMemory(), and mitk::Image::New().
|
overrideprotectedvirtual |
A version of GenerateData() specific for image processing filters.
This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling ThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter an be threaded, it should NOT provide a GenerateData() method but should provide a ThreadedGenerateData() instead.
Reimplemented from mitk::ImageSource.
Definition at line 53 of file mitkOpenCVToMitkImageFilter.cpp.
References m_Image, m_ImageMutex, m_OpenCVMat, m_OpenCVMatMutex, and MITK_WARN.
|
virtual |
ImageSource::OutputImageType * mitk::OpenCVToMitkImageFilter::GetOutput | ( | void | ) |
Definition at line 115 of file mitkOpenCVToMitkImageFilter.cpp.
References m_Image.
Referenced by 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.
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 |
Definition at line 136 of file mitkOpenCVToMitkImageFilter.cpp.
References GetData(), GetOutput(), m_Image, m_ImageMutex, SetOpenCVMat(), and Update().
mitk::OpenCVToMitkImageFilter::mitkClassMacro | ( | OpenCVToMitkImageFilter | , |
ImageSource | |||
) |
|
static |
void mitk::OpenCVToMitkImageFilter::SetOpenCVImage | ( | const IplImage * | image | ) |
sets an iplimage as input
Definition at line 47 of file mitkOpenCVToMitkImageFilter.cpp.
References SetOpenCVMat().
void mitk::OpenCVToMitkImageFilter::SetOpenCVMat | ( | const cv::Mat & | image | ) |
sets an opencv mat as input (will be used if OpenCVImage Ipl image is 0)
Definition at line 39 of file mitkOpenCVToMitkImageFilter.cpp.
References m_OpenCVMat, and m_OpenCVMatMutex.
Referenced by InsertOpenCVImageAsMitkTimeSlice(), and SetOpenCVImage().
|
protected |
Definition at line 90 of file mitkOpenCVToMitkImageFilter.h.
Referenced by GenerateData(), GetOutput(), and InsertOpenCVImageAsMitkTimeSlice().
|
protected |
Definition at line 93 of file mitkOpenCVToMitkImageFilter.h.
Referenced by GenerateData(), InsertOpenCVImageAsMitkTimeSlice(), and OpenCVToMitkImageFilter().
|
protected |
Definition at line 91 of file mitkOpenCVToMitkImageFilter.h.
Referenced by GenerateData(), and SetOpenCVMat().
|
protected |
Definition at line 94 of file mitkOpenCVToMitkImageFilter.h.
Referenced by GenerateData(), OpenCVToMitkImageFilter(), and SetOpenCVMat().