ITK  5.2.0
Insight Toolkit
itkStatisticsLabelObjectAccessors.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  * http://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 itkStatisticsLabelObjectAccessors_h
19 #define itkStatisticsLabelObjectAccessors_h
21 
22 /*
23  *
24  * This code was contributed in the Insight Journal paper:
25  * "Label object representation and manipulation with ITK"
26  * by Lehmann G.
27  * https://hdl.handle.net/1926/584
28  * http://www.insight-journal.org/browse/publication/176
29  *
30  */
31 
32 namespace itk
33 {
34 namespace Functor
35 {
36 template <typename TLabelObject>
38 {
39 public:
40  using LabelObjectType = TLabelObject;
41  using AttributeValueType = double;
42 
43  inline AttributeValueType
44  operator()(const LabelObjectType * labelObject) const
45  {
46  return labelObject->GetMinimum();
47  }
48 };
49 
50 template <typename TLabelObject>
52 {
53 public:
54  using LabelObjectType = TLabelObject;
55  using AttributeValueType = double;
56 
57  inline AttributeValueType
58  operator()(const LabelObjectType * labelObject) const
59  {
60  return labelObject->GetMaximum();
61  }
62 };
63 
64 template <typename TLabelObject>
66 {
67 public:
68  using LabelObjectType = TLabelObject;
69  using AttributeValueType = double;
70 
71  inline AttributeValueType
72  operator()(const LabelObjectType * labelObject) const
73  {
74  return labelObject->GetMean();
75  }
76 };
77 
78 template <typename TLabelObject>
80 {
81 public:
82  using LabelObjectType = TLabelObject;
83  using AttributeValueType = double;
84 
85  inline AttributeValueType
86  operator()(const LabelObjectType * labelObject) const
87  {
88  return labelObject->GetSum();
89  }
90 };
91 
92 template <typename TLabelObject>
94 {
95 public:
96  using LabelObjectType = TLabelObject;
97  using AttributeValueType = double;
98 
99  inline AttributeValueType
100  operator()(const LabelObjectType * labelObject) const
101  {
102  return labelObject->GetStandardDeviation();
103  }
104 };
105 
106 template <typename TLabelObject>
108 {
109 public:
110  using LabelObjectType = TLabelObject;
111  using AttributeValueType = double;
112 
113  inline AttributeValueType
114  operator()(const LabelObjectType * labelObject) const
115  {
116  return labelObject->GetVariance();
117  }
118 };
119 
120 template <typename TLabelObject>
122 {
123 public:
124  using LabelObjectType = TLabelObject;
125  using AttributeValueType = double;
126 
127  inline AttributeValueType
128  operator()(const LabelObjectType * labelObject) const
129  {
130  return labelObject->GetMedian();
131  }
132 };
133 
134 template <typename TLabelObject>
136 {
137 public:
138  using LabelObjectType = TLabelObject;
140 
141  inline AttributeValueType
142  operator()(const LabelObjectType * labelObject) const
143  {
144  return labelObject->GetMaximumIndex();
145  }
146 };
147 
148 template <typename TLabelObject>
150 {
151 public:
152  using LabelObjectType = TLabelObject;
154 
155  inline AttributeValueType
156  operator()(const LabelObjectType * labelObject) const
157  {
158  return labelObject->GetMinimumIndex();
159  }
160 };
161 
162 template <typename TLabelObject>
164 {
165 public:
166  using LabelObjectType = TLabelObject;
168 
169  inline AttributeValueType
170  operator()(const LabelObjectType * labelObject) const
171  {
172  return labelObject->GetCenterOfGravity();
173  }
174 };
175 
176 /*
177 template< typename TLabelObject >
178 class CentralMomentsLabelObjectAccessor
179 {
180 public:
181  using LabelObjectType = TLabelObject;
182  using AttributeValueType = typename LabelObjectType::MatrixType;
183 
184  inline AttributeValueType operator()( const LabelObjectType * labelObject ) const
185  {
186  return labelObject->GetCentralMoments();
187  }
188  };
189 */
190 
191 template <typename TLabelObject>
193 {
194 public:
195  using LabelObjectType = TLabelObject;
197 
198  inline AttributeValueType
199  operator()(const LabelObjectType * labelObject) const
200  {
201  return labelObject->GetWeightedPrincipalMoments();
202  }
203 };
204 
205 template <typename TLabelObject>
207 {
208 public:
209  using LabelObjectType = TLabelObject;
210  using AttributeValueType = typename LabelObjectType::MatrixType;
211 
212  inline AttributeValueType
213  operator()(const LabelObjectType * labelObject) const
214  {
215  return labelObject->GetWeightedPrincipalAxes();
216  }
217 };
218 
219 template <typename TLabelObject>
221 {
222 public:
223  using LabelObjectType = TLabelObject;
224  using AttributeValueType = double;
225 
226  inline AttributeValueType
227  operator()(const LabelObjectType * labelObject) const
228  {
229  return labelObject->GetKurtosis();
230  }
231 };
232 
233 template <typename TLabelObject>
235 {
236 public:
237  using LabelObjectType = TLabelObject;
238  using AttributeValueType = double;
239 
240  inline AttributeValueType
241  operator()(const LabelObjectType * labelObject) const
242  {
243  return labelObject->GetSkewness();
244  }
245 };
246 
247 template <typename TLabelObject>
249 {
250 public:
251  using LabelObjectType = TLabelObject;
252  using AttributeValueType = double;
253 
254  inline AttributeValueType
255  operator()(const LabelObjectType * labelObject) const
256  {
257  return labelObject->GetWeightedElongation();
258  }
259 };
260 
261 template <typename TLabelObject>
263 {
264 public:
265  using LabelObjectType = TLabelObject;
266 
267  using AttributeValueType = typename LabelObjectType::HistogramType *;
268 
269  inline AttributeValueType
270  operator()(const LabelObjectType * labelObject) const
271  {
272  return labelObject->GetHistogram();
273  }
274 };
275 
276 template <typename TLabelObject>
278 {
279 public:
280  using LabelObjectType = TLabelObject;
281  using AttributeValueType = double;
282 
283  inline AttributeValueType
284  operator()(const LabelObjectType * labelObject) const
285  {
286  return labelObject->GetWeightedFlatness();
287  }
288 };
289 } // namespace Functor
290 } // end namespace itk
291 
292 #endif
itk::Functor::MaximumIndexLabelObjectAccessor::AttributeValueType
typename LabelObjectType::IndexType AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:139
itk::Functor::WeightedElongationLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:251
itk::Functor::MedianLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:121
itk::Functor::WeightedPrincipalAxesLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:209
itk::Functor::WeightedPrincipalAxesLabelObjectAccessor::AttributeValueType
typename LabelObjectType::MatrixType AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:210
itk::Functor::MinimumIndexLabelObjectAccessor::AttributeValueType
typename LabelObjectType::IndexType AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:153
itk::Functor::MaximumIndexLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:135
itk::Functor::WeightedFlatnessLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:277
itk::Functor::WeightedFlatnessLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:281
itk::Functor::WeightedElongationLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:252
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Functor::MinimumIndexLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:149
itk::Functor::KurtosisLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:220
itk::Functor::VarianceLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:110
itk::Functor::StandardDeviationLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:96
itk::Functor::WeightedFlatnessLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:284
itk::Functor::CenterOfGravityLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:166
itk::Functor::SumLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:86
itk::Functor::MaximumIndexLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:142
itk::Functor::KurtosisLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:224
itk::Functor::CenterOfGravityLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:163
itk::Functor::SkewnessLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:238
itk::Functor::MinimumLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:41
itk::Functor::MinimumLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:37
itk::Functor::MinimumIndexLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:152
itkShapeLabelObjectAccessors.h
itk::Functor::CenterOfGravityLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:170
itk::Functor::HistogramLabelObjectAccessor::AttributeValueType
typename LabelObjectType::HistogramType * AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:267
itk::Functor::HistogramLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:265
itk::Functor::VarianceLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:111
itk::Functor::SkewnessLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:241
itk::Functor::MedianLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:125
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::Functor::WeightedElongationLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:248
itk::Functor::SumLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:83
itk::Functor::SumLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:82
itk::Functor::MeanLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:72
itk::Functor::MeanLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:69
itk::Functor::StandardDeviationLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:93
itk::Functor::SumLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:79
itk::Functor::MaximumLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:54
itk::Functor::VarianceLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:114
itk::Functor::CenterOfGravityLabelObjectAccessor::AttributeValueType
typename LabelObjectType::PointType AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:167
itk::Functor::WeightedFlatnessLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:280
itk::Functor::MinimumLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:40
itk::Functor::MaximumLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:55
itk::Functor::WeightedPrincipalMomentsLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:199
itk::Functor::WeightedElongationLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:255
itk::Functor::SkewnessLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:234
itk::Functor::SkewnessLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:237
itk::Functor::HistogramLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:262
itk::Functor::VarianceLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:107
itk::Functor::MaximumIndexLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:138
itk::Functor::MeanLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:68
itk::Functor::WeightedPrincipalMomentsLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:195
itk::Functor::HistogramLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:270
itk::Functor::MinimumIndexLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:156
itk::Functor::KurtosisLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:227
itk::Functor::MedianLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:128
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Functor::MaximumLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:58
itk::Functor::KurtosisLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:223
itk::Functor::WeightedPrincipalMomentsLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:192
itk::Functor::StandardDeviationLabelObjectAccessor::AttributeValueType
double AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:97
itk::Functor::MaximumLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:51
itk::Functor::WeightedPrincipalMomentsLabelObjectAccessor::AttributeValueType
typename LabelObjectType::VectorType AttributeValueType
Definition: itkStatisticsLabelObjectAccessors.h:196
itk::Functor::MeanLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:65
itk::Functor::MedianLabelObjectAccessor::LabelObjectType
TLabelObject LabelObjectType
Definition: itkStatisticsLabelObjectAccessors.h:124
itk::Functor::WeightedPrincipalAxesLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:213
itk::Functor::StandardDeviationLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:100
itk::Functor::WeightedPrincipalAxesLabelObjectAccessor
Definition: itkStatisticsLabelObjectAccessors.h:206
itk::Functor::MinimumLabelObjectAccessor::operator()
AttributeValueType operator()(const LabelObjectType *labelObject) const
Definition: itkStatisticsLabelObjectAccessors.h:44