Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkContour.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 mitkContour_h
14 #define mitkContour_h
15 
16 #include "mitkBaseData.h"
17 #include "mitkCommon.h"
19 #include <vtkRenderWindow.h>
20 
21 #include <itkPolyLineParametricPath.h>
22 
23 namespace mitk
24 {
32  {
33  public:
35 
36  itkFactorylessNewMacro(Self);
37 
38  itkCloneMacro(Self);
39 
40  typedef itk::PolyLineParametricPath<3> PathType;
41  typedef PathType::Pointer PathPointer;
42  typedef PathType::ContinuousIndexType ContinuousIndexType;
43  typedef PathType::InputType InputType;
44  typedef PathType::OutputType OutputType;
45  typedef PathType::OffsetType OffsetType;
46  typedef itk::
47  BoundingBox<unsigned long, 3, ScalarType, itk::VectorContainer<unsigned long, mitk::Point<ScalarType, 3>>>
49  typedef BoundingBoxType::PointsContainer PointsContainer;
50  typedef BoundingBoxType::PointsContainer::Pointer PointsContainerPointer;
51  typedef BoundingBoxType::PointsContainerIterator PointsContainerIterator;
52 
57  itkSetMacro(Closed, bool);
58 
62  itkGetMacro(Closed, bool);
63 
64  itkSetMacro(Selected, bool);
65 
66  itkGetMacro(Selected, bool);
67 
68  itkSetMacro(Width, float);
69 
70  itkGetMacro(Width, float);
71 
75  void Initialize() override;
76 
80  void AddVertex(mitk::Point3D newPoint);
81 
86 
91  void SetCurrentWindow(vtkRenderWindow *rw);
92 
96  vtkRenderWindow *GetCurrentWindow() const;
97 
101  unsigned int GetNumberOfPoints() const;
102 
107 
112 
116  void UpdateOutputInformation() override;
117 
122 
127 
131  bool VerifyRequestedRegion() override;
132 
136  void SetRequestedRegion(const itk::DataObject *data) override;
137 
138  protected:
140 
142  Contour(const Contour &other);
143  ~Contour() override;
144 
145  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
146 
147  private:
151  PathType::Pointer m_ContourPath;
152 
156  vtkRenderWindow *m_CurrentWindow;
157 
161  BoundingBoxType::Pointer m_BoundingBox;
162 
166  BoundingBoxType::PointsContainer::Pointer m_Vertices;
167 
171  bool m_Closed;
172 
173  bool m_Selected;
174 
175  float m_Width;
176  };
177 
178 } // namespace mitk
179 
180 #endif
#define MITKSEGMENTATION_EXPORT
Base of all data objects.
Definition: mitkBaseData.h:44
Stores vertices for drawing a contour.
Definition: mitkContour.h:32
void SetPoints(PointsContainerPointer points)
PathType::OutputType OutputType
Definition: mitkContour.h:44
~Contour() override
Contour(const Contour &other)
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
PathPointer GetContourPath() const
void Initialize() override
void SetCurrentWindow(vtkRenderWindow *rw)
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::BoundingBox< unsigned long, 3, ScalarType, itk::VectorContainer< unsigned long, mitk::Point< ScalarType, 3 > > > BoundingBoxType
Definition: mitkContour.h:48
PathType::ContinuousIndexType ContinuousIndexType
Definition: mitkContour.h:42
void UpdateOutputInformation() override
mitkClassMacro(Contour, BaseData)
PathType::OffsetType OffsetType
Definition: mitkContour.h:45
BoundingBoxType::PointsContainer::Pointer PointsContainerPointer
Definition: mitkContour.h:50
BoundingBoxType::PointsContainer PointsContainer
Definition: mitkContour.h:49
vtkRenderWindow * GetCurrentWindow() const
itk::PolyLineParametricPath< 3 > PathType
Definition: mitkContour.h:38
BoundingBoxType::PointsContainerIterator PointsContainerIterator
Definition: mitkContour.h:51
PathType::Pointer PathPointer
Definition: mitkContour.h:41
unsigned int GetNumberOfPoints() const
mitkCloneMacro(Self)
void SetRequestedRegion(const itk::DataObject *data) override
void SetRequestedRegionToLargestPossibleRegion() override
PointsContainerPointer GetPoints() const
PathType::InputType InputType
Definition: mitkContour.h:43
void AddVertex(mitk::Point3D newPoint)
bool VerifyRequestedRegion() override
Find image slices visible on a given plane.