Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkITKImageImport.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkITKImageImport_h
14 #define mitkITKImageImport_h
15 
16 #include "itkImageToImageFilterDetail.h"
17 #include "mitkImageSource.h"
18 #include <MitkCoreExports.h>
19 
20 namespace mitk
21 {
35  template <class TInputImage>
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
44  typedef TInputImage InputImageType;
45  typedef typename InputImageType::Pointer InputImagePointer;
46  typedef typename InputImageType::ConstPointer InputImageConstPointer;
47  typedef typename InputImageType::RegionType InputImageRegionType;
48  typedef typename InputImageType::PixelType InputImagePixelType;
49 
51  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
52  itkStaticConstMacro(RegionDimension, unsigned int, mitk::SlicedData::RegionDimension);
53 
55  InputImageType *GetInput(void);
56 
58  void SetInput(const InputImageType *);
59  using itk::ProcessObject::SetInput;
60 
72  void SetGeometry(const BaseGeometry *geometry);
73 
74  protected:
76 
77  ~ITKImageImport() override;
78 
79  void GenerateOutputInformation() override;
80 
81  void GenerateInputRequestedRegion() override;
82 
83  void GenerateData() override;
84 
85  void SetNthOutput(DataObjectPointerArraySizeType num, itk::DataObject *output) override;
86 
89  typedef itk::ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension),
90  itkGetStaticConstMacro(RegionDimension)>
92 
94  };
95 
114  template <typename ItkOutputImageType>
116  const BaseGeometry *geometry = nullptr,
117  bool update = true);
118 
154  template <typename ItkOutputImageType>
155  Image::Pointer ImportItkImage(const ItkOutputImageType *itkimage,
156  const BaseGeometry *geometry = nullptr,
157  bool update = true);
158 
179  template <typename ItkOutputImageType>
181  mitk::Image *mitkImage = nullptr,
182  const BaseGeometry *geometry = nullptr,
183  bool update = true);
184 
205  template <typename ItkOutputImageType>
206  Image::Pointer GrabItkImageMemory(ItkOutputImageType *itkimage,
207  mitk::Image *mitkImage = nullptr,
208  const BaseGeometry *geometry = nullptr,
209  bool update = true);
210 
231  template <typename ItkOutputImageType>
232  Image::Pointer GrabItkImageMemoryChannel(ItkOutputImageType* itkimage,
233  const TimeGeometry* geometry = nullptr,
234  mitk::Image* mitkImage = nullptr,
235  bool update = true);
236 
237 } // namespace mitk
238 
239 #ifndef MITK_MANUAL_INSTANTIATION
240 #include "mitkITKImageImport.txx"
241 #endif
242 
243 #endif
mitk::ImportItkImage
Image::Pointer ImportItkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, const BaseGeometry *geometry=nullptr, bool update=true)
Imports an itk::Image (with a specific type) as an mitk::Image.
mitk::GrabItkImageMemory
Image::Pointer GrabItkImageMemory(itk::SmartPointer< ItkOutputImageType > &itkimage, mitk::Image *mitkImage=nullptr, const BaseGeometry *geometry=nullptr, bool update=true)
Grabs the memory of an itk::Image (with a specific type) and puts it into an mitk::Image.
mitk::TimeGeometry
Definition: mitkTimeGeometry.h:43
mitk::ImageSource
Superclass of all classes generating Images (instances of class Image) as output.
Definition: mitkImageSource.h:36
mitk::ITKImageImport::OutputToInputRegionCopierType
itk::ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(RegionDimension)> OutputToInputRegionCopierType
Definition: mitkITKImageImport.h:91
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
MITK_EXPORT
#define MITK_EXPORT
Definition: mitkCommon.h:191
itk::SmartPointer< Self >
mitk::ITKImageImport::m_Geometry
BaseGeometry::Pointer m_Geometry
Definition: mitkITKImageImport.h:93
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::ITKImageImport::InputImageConstPointer
InputImageType::ConstPointer InputImageConstPointer
Definition: mitkITKImageImport.h:46
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::ITKImageImport
Pipelined import of itk::Image.
Definition: mitkITKImageImport.h:36
MitkCoreExports.h
mitk::ITKImageImport::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: mitkITKImageImport.h:48
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
mitk::ITKImageImport::InputImageType
TInputImage InputImageType
The type of the input image.
Definition: mitkITKImageImport.h:41
mitk::ITKImageImport::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: mitkITKImageImport.h:47
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::ITKImageImport::InputImagePointer
InputImageType::Pointer InputImagePointer
Definition: mitkITKImageImport.h:45
mitk::GrabItkImageMemoryChannel
Image::Pointer GrabItkImageMemoryChannel(ItkOutputImageType *itkimage, const TimeGeometry *geometry=nullptr, mitk::Image *mitkImage=nullptr, bool update=true)
Grabs the memory of an itk::Image (with a specific type) and puts it into an mitk::Image.
mitkImageSource.h