Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkPlanarCircle.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 mitkPlanarCircle_h
14 #define mitkPlanarCircle_h
15 
16 #include "mitkPlanarFigure.h"
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
29  {
30  public:
33  itkFactorylessNewMacro(Self);
34 
35  itkCloneMacro(Self);
36 
42  // virtual void Initialize();
43 
44  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
45 
47  unsigned int GetMinimumNumberOfControlPoints() const override { return (m_RadiusFixed) ? 1 : 2; }
49  unsigned int GetMaximumNumberOfControlPoints() const override { return (m_RadiusFixed) ? 1 : 2; }
52  void SetMinimumRadius(double radius) { m_MinRadius = radius; }
55  double GetMinimumRadius() { return m_MinRadius; }
58  void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
61  double GetMaximumRadius() { return m_MaxRadius; }
62  void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
63  bool SetCurrentControlPoint(const Point2D &point) override;
64 
65  bool Equals(const mitk::PlanarFigure &other) const override;
66 
67  protected:
68  PlanarCircle();
70  PlanarCircle(double fixedRadius);
71 
72  mitkCloneMacro(Self);
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  // Feature identifiers
89  const unsigned int FEATURE_ID_RADIUS;
90  const unsigned int FEATURE_ID_DIAMETER;
91  const unsigned int FEATURE_ID_AREA;
92 
93  // Member variables:
94  double m_MinRadius;
95  double m_MaxRadius;
97  //indicate if the circle is created with fixed radius. The radius is stored in m_MinRadius
99 
100  private:
101  };
102 
103 } // namespace mitk
104 
105 #endif
mitk::PlanarCircle::GetMaximumRadius
double GetMaximumRadius()
Gets the minimum radius.
Definition: mitkPlanarCircle.h:61
mitk::PlanarCircle::GetMinimumNumberOfControlPoints
unsigned int GetMinimumNumberOfControlPoints() const override
Circle has 2 control points per definition.
Definition: mitkPlanarCircle.h:47
mitk::PlanarCircle::FEATURE_ID_AREA
const unsigned int FEATURE_ID_AREA
Definition: mitkPlanarCircle.h:91
MitkPlanarFigureExports.h
mitk::PlanarFigure
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Definition: mitkPlanarFigure.h:50
mitk::PlanarCircle::m_MinMaxRadiusContraintsActive
bool m_MinMaxRadiusContraintsActive
Definition: mitkPlanarCircle.h:96
mitkNewMacro1Param
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
MITKPLANARFIGURE_EXPORT
#define MITKPLANARFIGURE_EXPORT
Definition: MitkPlanarFigureExports.h:15
mitk::PlanarCircle::SetMaximumRadius
void SetMaximumRadius(double radius)
Sets the maximum radius.
Definition: mitkPlanarCircle.h:58
mitkPlanarFigure.h
mitk::PlanarCircle::ActivateMinMaxRadiusContstraints
void ActivateMinMaxRadiusContstraints(bool active)
Definition: mitkPlanarCircle.h:62
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PlanarCircle::m_MaxRadius
double m_MaxRadius
Definition: mitkPlanarCircle.h:95
mitk::PlanarCircle::GetMinimumRadius
double GetMinimumRadius()
Gets the minimum radius.
Definition: mitkPlanarCircle.h:55
mitk::PlanarCircle::FEATURE_ID_DIAMETER
const unsigned int FEATURE_ID_DIAMETER
Definition: mitkPlanarCircle.h:90
mitk::Point< ScalarType, 2 >
mitk::PlanarCircle::GetMaximumNumberOfControlPoints
unsigned int GetMaximumNumberOfControlPoints() const override
Circle has 2 control points per definition.
Definition: mitkPlanarCircle.h:49
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitk::PlanarCircle::SetMinimumRadius
void SetMinimumRadius(double radius)
Sets the minimum radius.
Definition: mitkPlanarCircle.h:52
mitkCloneMacro
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:154
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::PlanarCircle::m_MinRadius
double m_MinRadius
Definition: mitkPlanarCircle.h:94
mitk::PlanarCircle::m_RadiusFixed
bool m_RadiusFixed
Definition: mitkPlanarCircle.h:98
mitk::PlanarCircle::FEATURE_ID_RADIUS
const unsigned int FEATURE_ID_RADIUS
Definition: mitkPlanarCircle.h:89
mitk::PlanarCircle
Implementation of PlanarFigure representing a circle either through two control points or by one cont...
Definition: mitkPlanarCircle.h:28