Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 _MITK_UNSTRUCTURED_GRID_H_
14 #define _MITK_UNSTRUCTURED_GRID_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 
45  void SetRequestedRegionToLargestPossibleRegion() override;
46 
47  bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
48 
49  bool VerifyRequestedRegion() override;
50 
51  void SetRequestedRegion(const itk::DataObject *data) override;
52 
53  virtual void SetRequestedRegion(UnstructuredGrid::RegionType *region);
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 
65  const RegionType &GetLargestPossibleRegion() const
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; }
77  void CalculateBoundingBox();
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 
94  VTKUnstructuredGridSeries m_GridSeries;
95 
96  mutable RegionType m_LargestPossibleRegion;
97 
98  RegionType m_RequestedRegion;
99 
101  };
102 
103 } // namespace mitk
104 
105 #endif /* _MITK_UNSTRUCTURED_GRID_H_ */
Base of all data objects.
Definition: mitkBaseData.h:37
#define MITKDATATYPESEXT_EXPORT
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:31
DataCollection - Class to facilitate loading/accessing structured data.
VTKUnstructuredGridSeries m_GridSeries
virtual const RegionType & GetRequestedRegion() const
itk::ImageRegion< 5 > RegionType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
const RegionType & GetLargestPossibleRegion() const
std::vector< vtkUnstructuredGrid * > VTKUnstructuredGridSeries
Class for storing unstructured grids (vtkUnstructuredGrid)