Medical Imaging Interaction Toolkit  2025.12.02
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 
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
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 
88  mitk::Contour::Pointer m_Contour;
91  mitk::BaseGeometry::Pointer m_ClippingGeometry;
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 
103  mitk::PlaneGeometry::Pointer m_ProjectionPlane;
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
#define MITKSEGMENTATION_EXPORT
BaseGeometry Describes the geometry of a data object.
superclass of all bounding objects (cylinder, cuboid,...)
Stores vertices for drawing a contour.
Definition: mitkContour.h:32
Data class containing a bounding-object created by extruding a Contour along a vector.
vtkDecimatePro * m_Decimate
mitk::Vector3D m_RightVector
mitkGetVectorMacro(RightVector, mitk::Vector3D)
Optional vector to specify the orientation of the bounding-box.
vtkTriangleFilter * m_TriangleFilter
mitkSetVectorMacro(RightVector, mitk::Vector3D)
bool IsInside(const Point3D &p) const override
mitkClassMacro(ExtrudedContour, BoundingObject)
~ExtrudedContour() override
mitkSetVectorMacro(Vector, mitk::Vector3D)
mitk::PlaneGeometry::Pointer m_ProjectionPlane
itk::TimeStamp m_LastCalculateExtrusionTime
itk::ModifiedTimeType GetMTime() const override
mitk::ScalarType GetVolume() override
mitk::Contour::Pointer m_Contour
vtkClipPolyData * m_ClipPolyDataFilter
vtkLinearSubdivisionFilter * m_SubdivisionFilter
vtkLinearExtrusionFilter * m_ExtrusionFilter
mitkGetVectorMacro(Vector, mitk::Vector3D)
Vector to specify the direction of the extrusion.
mitk::BaseGeometry::Pointer m_ClippingGeometry
void UpdateOutputInformation() override
Find image slices visible on a given plane.
double ScalarType