Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitkPlanarCross.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 mitkPlanarCross_h
14 #define mitkPlanarCross_h
15 
16 #include "mitkPlanarFigure.h"
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
51  {
52  public:
54 
55  itkFactorylessNewMacro(Self);
56 
57  itkCloneMacro(Self);
58 
61  void SetSingleLineMode(bool singleLineMode);
62 
65  bool GetSingleLineMode() const;
66 
69  itkBooleanMacro(SingleLineMode); // No need to reimplement; calls SetSingleLineMode()
70 
72  unsigned int GetMinimumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
74  unsigned int GetMaximumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
76  bool ResetOnPointSelect() override;
77 
78  bool ResetOnPointSelectNeeded() const override;
79 
81  unsigned int GetNumberOfFeatures() const override;
82 
83  bool Equals(const mitk::PlanarFigure &other) const override;
84 
85  protected:
86  PlanarCross();
87  mitkCloneMacro(Self);
88 
90  Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
91 
93  void GeneratePolyLine() override;
94 
96  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
97 
99  void EvaluateFeaturesInternal() override;
100 
101  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
102 
103  // Feature identifiers
104  const unsigned int FEATURE_ID_LONGESTDIAMETER;
105  const unsigned int FEATURE_ID_SHORTAXISDIAMETER;
106 
107  private:
109  virtual Point2D InternalApplyControlPointConstraints(unsigned int index, const Point2D &point);
110  };
111 
112 } // namespace mitk
113 
114 #endif
MitkPlanarFigureExports.h
mitk::PlanarFigure
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Definition: mitkPlanarFigure.h:50
mitk::PlanarCross::FEATURE_ID_SHORTAXISDIAMETER
const unsigned int FEATURE_ID_SHORTAXISDIAMETER
Definition: mitkPlanarCross.h:105
MITKPLANARFIGURE_EXPORT
#define MITKPLANARFIGURE_EXPORT
Definition: MitkPlanarFigureExports.h:15
mitk::PlanarCross::GetMaximumNumberOfControlPoints
unsigned int GetMaximumNumberOfControlPoints() const override
PlanarCross has either two or four control points, depending on the operation mode.
Definition: mitkPlanarCross.h:74
mitkPlanarFigure.h
mitk::PlanarCross
Implementation of PlanarFigure modeling a cross with two orthogonal lines on a plane.
Definition: mitkPlanarCross.h:50
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::Point< ScalarType, 2 >
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitkCloneMacro
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:154
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::PlanarCross::FEATURE_ID_LONGESTDIAMETER
const unsigned int FEATURE_ID_LONGESTDIAMETER
Definition: mitkPlanarCross.h:104
mitk::PlanarCross::GetMinimumNumberOfControlPoints
unsigned int GetMinimumNumberOfControlPoints() const override
PlanarCross has either two or four control points, depending on the operation mode.
Definition: mitkPlanarCross.h:72