Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ITKImageImport< TInputImage > Class Template Reference

Pipelined import of itk::Image. More...

#include <mitkITKImageImport.h>

Inheritance diagram for mitk::ITKImageImport< TInputImage >:
Collaboration diagram for mitk::ITKImageImport< TInputImage >:

Public Types

typedef TInputImage InputImageType
 The type of the input image. More...
 
typedef InputImageType::Pointer InputImagePointer
 
typedef InputImageType::ConstPointer InputImageConstPointer
 
typedef InputImageType::RegionType InputImageRegionType
 
typedef InputImageType::PixelType InputImagePixelType
 
- Public Types inherited from mitk::ImageSource
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 BaseData OutputType
 Output data type. More...
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 Identifier type for named data objects. More...
 

Public Member Functions

 mitkClassMacro (ITKImageImport, ImageSource)
 
Pointer Clone () const
 
 itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension)
 
 itkStaticConstMacro (RegionDimension, unsigned int, mitk::SlicedData::RegionDimension)
 
InputImageType * GetInput (void)
 Get the input itk::Image of this image importer. More...
 
void SetInput (const InputImageType *input)
 Set the input itk::Image of this image importer. More...
 
void SetGeometry (const BaseGeometry *geometry)
 Set the Geometry of the result image (optional). More...
 
- Public Member Functions inherited from mitk::ImageSource
 mitkClassMacro (ImageSource, BaseDataSource)
 
Pointer Clone () const
 
mitkBaseDataSourceGetOutputDeclarations itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Get the output data of this image source object. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 Get the output as VTK image data (non-const version). More...
 
virtual const vtkImageData * GetVtkImageData () const
 Get the output as VTK image data (const version). More...
 
- Public Member Functions inherited from mitk::BaseDataSource
 mitkClassMacroItkParent (BaseDataSource, itk::ProcessObject)
 
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)
 Graft the specified base data object onto a named output. More...
 
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
 Check whether the pipeline is currently executing. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static Pointer New ()
 Method for creation through the object factory. More...
 

Protected Types

typedef itk::ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(RegionDimension)> OutputToInputRegionCopierType
 

Protected Member Functions

 ITKImageImport ()
 Constructor. More...
 
 ~ITKImageImport () override
 Destructor. More...
 
void GenerateOutputInformation () override
 Compute output information from the input ITK image. More...
 
void GenerateInputRequestedRegion () override
 Set the requested region on the input image. More...
 
void GenerateData () override
 Perform the actual data import from the ITK image. More...
 
void SetNthOutput (DataObjectPointerArraySizeType num, itk::DataObject *output) override
 Override to set the nth output. More...
 
- 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 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 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 ()
 Constructor. More...
 
 ~BaseDataSource () override
 Destructor. More...
 

Protected Attributes

BaseGeometry::Pointer m_Geometry
 

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

template<class TInputImage>
class mitk::ITKImageImport< TInputImage >

Pipelined import of itk::Image.

The image data contained in the itk::Image is referenced, not copied. The easiest way of use is by the function mitk::ImportItkImage

mitkImage = mitk::ImportItkImage(itkImage);
Image::Pointer ImportItkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, const BaseGeometry *geometry=nullptr, bool update=true)
Import an itk::Image (with a specific type) as an mitk::Image.
Template Parameters
TInputImageThe ITK image type to import.
See also
ImportItkImage
GrabItkImageMemory

Definition at line 40 of file mitkITKImageImport.h.

Member Typedef Documentation

◆ InputImageConstPointer

template<class TInputImage >
typedef InputImageType::ConstPointer mitk::ITKImageImport< TInputImage >::InputImageConstPointer

Definition at line 50 of file mitkITKImageImport.h.

◆ InputImagePixelType

template<class TInputImage >
typedef InputImageType::PixelType mitk::ITKImageImport< TInputImage >::InputImagePixelType

Definition at line 52 of file mitkITKImageImport.h.

◆ InputImagePointer

template<class TInputImage >
typedef InputImageType::Pointer mitk::ITKImageImport< TInputImage >::InputImagePointer

Definition at line 49 of file mitkITKImageImport.h.

