ITK  6.0.0
Insight Toolkit
itkSpatialObjectProperty.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSpatialObjectProperty_h
19#define itkSpatialObjectProperty_h
20
21#include <string>
22#include <map>
23
24#include "itkLightObject.h"
25#include "itkRGBAPixel.h"
26#include "itkTimeStamp.h"
27#include "itkObjectFactory.h"
28
29#include "ITKSpatialObjectsExport.h"
30
31namespace itk
32{
38class ITKSpatialObjects_EXPORT SpatialObjectProperty
39{
40public:
42
43 virtual ~SpatialObjectProperty() = default;
44
46
48
49 virtual void
51
52 void
53 SetColor(const ColorType & color)
54 {
55 m_Color = color;
56 }
57
58 ColorType &
60 {
61 return m_Color;
62 }
63
64 const ColorType &
65 GetColor() const
66 {
67 return m_Color;
68 }
69
70 void
71 SetColor(double r, double g, double b);
72
73 void
74 SetRed(double r);
75 double
76 GetRed() const;
77
78 void
79 SetGreen(double g);
80 double
81 GetGreen() const;
82
83 void
84 SetBlue(double b);
85 double
86 GetBlue() const;
87
88 void
89 SetAlpha(double a);
90 double
91 GetAlpha() const;
92
93 void
94 SetName(const std::string & name)
95 {
96 m_Name = name;
97 }
98
99 std::string &
101 {
102 return m_Name;
103 }
104
105 const std::string &
106 GetName() const
107 {
108 return m_Name;
109 }
110
111 void
112 SetTagScalarValue(const std::string & tag, double value);
113 void
114 SetTagStringValue(const std::string & tag, const std::string & value);
115
116 bool
117 GetTagScalarValue(const std::string & tag, double & value) const;
118 double
119 GetTagScalarValue(const std::string & tag) const
120 {
121 double value = 0;
122 this->GetTagScalarValue(tag, value);
123 return value;
124 }
125
126 bool
127 GetTagStringValue(const std::string & tag, std::string & value) const;
128 std::string
129 GetTagStringValue(const std::string & tag) const
130 {
131 std::string value = "";
132 this->GetTagStringValue(tag, value);
133 return value;
134 }
135
136
137 std::map<std::string, double> &
139 const std::map<std::string, double> &
141 std::map<std::string, std::string> &
143 const std::map<std::string, std::string> &
145
146 void
147 SetTagScalarDictionary(const std::map<std::string, double> & dict);
148 void
149 SetTagStringDictionary(const std::map<std::string, std::string> & dict);
150
151 void
152 Print(std::ostream & os) const
153 {
154 this->PrintSelf(os, 3);
155 }
156
157 Self &
159
160protected:
161 void
162 PrintSelf(std::ostream & os, Indent indent) const;
163
164private:
165 ColorType m_Color{};
166
167 std::string m_Name{};
168
169 std::map<std::string, double> m_ScalarDictionary{};
170 std::map<std::string, std::string> m_StringDictionary{};
171};
172
173} // namespace itk
174
175#endif // __SpatialObjectProperty_h
Pixel-wise addition of two images.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Self & operator=(const SpatialObjectProperty &rhs)
std::map< std::string, double > & GetTagScalarDictionary()
const std::string & GetName() const
const ColorType & GetColor() const
void PrintSelf(std::ostream &os, Indent indent) const
const std::map< std::string, double > & GetTagScalarDictionary() const
void SetColor(const ColorType &color)
std::map< std::string, std::string > & GetTagStringDictionary()
virtual ~SpatialObjectProperty()=default
void Print(std::ostream &os) const
std::string GetTagStringValue(const std::string &tag) const
const std::map< std::string, std::string > & GetTagStringDictionary() const
bool GetTagStringValue(const std::string &tag, std::string &value) const
void SetTagStringValue(const std::string &tag, const std::string &value)
void SetName(const std::string &name)
void SetTagScalarValue(const std::string &tag, double value)
void SetColor(double r, double g, double b)
double GetTagScalarValue(const std::string &tag) const
void SetTagStringDictionary(const std::map< std::string, std::string > &dict)
void SetTagScalarDictionary(const std::map< std::string, double > &dict)
bool GetTagScalarValue(const std::string &tag, double &value) const
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....