Medical Imaging Interaction Toolkit  2018.04.99-aba3194f
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  itkNewMacro(Self);
34 
35  typedef unsigned short PixelType;
36 
38  static const PixelType MAX_LABEL_VALUE;
39 
40  void SetLocked(bool locked);
41  bool GetLocked() const;
42 
43  void SetVisible(bool visible);
44  bool GetVisible() const;
45 
46  void SetOpacity(float opacity);
47  float GetOpacity() const;
48 
49  void SetName(const std::string &name);
50  std::string GetName() const;
51 
52  void SetCenterOfMassIndex(const mitk::Point3D &center);
53  mitk::Point3D GetCenterOfMassIndex() const;
54 
55  void SetCenterOfMassCoordinates(const mitk::Point3D &center);
56  mitk::Point3D GetCenterOfMassCoordinates() const;
57 
58  void SetColor(const mitk::Color &);
59  const mitk::Color &GetColor() const;
60 
61  void SetValue(PixelType pixelValue);
62  PixelType GetValue() const;
63 
64  void SetLayer(unsigned int layer);
65  unsigned int GetLayer() const;
66 
67  void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
68 
69  using itk::Object::Modified;
70  void Modified() { Superclass::Modified(); }
71  Label();
72  ~Label() override;
73 
74  protected:
75  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
76 
77  Label(const Label &other);
78 
79  private:
80  itk::LightObject::Pointer InternalClone() const override;
81  };
82 
97  MITKMULTILABEL_EXPORT bool Equal(const mitk::Label &leftHandSide,
98  const mitk::Label &rightHandSide,
100  bool verbose);
101 
102 } // namespace mitk
103 
104 #endif // __mitkLabel_H_
MITKCORE_EXPORT const ScalarType eps
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:38
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
A data structure describing a label.
Definition: mitkLabel.h:28
Key-value list holding instances of BaseProperty.
#define MITKMULTILABEL_EXPORT
void Modified()
Definition: mitkLabel.h:70
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.
Abstract base class for properties.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
unsigned short PixelType
Definition: mitkLabel.h:33