Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitkLabel.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 mitkLabel_h
14 #define mitkLabel_h
15 
16 #include "MitkMultilabelExports.h"
17 #include <mitkColorProperty.h>
18 #include <mitkPropertyList.h>
19 #include <mitkPoint.h>
20 #include <mitkVector.h>
21 
22 namespace mitk
23 {
24  //##
25  //##Documentation
26  //## @brief A data structure describing a label.
27  //## @ingroup Data
28  //##
30  {
31  public:
33 
34  typedef unsigned short PixelType;
35 
36  itkNewMacro(Self);
37  mitkNewMacro2Param(Self, PixelType, const std::string&);
38 
40  static const PixelType MAX_LABEL_VALUE;
41 
42  void SetLocked(bool locked);
43  bool GetLocked() const;
44 
45  void SetVisible(bool visible);
46  bool GetVisible() const;
47 
48  void SetOpacity(float opacity);
49  float GetOpacity() const;
50 
51  void SetName(const std::string &name);
52  std::string GetName() const;
53 
54  void SetCenterOfMassIndex(const mitk::Point3D &center);
55  mitk::Point3D GetCenterOfMassIndex() const;
56 
57  void SetCenterOfMassCoordinates(const mitk::Point3D &center);
58  mitk::Point3D GetCenterOfMassCoordinates() const;
59 
60  void SetColor(const mitk::Color &);
61  const mitk::Color &GetColor() const;
62 
63  void SetValue(PixelType pixelValue);
64  PixelType GetValue() const;
65 
66  void SetLayer(unsigned int layer);
67  unsigned int GetLayer() const;
68 
69  void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
70 
71  using itk::Object::Modified;
72  void Modified() { Superclass::Modified(); }
73  Label();
74  Label(PixelType value, const std::string& name);
75  ~Label() override;
76 
77  protected:
78  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
79 
80  Label(const Label &other);
81 
82  private:
83  itk::LightObject::Pointer InternalClone() const override;
84  };
85 
100  MITKMULTILABEL_EXPORT bool Equal(const mitk::Label &leftHandSide,
101  const mitk::Label &rightHandSide,
102  ScalarType eps,
103  bool verbose);
104 
105 } // namespace mitk
106 
107 #endif
mitk::eps
const MITKCORE_EXPORT ScalarType eps
MITKMULTILABEL_EXPORT
#define MITKMULTILABEL_EXPORT
Definition: MitkMultilabelExports.h:15
mitk::BaseProperty
Abstract base class for properties.
Definition: mitkBaseProperty.h:36
mitkNewMacro2Param
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
mitk::Color
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Definition: mitkColorProperty.h:38
mitk::Equal
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
mitkPoint.h
mitk::Label::PixelType
unsigned short PixelType
Definition: mitkLabel.h:34
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::Label::MAX_LABEL_VALUE
static const PixelType MAX_LABEL_VALUE
The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535.
Definition: mitkLabel.h:40
mitk::Label
A data structure describing a label.
Definition: mitkLabel.h:29
mitk::Point< ScalarType, 3 >
mitkPropertyList.h
mitk::PixelType
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51
mitk::Label::Modified
void Modified()
Definition: mitkLabel.h:72
mitk::PropertyList
Key-value list holding instances of BaseProperty.
Definition: mitkPropertyList.h:56
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkColorProperty.h
mitkVector.h
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
MitkMultilabelExports.h