Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkExtrudedContour.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 mitkExtrudedContour_h
14 #define mitkExtrudedContour_h
15 
16 #include "mitkBoundingObject.h"
18 #include <mitkContour.h>
19 #include <mitkPlaneGeometry.h>
20 #include <vtkVersionMacros.h>
21 
22 class vtkLinearExtrusionFilter;
23 class vtkPlanes;
24 class vtkClipPolyData;
25 class vtkLinearSubdivisionFilter;
26 class vtkTriangleFilter;
27 class vtkDecimatePro;
28 class vtkPolygon;
29 
30 namespace mitk
31 {
32  //##Documentation
33  //## @brief Data class containing a bounding-object created by
34  //## extruding a Contour along a vector
35  //##
36  //## The m_Contour is extruded in the direction m_Vector until
37  //## reaching m_ClippingGeometry.
38  //## @ingroup Data
39 
46  {
47  public:
49  itkFactorylessNewMacro(Self);
50  itkCloneMacro(Self);
51 
52  mitk::ScalarType GetVolume() override;
53  bool IsInside(const Point3D &p) const override;
54  void UpdateOutputInformation() override;
55 
56  //##Documentation
57  //## @brief Contour to extrude
58  itkGetConstObjectMacro(Contour, mitk::Contour);
59  itkSetObjectMacro(Contour, mitk::Contour);
60 
61  //##Documentation
62  //## @brief Vector to specify the direction of the extrusion
65  itkGetConstMacro(AutomaticVectorGeneration, bool);
66  itkSetMacro(AutomaticVectorGeneration, bool);
67  itkBooleanMacro(AutomaticVectorGeneration);
68 
69  //##Documentation
70  //## @brief Optional vector to specify the orientation of the bounding-box
71  mitkGetVectorMacro(RightVector, mitk::Vector3D);
72  mitkSetVectorMacro(RightVector, mitk::Vector3D);
73 
74  //##Documentation
75  //## @brief Optional geometry for clipping the extruded contour
76  itkGetConstObjectMacro(ClippingGeometry, mitk::BaseGeometry);
77  itkSetObjectMacro(ClippingGeometry, mitk::BaseGeometry);
78 
79  itk::ModifiedTimeType GetMTime() const override;
80 
81  protected:
83  ~ExtrudedContour() override;
84 
85  void BuildSurface();
86  void BuildGeometry();
87 
92 
94 
95  vtkPolygon *m_Polygon;
96 
97 #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
98  double m_ProjectedContourBounds[6];
99 #else
100  float m_ProjectedContourBounds[6];
101 #endif
102 
104  //##Documentation
105  //## @brief For fast projection on plane
106  float m_Right[3];
107  float m_Down[3];
108 
109 #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
110  double m_Normal[3];
111 #else
112  float m_Normal[3];
113 #endif
114  float m_Origin[3];
115 
116  vtkLinearExtrusionFilter *m_ExtrusionFilter;
117  vtkTriangleFilter *m_TriangleFilter;
118  vtkDecimatePro *m_Decimate;
119  vtkLinearSubdivisionFilter *m_SubdivisionFilter;
120  vtkPlanes *m_ClippingBox;
121  vtkClipPolyData *m_ClipPolyDataFilter;
122 
124  };
125 }
126 #endif
mitk::ExtrudedContour::m_RightVector
mitk::Vector3D m_RightVector
Definition: mitkExtrudedContour.h:90
itk::SmartPointer< Self >
mitkSetVectorMacro
#define mitkSetVectorMacro(name, type)
Definition: mitkVectorDeprecated.h:270
mitk::ExtrudedContour::m_SubdivisionFilter
vtkLinearSubdivisionFilter * m_SubdivisionFilter
Definition: mitkExtrudedContour.h:119
mitk::ExtrudedContour::m_TriangleFilter
vtkTriangleFilter * m_TriangleFilter
Definition: mitkExtrudedContour.h:117
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitkContour.h
mitk::ExtrudedContour::m_Contour
mitk::Contour::Pointer m_Contour
Definition: mitkExtrudedContour.h:88
mitk::ExtrudedContour::m_Decimate
vtkDecimatePro * m_Decimate
Definition: mitkExtrudedContour.h:118
mitk::ExtrudedContour::m_ClipPolyDataFilter
vtkClipPolyData * m_ClipPolyDataFilter
Definition: mitkExtrudedContour.h:121
mitk::Vector
Definition: mitkVector.h:28
mitk::ExtrudedContour::m_LastCalculateExtrusionTime
itk::TimeStamp m_LastCalculateExtrusionTime
Definition: mitkExtrudedContour.h:123
mitk::ExtrudedContour::m_ExtrusionFilter
vtkLinearExtrusionFilter * m_ExtrusionFilter
Definition: mitkExtrudedContour.h:116
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
mitk::ExtrudedContour::m_Polygon
vtkPolygon * m_Polygon
Definition: mitkExtrudedContour.h:95
mitk::Point< ScalarType, 3 >
mitk::ExtrudedContour::m_ClippingGeometry
mitk::BaseGeometry::Pointer m_ClippingGeometry
Definition: mitkExtrudedContour.h:91
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitk::ExtrudedContour::m_Vector
mitk::Vector3D m_Vector
Definition: mitkExtrudedContour.h:89
mitkGetVectorMacro
#define mitkGetVectorMacro(name, type)
Definition: mitkVectorDeprecated.h:272
mitk::ExtrudedContour::m_ProjectionPlane
mitk::PlaneGeometry::Pointer m_ProjectionPlane
Definition: mitkExtrudedContour.h:103
mitk::ExtrudedContour
Data class containing a bounding-object created by extruding a Contour along a vector.
Definition: mitkExtrudedContour.h:45
mitkBoundingObject.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MitkSegmentationExports.h
mitk::BoundingObject
superclass of all bounding objects (cylinder, cuboid,...)
Definition: mitkBoundingObject.h:27
mitk::Contour
Stores vertices for drawing a contour.
Definition: mitkContour.h:31
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::ExtrudedContour::m_AutomaticVectorGeneration
bool m_AutomaticVectorGeneration
Definition: mitkExtrudedContour.h:93
mitkPlaneGeometry.h
mitk::ExtrudedContour::m_ClippingBox
vtkPlanes * m_ClippingBox
Definition: mitkExtrudedContour.h:120