Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkImageSource.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 mitkImageSource_h
14 #define mitkImageSource_h
15 
16 #include <mitkBaseDataSource.h>
17 #include <mitkImage.h>
18 #include <MitkCoreExports.h>
19 
20 namespace mitk
21 {
40  {
41  public:
43 
45  itkFactorylessNewMacro(Self);
46  itkCloneMacro(Self);
47 
51  typedef OutputImageType::Pointer OutputImagePointer;
53 
105 
121  itk::DataObject::Pointer
122  MakeOutput(DataObjectPointerArraySizeType idx) override;
123 
130  itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
131 
133  virtual vtkImageData *GetVtkImageData();
135  virtual const vtkImageData *GetVtkImageData() const;
136 
137  protected:
139  ~ImageSource() override {}
157  void GenerateData() override;
158 
183  virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId);
184 
192  void PrepareOutputs() override;
193 
201  virtual void AllocateOutputs();
202 
214  virtual void BeforeThreadedGenerateData() {}
227  virtual void AfterThreadedGenerateData() {}
235  virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion);
236 
241  static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
242 
245  {
246  Pointer Filter;
247  };
248 
249  private:
250  ImageSource(const Self &); // purposely not implemented
251  void operator=(const Self &); // purposely not implemented
252  };
253 
254 } // namespace mitk
255 
256 #endif
#define MITKCORE_EXPORT
Superclass of all classes generating some kind of mitk::BaseData.
itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
Identifier type for named data objects.
Superclass of all classes generating Images (instances of class Image) as output.
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override
virtual const vtkImageData * GetVtkImageData() const
Get the output as VTK image data (const version).
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".
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 impl...
virtual void AfterThreadedGenerateData()
If an imaging filter needs to perform processing after all processing threads have completed,...
virtual void AllocateOutputs()
The GenerateData method normally allocates the buffers for all of the outputs of a filter.
static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg)
Static function used as a "callback" by the MultiThreader.
void GenerateData() override
A version of GenerateData() specific for image processing filters.
virtual vtkImageData * GetVtkImageData()
Get the output as VTK image data (non-const version).
~ImageSource() override
mitkClassMacro(ImageSource, BaseDataSource)
OutputImageType OutputType
mitk::Image OutputImageType
Some convenient typedefs.
OutputImageType::Pointer OutputImagePointer
SlicedData::RegionType OutputImageRegionType
virtual void BeforeThreadedGenerateData()
If an imaging filter needs to perform processing after the buffer has been allocated but before threa...
void PrepareOutputs() override
This method is intentionally left blank.
mitkBaseDataSourceGetOutputDeclarations itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
Get the output data of this image source object.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
itk::ImageRegion< RegionDimension > RegionType
#define mitkBaseDataSourceGetOutputDeclarations
Find image slices visible on a given plane.
Internal structure used for passing image data into the threading library.