Medical Imaging Interaction Toolkit  2026.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 {
35  {
36  public:
38 
40  typedef std::string ValueType;
41 
42  itkFactorylessNewMacro(Self);
43 
44  itkCloneMacro(Self)
46  mitkNewMacro2Param(AnnotationProperty, const std::string &, const Point3D &);
49 
54  itkGetStringMacro(Label);
55 
60  itkSetStringMacro(Label);
61 
66  const Point3D &GetPosition() const;
67 
75  void SetPosition(const Point3D &position);
76 
84  std::string GetValueAsString() const override;
85 
95  bool ToJSON(nlohmann::json& j) const override;
96 
105  bool FromJSON(const nlohmann::json& j) override;
106 
107  virtual BaseProperty &operator=(const BaseProperty &other) { return Superclass::operator=(other); }
108  using BaseProperty::operator=;
109 
110  protected:
111  std::string m_Label;
113 
115  AnnotationProperty(const char *label, const Point3D &position);
116  AnnotationProperty(const std::string &label, const Point3D &position);
117  AnnotationProperty(const char *label, ScalarType x, ScalarType y, ScalarType z);
118  AnnotationProperty(const std::string &label, ScalarType x, ScalarType y, ScalarType z);
119 
121 
123 
124  private:
125  // purposely not implemented
126  AnnotationProperty &operator=(const AnnotationProperty &);
127 
128  bool IsEqual(const BaseProperty &property) const override;
129  bool Assign(const BaseProperty &property) override;
130  };
131 
132 } // namespace mitk
133 
134 #endif
#define MITKCORE_EXPORT
Property for storing a text annotation with a 3D position.
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)
std::string ValueType
The type of the label value stored by this property.
mitkClassMacro(AnnotationProperty, BaseProperty)
mitkCloneMacro(AnnotationProperty)
Abstract base class for properties.
A data structure describing a label in a multi-label segmentation.
Definition: mitkLabel.h:101
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:101
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:75
nlohmann::json json
Convenience header that includes all MITK numeric types.
Find image slices visible on a given plane.
MITKCORE_EXPORT void ToJSON(nlohmann::json &j, AffineTransform3D::ConstPointer transform)
Serialize an AffineTransform3D to a JSON array with 16 elements (row-major 4x4 matrix).
MITKCORE_EXPORT void FromJSON(const nlohmann::json &j, AffineTransform3D::Pointer transform)
Deserialize an AffineTransform3D from a JSON array with 16 elements (row-major 4x4 matrix).
double ScalarType
Scalar type used throughout MITK for geometric computations.