Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPlanarDoubleEllipse.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 mitkPlanarDoubleEllipse_h
14 #define mitkPlanarDoubleEllipse_h
15 
17 #include <mitkPlanarFigure.h>
18 
19 namespace mitk
20 {
38  {
39  public:
43 
44  itkFactorylessNewMacro(Self);
45  itkCloneMacro(Self);
46 
51  unsigned int GetNumberOfSegments() const;
52 
57  void SetNumberOfSegments(unsigned int numSegments);
58 
63  unsigned int GetMaximumNumberOfControlPoints() const override;
64 
69  unsigned int GetMinimumNumberOfControlPoints() const override;
70 
79  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
80 
82  const unsigned int FEATURE_ID_MAJOR_AXIS;
84  const unsigned int FEATURE_ID_MINOR_AXIS;
86  const unsigned int FEATURE_ID_THICKNESS;
87 
89  static const unsigned int CP_CENTER = 0;
91  static const unsigned int CP_OUTER_MAJOR_AXIS = 1;
93  static const unsigned int CP_OUTER_MINOR_AXIS = 2;
95  static const unsigned int CP_INNER_MAJOR_AXIS = 3;
96 
102  bool Equals(const mitk::PlanarFigure &other) const override;
103 
104  protected:
107  PlanarDoubleEllipse(double fixedRadius, double fixedThickness);
108  PlanarDoubleEllipse(const Self& other);
109 
111 
112  mitk::Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
113  void EvaluateFeaturesInternal() override;
114  void GenerateHelperPolyLine(double, unsigned int) override;
115  void GeneratePolyLine() override;
116 
117  private:
118  unsigned int m_NumberOfSegments;
119  bool m_ConstrainCircle;
120  bool m_ConstrainThickness;
121  double m_FixedRadius = 0;
122  double m_FixedThickness = 0;
123  bool m_SizeIsFixed = false;
124  };
125 }
126 
127 #endif
#define MITKPLANARFIGURE_EXPORT
Implementation of PlanarFigure representing a double ellipse (annular ring).
void EvaluateFeaturesInternal() override
Calculates quantities of all features of this planar figure. Must be implemented in sub-classes.
mitkNewMacro2Param(PlanarDoubleEllipse, double, double) static Pointer New()
Creates a PlanarDoubleEllipse with fixed radius and thickness.
unsigned int GetMaximumNumberOfControlPoints() const override
Returns 1 in fixed-size mode, 4 otherwise.
bool Equals(const mitk::PlanarFigure &other) const override
Compares this PlanarDoubleEllipse with another PlanarFigure for equality.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure. Must be implemented in sub-classes.
PlanarDoubleEllipse(double fixedRadius, double fixedThickness)
void SetNumberOfSegments(unsigned int numSegments)
Sets the number of line segments used to approximate each ellipse.
unsigned int GetNumberOfSegments() const
Returns the number of line segments used to approximate each ellipse.
unsigned int GetMinimumNumberOfControlPoints() const override
Returns 1 in fixed-size mode, 4 otherwise.
mitk::Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override
Applies spatial constraints to a control point position.
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist=true) override
Sets a control point and enforces double-ellipse constraints.
const unsigned int FEATURE_ID_MINOR_AXIS
Feature identifier for the outer minor axis length.
void GenerateHelperPolyLine(double, unsigned int) override
Generates the poly-lines that should be drawn the same size regardless of zoom. Must be implemented i...
const unsigned int FEATURE_ID_MAJOR_AXIS
Feature identifier for the outer major axis length.
mitkClassMacro(PlanarDoubleEllipse, PlanarFigure)
const unsigned int FEATURE_ID_THICKNESS
Feature identifier for the ring thickness (distance between outer and inner ellipses).
PlanarDoubleEllipse(const Self &other)
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Find image slices visible on a given plane.