Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkUnstructuredGrid.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 mitkUnstructuredGrid_h
14 #define mitkUnstructuredGrid_h
15 
17 #include "itkImageRegion.h"
18 #include "mitkBaseData.h"
19 
20 class vtkUnstructuredGrid;
21 
22 namespace mitk
23 {
24  //##Documentation
25  //## @brief Class for storing unstructured grids (vtkUnstructuredGrid)
26  //## @ingroup Data
28  {
29  public:
30  // not yet the best choice of a region-type for surfaces, but it works for the time being
31  typedef itk::ImageRegion<5> RegionType;
32 
34 
35  itkFactorylessNewMacro(Self);
36 
37  itkCloneMacro(Self);
38 
39  virtual void SetVtkUnstructuredGrid(vtkUnstructuredGrid *grid, unsigned int t = 0);
40 
41  virtual vtkUnstructuredGrid *GetVtkUnstructuredGrid(unsigned int t = 0);
42 
43  void UpdateOutputInformation() override;
44 
46 
48 
49  bool VerifyRequestedRegion() override;
50 
51  void SetRequestedRegion(const itk::DataObject *data) override;
52 
54 
55  void Graft(const DataObject *data) override;
56 
57  void CopyInformation(const itk::DataObject *data) override;
58 
59  void Update() override;
60 
61  // Initialize should not be called manually;
62  // The polydata vector is initialized automatically when enlarged;
63  void Expand(unsigned int timeSteps = 1) override;
64 
66  {
67  m_LargestPossibleRegion.SetIndex(3, 0);
68  m_LargestPossibleRegion.SetSize(3, GetTimeGeometry()->CountTimeSteps());
69  return m_LargestPossibleRegion;
70  }
71 
72  //##Documentation
73  //## Get the region object that defines the size and starting index
74  //## for the region of the image requested (i.e., the region of the
75  //## image to be operated on by a filter).
76  virtual const RegionType &GetRequestedRegion() const { return m_RequestedRegion; }
78 
79  protected:
81 
82  typedef std::vector<vtkUnstructuredGrid *> VTKUnstructuredGridSeries;
83 
85 
87 
88  ~UnstructuredGrid() override;
89 
90  void ClearData() override;
91 
92  void InitializeEmpty() override;
93 
95 
97 
99 
101  };
102 
103 } // namespace mitk
104 
105 #endif
#define MITKDATATYPESEXT_EXPORT
Base of all data objects.
Definition: mitkBaseData.h:44
Class for storing unstructured grids (vtkUnstructuredGrid)
void Expand(unsigned int timeSteps=1) override
Expands the TimeGeometry to a number of TimeSteps.
UnstructuredGrid(const mitk::UnstructuredGrid &other)
mitkClassMacro(UnstructuredGrid, BaseData)
void Update() override
itk::ImageRegion< 5 > RegionType
void InitializeEmpty() override
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least creat...
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
~UnstructuredGrid() override
virtual const RegionType & GetRequestedRegion() const
virtual void SetVtkUnstructuredGrid(vtkUnstructuredGrid *grid, unsigned int t=0)
void SetRequestedRegion(const itk::DataObject *data) override
Set the requested region from this data object to match the requested region of the data object passe...
std::vector< vtkUnstructuredGrid * > VTKUnstructuredGridSeries
void CopyInformation(const itk::DataObject *data) override
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
void Graft(const DataObject *data) override
virtual vtkUnstructuredGrid * GetVtkUnstructuredGrid(unsigned int t=0)
VTKUnstructuredGridSeries m_GridSeries
void ClearData() override
reset to non-initialized state, release memory
virtual void SetRequestedRegion(UnstructuredGrid::RegionType *region)
void UpdateOutputInformation() override
const RegionType & GetLargestPossibleRegion() const
Find image slices visible on a given plane.