Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkAnnotationProperty.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 mitkAnnotationProperty_h
14 #define mitkAnnotationProperty_h
15 
16 #include "mitkBaseProperty.h"
17 #include "mitkNumericTypes.h"
18 #include <MitkCoreExports.h>
19 
20 #include <itkConfigure.h>
21 
22 #include <string>
23 
24 namespace mitk
25 {
31  {
32  public:
34 
35  typedef std::string ValueType;
36 
37  itkFactorylessNewMacro(Self);
38 
39  itkCloneMacro(Self)
40  mitkNewMacro2Param(AnnotationProperty, const char *, const Point3D &);
41  mitkNewMacro2Param(AnnotationProperty, const std::string &, const Point3D &);
44 
45  itkGetStringMacro(Label);
46  itkSetStringMacro(Label);
47 
48  const Point3D &GetPosition() const;
49  void SetPosition(const Point3D &position);
50 
51  std::string GetValueAsString() const override;
52 
53  bool ToJSON(nlohmann::json& j) const override;
54  bool FromJSON(const nlohmann::json& j) override;
55 
56  virtual BaseProperty &operator=(const BaseProperty &other) { return Superclass::operator=(other); }
57  using BaseProperty::operator=;
58 
59  protected:
60  std::string m_Label;
62 
64  AnnotationProperty(const char *label, const Point3D &position);
65  AnnotationProperty(const std::string &label, const Point3D &position);
66  AnnotationProperty(const char *label, ScalarType x, ScalarType y, ScalarType z);
67  AnnotationProperty(const std::string &label, ScalarType x, ScalarType y, ScalarType z);
68 
70 
71  private:
72  // purposely not implemented
73  AnnotationProperty &operator=(const AnnotationProperty &);
74 
75  itk::LightObject::Pointer InternalClone() const override;
76 
77  bool IsEqual(const BaseProperty &property) const override;
78  bool Assign(const BaseProperty &property) override;
79  };
80 
81 } // namespace mitk
82 
83 #endif
mitk::BaseProperty
Abstract base class for properties.
Definition: mitkBaseProperty.h:36
mitkNewMacro2Param
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
mitk::AnnotationProperty::ValueType
std::string ValueType
Definition: mitkAnnotationProperty.h:35
mitk::FromJSON
MITKCORE_EXPORT void FromJSON(const nlohmann::json &j, AffineTransform3D::Pointer transform)
Read transform from JSON array (16 elements, resp. 4x4 matrix).
mitk::AnnotationProperty::operator=
virtual BaseProperty & operator=(const BaseProperty &other)
Definition: mitkAnnotationProperty.h:56
mitk::AnnotationProperty::m_Label
std::string m_Label
Definition: mitkAnnotationProperty.h:60
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::Label
A data structure describing a label.
Definition: mitkLabel.h:29
json
nlohmann::json json
Definition: mitkModelTestFixture.h:29
MitkCoreExports.h
mitk::Point< ScalarType, 3 >
mitkNumericTypes.h
mitk::ToJSON
MITKCORE_EXPORT void ToJSON(nlohmann::json &j, AffineTransform3D::ConstPointer transform)
Write transform (4x4 matrix) as JSON array with 16 elements.
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkNewMacro4Param
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:107
mitk::AnnotationProperty
Property for annotations.
Definition: mitkAnnotationProperty.h:30
mitkBaseProperty.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::AnnotationProperty::m_Position
Point3D m_Position
Definition: mitkAnnotationProperty.h:61