Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSurface.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 mitkSurface_h
14 #define mitkSurface_h
15 
16 #include <itkImageRegion.h>
17 #include <mitkBaseData.h>
18 #include <vtkSmartPointer.h>
19 
20 class vtkPolyData;
21 
22 namespace mitk
23 {
37  {
38  public:
40  typedef itk::ImageRegion<5> RegionType;
41 
43  itkFactorylessNewMacro(Self);
44  itkCloneMacro(Self);
45 
52 
59  void CopyInformation(const itk::DataObject *data) override;
60 
69  void ExecuteOperation(Operation *operation) override;
70 
79  void Expand(unsigned int timeSteps = 1) override;
80 
88 
94  virtual const RegionType &GetRequestedRegion() const;
95 
101  unsigned int GetSizeOfPolyDataSeries() const;
102 
112  virtual vtkPolyData *GetVtkPolyData(unsigned int t = 0) const;
113 
122  void Graft(const DataObject *data) override;
123 
130  bool IsEmptyTimeStep(unsigned int t) const override;
131 
138  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
139 
146 
153  void SetRequestedRegion(const itk::DataObject *data) override;
154 
162 
167 
177  virtual void SetVtkPolyData(vtkPolyData *polydata, unsigned int t = 0);
178 
184  virtual void Swap(Surface &other);
185 
189  void Update() override;
190 
194  void UpdateOutputInformation() override;
195 
201  bool VerifyRequestedRegion() override;
202 
203  protected:
205 
207  ~Surface() override;
208 
209  Surface(const Surface &other);
211 
212  void ClearData() override;
213  void InitializeEmpty() override;
214 
215  private:
216  std::vector<vtkSmartPointer<vtkPolyData>> m_PolyDatas;
217  mutable RegionType m_LargestPossibleRegion;
218  mutable RegionType m_RequestedRegion;
219  bool m_CalculateBoundingBox;
220  };
221 
231  MITKCORE_EXPORT bool Equal(mitk::Surface &leftHandSide,
232  mitk::Surface &rightHandSide,
234  bool verbose);
235 
249  MITKCORE_EXPORT bool Equal(vtkPolyData &leftHandSide, vtkPolyData &rightHandSide, mitk::ScalarType eps, bool verbose);
250 }
251 
252 #endif
#define MITKCORE_EXPORT
Base class of all data objects.
Definition: mitkBaseData.h:60
Base class for all operations in the undo/redo framework.
Definition: mitkOperation.h:38
Data class for storing polygonal surfaces (vtkPolyData).
Definition: mitkSurface.h:37
virtual void SetVtkPolyData(vtkPolyData *polydata, unsigned int t=0)
Set the vtkPolyData for time step t.
bool IsEmptyTimeStep(unsigned int t) const override
Check whether time step t is empty (has no vtkPolyData).
Surface(const Surface &other)
virtual const RegionType & GetRequestedRegion() const
Get the requested region.
virtual void SetRequestedRegion(Surface::RegionType *region)
Set the requested region from a RegionType pointer.
void InitializeEmpty() override
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least creat...
~Surface() override
void ClearData() override
reset to non-initialized state, release memory
bool VerifyRequestedRegion() override
Verify that the requested region is within the largest possible region.
itk::ImageRegion< 5 > RegionType
Region type used for pipeline region negotiation (5-dimensional).
Definition: mitkSurface.h:40
void Update() override
Trigger an update of all vtkPolyData objects in the pipeline.
void CalculateBoundingBox()
Compute the bounding box from all vtkPolyData objects across time steps.
void CopyInformation(const itk::DataObject *data) override
Copy information (geometry, region) from another data object.
const RegionType & GetLargestPossibleRegion() const
Get the largest possible region.
virtual void Swap(Surface &other)
Swap the contents of this surface with another surface.
void Expand(unsigned int timeSteps=1) override
Expand the data to the given number of time steps.
unsigned int GetSizeOfPolyDataSeries() const
Get the number of vtkPolyData objects in the time series.
void Graft(const DataObject *data) override
Graft data and information from another data object.
void ExecuteOperation(Operation *operation) override
Execute an operation on this surface (e.g., OpSURFACECHANGED).
Surface & operator=(Surface other)
void SetRequestedRegion(const itk::DataObject *data) override
Set the requested region to match another data object's requested region.
mitkClassMacro(Surface, BaseData)
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the requested region is outside the buffered region.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Print the surface information to the output stream.
void SetRequestedRegionToLargestPossibleRegion() override
Set the requested region to the largest possible region.
void UpdateOutputInformation() override
Update the output information (bounding box, geometry).
mitkCloneMacro(Self)
virtual vtkPolyData * GetVtkPolyData(unsigned int t=0) const
Get the vtkPolyData at time step t.
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
Epsilon value for floating point comparison (vnl_math::eps * 100).
double ScalarType
Scalar type used throughout MITK for geometric computations.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.