◆ InputImageRegionType

template<class TInputImage >
typedef InputImageType::RegionType mitk::ITKImageImport< TInputImage >::InputImageRegionType

Definition at line 51 of file mitkITKImageImport.h.

◆ InputImageType

template<class TInputImage >
typedef TInputImage mitk::ITKImageImport< TInputImage >::InputImageType

The type of the input image.

Definition at line 48 of file mitkITKImageImport.h.

◆ OutputToInputRegionCopierType

template<class TInputImage >
typedef itk::ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(RegionDimension)> mitk::ITKImageImport< TInputImage >::OutputToInputRegionCopierType
protected

Typedef for the region copier function object that converts an output region to an input region.

Definition at line 111 of file mitkITKImageImport.h.

Constructor & Destructor Documentation

◆ ITKImageImport()

template<class TInputImage >
mitk::ITKImageImport< TInputImage >::ITKImageImport ( )
protected

Constructor.

◆ ~ITKImageImport()

template<class TInputImage >
mitk::ITKImageImport< TInputImage >::~ITKImageImport ( )
overrideprotected

Destructor.

Member Function Documentation

◆ Clone()

template<class TInputImage >
Pointer mitk::ITKImageImport< TInputImage >::Clone ( ) const

◆ GenerateData()

template<class TInputImage >
void mitk::ITKImageImport< TInputImage >::GenerateData ( )
overrideprotected

Perform the actual data import from the ITK image.

◆ GenerateInputRequestedRegion()

template<class TInputImage >
void mitk::ITKImageImport< TInputImage >::GenerateInputRequestedRegion ( )
overrideprotected

Set the requested region on the input image.

◆ GenerateOutputInformation()

template<class TInputImage >
void mitk::ITKImageImport< TInputImage >::GenerateOutputInformation ( )
overrideprotected

Compute output information from the input ITK image.

◆ GetInput()

template<class TInputImage >
InputImageType* mitk::ITKImageImport< TInputImage >::GetInput ( void  )

Get the input itk::Image of this image importer.

Returns
Pointer to the input ITK image.

◆ itkStaticConstMacro() [1/2]

template<class TInputImage >
mitk::ITKImageImport< TInputImage >::itkStaticConstMacro ( InputImageDimension  ,
unsigned int  ,
TInputImage::ImageDimension   
)

ImageDimension constants

◆ itkStaticConstMacro() [2/2]

template<class TInputImage >
mitk::ITKImageImport< TInputImage >::itkStaticConstMacro ( RegionDimension  ,
unsigned int  ,
mitk::SlicedData::RegionDimension   
)

◆ mitkClassMacro()

template<class TInputImage >
mitk::ITKImageImport< TInputImage >::mitkClassMacro ( ITKImageImport< TInputImage >  ,
ImageSource   
)

◆ New()

template<class TInputImage >
static Pointer mitk::ITKImageImport< TInputImage >::New ( )
static

◆ SetGeometry()

template<class TInputImage >
void mitk::ITKImageImport< TInputImage >::SetGeometry ( const BaseGeometry *  geometry)

Set the Geometry of the result image (optional).

The Geometry has to fit the dimension and size of the input image. The Geometry will be cloned, not referenced!

Providing the Geometry is optional. The default behavior is to set the geometry by the itk::Image::GetDirection() information.

Parameters
geometryThe BaseGeometry to apply to the output image.

◆ SetInput()

template<class TInputImage >
void mitk::ITKImageImport< TInputImage >::SetInput ( const InputImageType *  input)

Set the input itk::Image of this image importer.

Parameters
inputThe ITK image to import.

◆ SetNthOutput()

template<class TInputImage >
void mitk::ITKImageImport< TInputImage >::SetNthOutput ( DataObjectPointerArraySizeType  num,
itk::DataObject *  output 
)
overrideprotected

Override to set the nth output.

Member Data Documentation

◆ m_Geometry

template<class TInputImage >
BaseGeometry::Pointer mitk::ITKImageImport< TInputImage >::m_Geometry
protected

Definition at line 113 of file mitkITKImageImport.h.


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