ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkLabelMapUtilities.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkLabelMapUtilities_h
19 #define itkLabelMapUtilities_h
20 
21 /*
22  *
23  * This code was contributed in the Insight Journal paper:
24  * "Label object representation and manipulation with ITK"
25  * by Lehmann G.
26  * https://hdl.handle.net/1926/584
27  * http://www.insight-journal.org/browse/publication/176
28  *
29  */
30 
31 #define itkShapeLabelMapFilterDispatchMacro() \
32  case LabelObjectType::LABEL: \
33  { \
34  typedef typename Functor::LabelLabelObjectAccessor< LabelObjectType > AccessorType; \
35  AccessorType accessor; \
36  this->TemplatedGenerateData(accessor); \
37  break; \
38  } \
39  case LabelObjectType::NUMBER_OF_PIXELS: \
40  { \
41  typedef typename Functor::NumberOfPixelsLabelObjectAccessor< LabelObjectType > AccessorType; \
42  AccessorType accessor; \
43  this->TemplatedGenerateData(accessor); \
44  break; \
45  } \
46  case LabelObjectType::PHYSICAL_SIZE: \
47  { \
48  typedef typename Functor::PhysicalSizeLabelObjectAccessor< LabelObjectType > AccessorType; \
49  AccessorType accessor; \
50  this->TemplatedGenerateData(accessor); \
51  break; \
52  } \
53  case LabelObjectType::NUMBER_OF_PIXELS_ON_BORDER: \
54  { \
55  typedef typename Functor::NumberOfPixelsOnBorderLabelObjectAccessor< LabelObjectType > AccessorType; \
56  AccessorType accessor; \
57  this->TemplatedGenerateData(accessor); \
58  break; \
59  } \
60  case LabelObjectType::PERIMETER_ON_BORDER: \
61  { \
62  typedef typename Functor::PerimeterOnBorderLabelObjectAccessor< LabelObjectType > AccessorType; \
63  AccessorType accessor; \
64  this->TemplatedGenerateData(accessor); \
65  break; \
66  } \
67  case LabelObjectType::FERET_DIAMETER: \
68  { \
69  typedef typename Functor::FeretDiameterLabelObjectAccessor< LabelObjectType > AccessorType; \
70  AccessorType accessor; \
71  this->TemplatedGenerateData(accessor); \
72  break; \
73  } \
74  case LabelObjectType::ELONGATION: \
75  { \
76  typedef typename Functor::ElongationLabelObjectAccessor< LabelObjectType > AccessorType; \
77  AccessorType accessor; \
78  this->TemplatedGenerateData(accessor); \
79  break; \
80  } \
81  case LabelObjectType::PERIMETER: \
82  { \
83  typedef typename Functor::PerimeterLabelObjectAccessor< LabelObjectType > AccessorType; \
84  AccessorType accessor; \
85  this->TemplatedGenerateData(accessor); \
86  break; \
87  } \
88  case LabelObjectType::ROUNDNESS: \
89  { \
90  typedef typename Functor::RoundnessLabelObjectAccessor< LabelObjectType > AccessorType; \
91  AccessorType accessor; \
92  this->TemplatedGenerateData(accessor); \
93  break; \
94  } \
95  case LabelObjectType::EQUIVALENT_SPHERICAL_RADIUS: \
96  { \
97  typedef typename Functor::EquivalentSphericalRadiusLabelObjectAccessor< LabelObjectType > AccessorType; \
98  AccessorType accessor; \
99  this->TemplatedGenerateData(accessor); \
100  break; \
101  } \
102  case LabelObjectType::EQUIVALENT_SPHERICAL_PERIMETER: \
103  { \
104  typedef typename Functor::EquivalentSphericalPerimeterLabelObjectAccessor< LabelObjectType > AccessorType; \
105  AccessorType accessor; \
106  this->TemplatedGenerateData(accessor); \
107  break; \
108  } \
109  case LabelObjectType::FLATNESS: \
110  { \
111  typedef typename Functor::FlatnessLabelObjectAccessor< LabelObjectType > AccessorType; \
112  AccessorType accessor; \
113  this->TemplatedGenerateData(accessor); \
114  break; \
115  } \
116  case LabelObjectType::PERIMETER_ON_BORDER_RATIO: \
117  { \
118  typedef typename Functor::PerimeterOnBorderRatioLabelObjectAccessor< LabelObjectType > AccessorType; \
119  AccessorType accessor; \
120  this->TemplatedGenerateData(accessor); \
121  break; \
122  }
123 
124 
125 #define itkStatisticsLabelMapFilterDispatchMacro() \
126  case LabelObjectType::MINIMUM: \
127  { \
128  typedef typename Functor::MinimumLabelObjectAccessor< LabelObjectType > AccessorType; \
129  AccessorType accessor; \
130  this->TemplatedGenerateData(accessor); \
131  break; \
132  } \
133  case LabelObjectType::MAXIMUM: \
134  { \
135  typedef typename Functor::MaximumLabelObjectAccessor< LabelObjectType > AccessorType; \
136  AccessorType accessor; \
137  this->TemplatedGenerateData(accessor); \
138  break; \
139  } \
140  case LabelObjectType::MEAN: \
141  { \
142  typedef typename Functor::MeanLabelObjectAccessor< LabelObjectType > AccessorType; \
143  AccessorType accessor; \
144  this->TemplatedGenerateData(accessor); \
145  break; \
146  } \
147  case LabelObjectType::SUM: \
148  { \
149  typedef typename Functor::SumLabelObjectAccessor< LabelObjectType > AccessorType; \
150  AccessorType accessor; \
151  this->TemplatedGenerateData(accessor); \
152  break; \
153  } \
154  case LabelObjectType::STANDARD_DEVIATION: \
155  { \
156  typedef typename Functor::StandardDeviationLabelObjectAccessor< LabelObjectType > AccessorType; \
157  AccessorType accessor; \
158  this->TemplatedGenerateData(accessor); \
159  break; \
160  } \
161  case LabelObjectType::VARIANCE: \
162  { \
163  typedef typename Functor::VarianceLabelObjectAccessor< LabelObjectType > AccessorType; \
164  AccessorType accessor; \
165  this->TemplatedGenerateData(accessor); \
166  break; \
167  } \
168  case LabelObjectType::MEDIAN: \
169  { \
170  typedef typename Functor::MedianLabelObjectAccessor< LabelObjectType > AccessorType; \
171  AccessorType accessor; \
172  this->TemplatedGenerateData(accessor); \
173  break; \
174  } \
175  case LabelObjectType::KURTOSIS: \
176  { \
177  typedef typename Functor::KurtosisLabelObjectAccessor< LabelObjectType > AccessorType; \
178  AccessorType accessor; \
179  this->TemplatedGenerateData(accessor); \
180  break; \
181  } \
182  case LabelObjectType::SKEWNESS: \
183  { \
184  typedef typename Functor::SkewnessLabelObjectAccessor< LabelObjectType > AccessorType; \
185  AccessorType accessor; \
186  this->TemplatedGenerateData(accessor); \
187  break; \
188  } \
189  case LabelObjectType::WEIGHTED_ELONGATION: \
190  { \
191  typedef typename Functor::WeightedElongationLabelObjectAccessor< LabelObjectType > AccessorType; \
192  AccessorType accessor; \
193  this->TemplatedGenerateData(accessor); \
194  break; \
195  } \
196  case LabelObjectType::WEIGHTED_FLATNESS: \
197  { \
198  typedef typename Functor::WeightedFlatnessLabelObjectAccessor< LabelObjectType > AccessorType; \
199  AccessorType accessor; \
200  this->TemplatedGenerateData(accessor); \
201  break; \
202  }
203 
204 #endif