Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkPlanarEllipse.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 mitkPlanarEllipse_h
14 #define mitkPlanarEllipse_h
15 
16 #include "mitkPlanarFigure.h"
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
28  {
29  public:
31  itkFactorylessNewMacro(Self);
32  itkCloneMacro(Self);
33 
39  void PlaceFigure(const Point2D &point) override;
40 
41  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
42 
44  unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
46  unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
49  void SetMinimumRadius(double radius) { m_MinRadius = radius; }
52  double GetMinimumRadius() { return m_MinRadius; }
55  void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
58  double GetMaximumRadius() { return m_MaxRadius; }
59  void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
62  void SetTreatAsCircle(bool active) { m_TreatAsCircle = active; }
63  bool Equals(const mitk::PlanarFigure &other) const override;
64 
65  const unsigned int FEATURE_ID_MAJOR_AXIS;
66  const unsigned int FEATURE_ID_MINOR_AXIS;
67  const unsigned int FEATURE_ID_AREA;
68 
69  protected:
71 
73 
75  void GeneratePolyLine() override;
76 
78  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
79 
81  Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
82 
84  void EvaluateFeaturesInternal() override;
85 
86  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
87 
88  // Member variables:
89  double m_MinRadius;
90  double m_MaxRadius;
93 
94  private:
95  };
96 
97 } // namespace mitk
98 
99 #endif
#define MITKPLANARFIGURE_EXPORT
Implementation of PlanarFigure representing a circle through two control points.
unsigned int GetMinimumNumberOfControlPoints() const override
Ellipse has 3 control points per definition.
void ActivateMinMaxRadiusContstraints(bool active)
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void PlaceFigure(const Point2D &point) override
Place figure in its minimal configuration (a point at least) onto the given 2D geometry.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
mitkClassMacro(PlanarEllipse, PlanarFigure)
const unsigned int FEATURE_ID_MAJOR_AXIS
bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own.
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist=true) override
unsigned int GetMaximumNumberOfControlPoints() const override
Ellipse has 3 control points per definition.
void SetMinimumRadius(double radius)
Sets the minimum radius.
void SetMaximumRadius(double radius)
Sets the maximum radius.
void EvaluateFeaturesInternal() override
Calculates feature quantities of the planar figure.
void SetTreatAsCircle(bool active)
Treat ellipse as circle (equal radii)
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override
Spatially constrain control points of second (orthogonal) line.
const unsigned int FEATURE_ID_MINOR_AXIS
double GetMinimumRadius()
Gets the minimum radius.
double GetMaximumRadius()
Gets the minimum radius.
const unsigned int FEATURE_ID_AREA
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override
Generates the poly-lines that should be drawn the same size regardless of zoom.
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Find image slices visible on a given plane.