Medical Imaging Interaction Toolkit  2025.12.02
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)
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
#define MITKCORE_EXPORT
Property for annotations.
AnnotationProperty(const char *label, const Point3D &position)
AnnotationProperty(const std::string &label, ScalarType x, ScalarType y, ScalarType z)
AnnotationProperty(const std::string &label, const Point3D &position)
AnnotationProperty(const char *label, ScalarType x, ScalarType y, ScalarType z)
AnnotationProperty(const AnnotationProperty &other)
mitkClassMacro(AnnotationProperty, BaseProperty)
Abstract base class for properties.
A data structure describing a label.
Definition: mitkLabel.h:90
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:107
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
nlohmann::json json
Find image slices visible on a given plane.
MITKCORE_EXPORT void ToJSON(nlohmann::json &j, AffineTransform3D::ConstPointer transform)
Write transform (4x4 matrix) as JSON array with 16 elements.
MITKCORE_EXPORT void FromJSON(const nlohmann::json &j, AffineTransform3D::Pointer transform)
Read transform from JSON array (16 elements, resp. 4x4 matrix).
double ScalarType