Medical Imaging Interaction Toolkit  2025.12.02
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 {
37  {
38  public:
40 
42  itkFactorylessNewMacro(Self);
43  itkCloneMacro(Self);
44 
50 
102 
118  itk::DataObject::Pointer
119  MakeOutput(DataObjectPointerArraySizeType idx) override;
120 
127  itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
128 
129  virtual vtkImageData *GetVtkImageData();
130  virtual const vtkImageData *GetVtkImageData() const;
131 
132  protected:
134  ~ImageSource() override {}
152  void GenerateData() override;
153 
178  virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId);
179 
187  void PrepareOutputs() override;
188 
196  virtual void AllocateOutputs();
197 
209  virtual void BeforeThreadedGenerateData() {}
222  virtual void AfterThreadedGenerateData() {}
230  virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion);
231 
236  static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
237 
240  {
242  };
243 
244  private:
245  ImageSource(const Self &); // purposely not implemented
246  void operator=(const Self &); // purposely not implemented
247  };
248 
249 } // namespace mitk
250 
251 #endif
#define MITKCORE_EXPORT
Superclass of all classes generating some kind of mitk::BaseData.
itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
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
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".
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
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()
~ImageSource() override
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.
Image class for storing images.
Definition: mitkImage.h:70
itk::ImageRegion< RegionDimension > RegionType
#define mitkBaseDataSourceGetOutputDeclarations
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Find image slices visible on a given plane.
Internal structure used for passing image data into the threading library.