Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 class TiXmlDocument;
22 class TiXmlElement;
23 
24 namespace mitk
25 {
26  //##
27  //##Documentation
28  //## @brief A data structure describing a label.
29  //## @ingroup Data
30  //##
32  {
33  public:
35 
36  itkNewMacro(Self);
37 
38  typedef unsigned short PixelType;
39 
41  static const PixelType MAX_LABEL_VALUE;
42 
43  void SetLocked(bool locked);
44  bool GetLocked() const;
45 
46  void SetVisible(bool visible);
47  bool GetVisible() const;
48 
49  void SetOpacity(float opacity);
50  float GetOpacity() const;
51 
52  void SetName(const std::string &name);
53  std::string GetName() const;
54 
55  void SetCenterOfMassIndex(const mitk::Point3D &center);
56  mitk::Point3D GetCenterOfMassIndex() const;
57 
58  void SetCenterOfMassCoordinates(const mitk::Point3D &center);
59  mitk::Point3D GetCenterOfMassCoordinates() const;
60 
61  void SetColor(const mitk::Color &);
62  const mitk::Color &GetColor() const;
63 
64  void SetValue(PixelType pixelValue);
65  PixelType GetValue() const;
66 
67  void SetLayer(unsigned int layer);
68  unsigned int GetLayer() const;
69 
70  void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
71 
72  using itk::Object::Modified;
73  void Modified() { Superclass::Modified(); }
74  Label();
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 // __mitkLabel_H_
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
A data structure describing a label.
Definition: mitkLabel.h:31
Key-value list holding instances of BaseProperty.
#define MITKMULTILABEL_EXPORT
void Modified()
Definition: mitkLabel.h:73
Abstract base class for properties.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
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:41
bool verbose(false)
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
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.
MITKCORE_EXPORT const ScalarType eps
static std::string GetName(std::string fileName, std::string suffix)
unsigned short PixelType
Definition: mitkLabel.h:36