Medical Imaging Interaction Toolkit  2023.04.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 <mitkVector.h>
20 
21 namespace mitk
22 {
23  //##
24  //##Documentation
25  //## @brief A data structure describing a label.
26  //## @ingroup Data
27  //##
29  {
30  public:
32 
33  typedef unsigned short PixelType;
34 
35  itkNewMacro(Self);
36  mitkNewMacro2Param(Self, PixelType, const std::string&);
37 
39  static const PixelType MAX_LABEL_VALUE;
40 
41  void SetLocked(bool locked);
42  bool GetLocked() const;
43 
44  void SetVisible(bool visible);
45  bool GetVisible() const;
46 
47  void SetOpacity(float opacity);
48  float GetOpacity() const;
49 
50  void SetName(const std::string &name);
51  std::string GetName() const;
52 
53  void SetCenterOfMassIndex(const mitk::Point3D &center);
54  mitk::Point3D GetCenterOfMassIndex() const;
55 
56  void SetCenterOfMassCoordinates(const mitk::Point3D &center);
57  mitk::Point3D GetCenterOfMassCoordinates() const;
58 
59  void SetColor(const mitk::Color &);
60  const mitk::Color &GetColor() const;
61 
62  void SetValue(PixelType pixelValue);
63  PixelType GetValue() const;
64 
65  void SetLayer(unsigned int layer);
66  unsigned int GetLayer() const;
67 
68  void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
69 
70  using itk::Object::Modified;
71  void Modified() { Superclass::Modified(); }
72  Label();
73  Label(PixelType value, const std::string& name);
74  ~Label() override;
75 
76  protected:
77  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
78 
79  Label(const Label &other);
80 
81  private:
82  itk::LightObject::Pointer InternalClone() const override;
83  };
84 
99  MITKMULTILABEL_EXPORT bool Equal(const mitk::Label &leftHandSide,
100  const mitk::Label &rightHandSide,
101  ScalarType eps,
102  bool verbose);
103 
104 } // namespace mitk
105 
106 #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:35
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:35
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.
mitk::Label::PixelType
unsigned short PixelType
Definition: mitkLabel.h:33
mitk
DataCollection - Class to facilitate loading/accessing structured data.
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:39
mitk::Label
A data structure describing a label.
Definition: mitkLabel.h:28
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:71
mitk::PropertyList
Key-value list holding instances of BaseProperty.
Definition: mitkPropertyList.h:64
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkColorProperty.h
mitkVector.h
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
MitkMultilabelExports.h