Medical Imaging Interaction Toolkit  2024.06.99-c70462f2
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:
70  PlanarEllipse();
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
mitk::PlanarEllipse::GetMaximumNumberOfControlPoints
unsigned int GetMaximumNumberOfControlPoints() const override
Ellipse has 3 control points per definition.
Definition: mitkPlanarEllipse.h:46
mitk::PlanarEllipse::GetMinimumRadius
double GetMinimumRadius()
Gets the minimum radius.
Definition: mitkPlanarEllipse.h:52
MitkPlanarFigureExports.h
mitk::PlanarEllipse::FEATURE_ID_MINOR_AXIS
const unsigned int FEATURE_ID_MINOR_AXIS
Definition: mitkPlanarEllipse.h:66
mitk::PlanarFigure
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Definition: mitkPlanarFigure.h:50
mitk::PlanarEllipse::m_TreatAsCircle
bool m_TreatAsCircle
Definition: mitkPlanarEllipse.h:92
MITKPLANARFIGURE_EXPORT
#define MITKPLANARFIGURE_EXPORT
Definition: MitkPlanarFigureExports.h:15
mitk::PlanarEllipse::FEATURE_ID_AREA
const unsigned int FEATURE_ID_AREA
Definition: mitkPlanarEllipse.h:67
mitk::PlanarEllipse::GetMinimumNumberOfControlPoints
unsigned int GetMinimumNumberOfControlPoints() const override
Ellipse has 3 control points per definition.
Definition: mitkPlanarEllipse.h:44
mitkPlanarFigure.h
mitk::PlanarEllipse::m_MinMaxRadiusContraintsActive
bool m_MinMaxRadiusContraintsActive
Definition: mitkPlanarEllipse.h:91
mitk::PlanarEllipse::SetMaximumRadius
void SetMaximumRadius(double radius)
Sets the maximum radius.
Definition: mitkPlanarEllipse.h:55
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PlanarEllipse
Implementation of PlanarFigure representing a circle through two control points.
Definition: mitkPlanarEllipse.h:27
mitk::PlanarEllipse::ActivateMinMaxRadiusContstraints
void ActivateMinMaxRadiusContstraints(bool active)
Definition: mitkPlanarEllipse.h:59
mitk::Point< ScalarType, 2 >
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitk::PlanarEllipse::SetTreatAsCircle
void SetTreatAsCircle(bool active)
Treat ellipse as circle (equal radii)
Definition: mitkPlanarEllipse.h:62
mitk::PlanarEllipse::m_MaxRadius
double m_MaxRadius
Definition: mitkPlanarEllipse.h:90
mitk::PlanarEllipse::m_MinRadius
double m_MinRadius
Definition: mitkPlanarEllipse.h:89
mitkCloneMacro
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:154
mitk::PlanarEllipse::FEATURE_ID_MAJOR_AXIS
const unsigned int FEATURE_ID_MAJOR_AXIS
Definition: mitkPlanarEllipse.h:65
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::PlanarEllipse::GetMaximumRadius
double GetMaximumRadius()
Gets the minimum radius.
Definition: mitkPlanarEllipse.h:58
mitk::PlanarEllipse::SetMinimumRadius
void SetMinimumRadius(double radius)
Sets the minimum radius.
Definition: mitkPlanarEllipse.h:49