ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLabelMapUtilities.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkLabelMapUtilities_h
00019 #define __itkLabelMapUtilities_h
00020 
00021 /*
00022  *
00023  * This code was contributed in the Insight Journal paper:
00024  * "Label object representation and manipulation with ITK"
00025  * by Lehmann G.
00026  * http://hdl.handle.net/1926/584
00027  * http://www.insight-journal.org/browse/publication/176
00028  *
00029  */
00030 
00031 #define itkShapeLabelMapFilterDispatchMacro() \
00032     case LabelObjectType::LABEL: \
00033       { \
00034       typedef typename Functor::LabelLabelObjectAccessor< LabelObjectType > AccessorType; \
00035       AccessorType accessor; \
00036       this->TemplatedGenerateData(accessor); \
00037       break; \
00038       } \
00039     case LabelObjectType::NUMBER_OF_PIXELS: \
00040       { \
00041       typedef typename Functor::NumberOfPixelsLabelObjectAccessor< LabelObjectType > AccessorType; \
00042       AccessorType accessor; \
00043       this->TemplatedGenerateData(accessor); \
00044       break; \
00045       } \
00046     case LabelObjectType::PHYSICAL_SIZE: \
00047       { \
00048       typedef typename Functor::PhysicalSizeLabelObjectAccessor< LabelObjectType > AccessorType; \
00049       AccessorType accessor; \
00050       this->TemplatedGenerateData(accessor); \
00051       break; \
00052       } \
00053     case LabelObjectType::NUMBER_OF_PIXELS_ON_BORDER: \
00054       { \
00055       typedef typename Functor::NumberOfPixelsOnBorderLabelObjectAccessor< LabelObjectType > AccessorType; \
00056       AccessorType accessor; \
00057       this->TemplatedGenerateData(accessor); \
00058       break; \
00059       } \
00060     case LabelObjectType::PERIMETER_ON_BORDER: \
00061       { \
00062       typedef typename Functor::PerimeterOnBorderLabelObjectAccessor< LabelObjectType > AccessorType; \
00063       AccessorType accessor; \
00064       this->TemplatedGenerateData(accessor); \
00065       break; \
00066       } \
00067     case LabelObjectType::FERET_DIAMETER: \
00068       { \
00069       typedef typename Functor::FeretDiameterLabelObjectAccessor< LabelObjectType > AccessorType; \
00070       AccessorType accessor; \
00071       this->TemplatedGenerateData(accessor); \
00072       break; \
00073       } \
00074     case LabelObjectType::ELONGATION: \
00075       { \
00076       typedef typename Functor::ElongationLabelObjectAccessor< LabelObjectType > AccessorType; \
00077       AccessorType accessor; \
00078       this->TemplatedGenerateData(accessor); \
00079       break; \
00080       } \
00081     case LabelObjectType::PERIMETER: \
00082       { \
00083       typedef typename Functor::PerimeterLabelObjectAccessor< LabelObjectType > AccessorType; \
00084       AccessorType accessor; \
00085       this->TemplatedGenerateData(accessor); \
00086       break; \
00087       } \
00088     case LabelObjectType::ROUNDNESS: \
00089       { \
00090       typedef typename Functor::RoundnessLabelObjectAccessor< LabelObjectType > AccessorType; \
00091       AccessorType accessor; \
00092       this->TemplatedGenerateData(accessor); \
00093       break; \
00094       } \
00095     case LabelObjectType::EQUIVALENT_SPHERICAL_RADIUS: \
00096       { \
00097       typedef typename Functor::EquivalentSphericalRadiusLabelObjectAccessor< LabelObjectType > AccessorType; \
00098       AccessorType accessor; \
00099       this->TemplatedGenerateData(accessor); \
00100       break; \
00101       } \
00102     case LabelObjectType::EQUIVALENT_SPHERICAL_PERIMETER: \
00103       { \
00104       typedef typename Functor::EquivalentSphericalPerimeterLabelObjectAccessor< LabelObjectType > AccessorType; \
00105       AccessorType accessor; \
00106       this->TemplatedGenerateData(accessor); \
00107       break; \
00108       } \
00109     case LabelObjectType::FLATNESS: \
00110       { \
00111       typedef typename Functor::FlatnessLabelObjectAccessor< LabelObjectType > AccessorType; \
00112       AccessorType accessor; \
00113       this->TemplatedGenerateData(accessor); \
00114       break; \
00115       } \
00116     case LabelObjectType::PERIMETER_ON_BORDER_RATIO: \
00117       { \
00118       typedef typename Functor::PerimeterOnBorderRatioLabelObjectAccessor< LabelObjectType > AccessorType; \
00119       AccessorType accessor; \
00120       this->TemplatedGenerateData(accessor); \
00121       break; \
00122       }
00123 
00124 
00125 #define itkStatisticsLabelMapFilterDispatchMacro() \
00126     case LabelObjectType::MINIMUM: \
00127       { \
00128       typedef typename Functor::MinimumLabelObjectAccessor< LabelObjectType > AccessorType; \
00129       AccessorType accessor; \
00130       this->TemplatedGenerateData(accessor); \
00131       break; \
00132       } \
00133     case LabelObjectType::MAXIMUM: \
00134       { \
00135       typedef typename Functor::MaximumLabelObjectAccessor< LabelObjectType > AccessorType; \
00136       AccessorType accessor; \
00137       this->TemplatedGenerateData(accessor); \
00138       break; \
00139       } \
00140     case LabelObjectType::MEAN: \
00141       { \
00142       typedef typename Functor::MeanLabelObjectAccessor< LabelObjectType > AccessorType; \
00143       AccessorType accessor; \
00144       this->TemplatedGenerateData(accessor); \
00145       break; \
00146       } \
00147     case LabelObjectType::SUM: \
00148       { \
00149       typedef typename Functor::SumLabelObjectAccessor< LabelObjectType > AccessorType; \
00150       AccessorType accessor; \
00151       this->TemplatedGenerateData(accessor); \
00152       break; \
00153       } \
00154     case LabelObjectType::STANDARD_DEVIATION: \
00155       { \
00156       typedef typename Functor::StandardDeviationLabelObjectAccessor< LabelObjectType > AccessorType; \
00157       AccessorType accessor; \
00158       this->TemplatedGenerateData(accessor); \
00159       break; \
00160       } \
00161     case LabelObjectType::VARIANCE: \
00162       { \
00163       typedef typename Functor::VarianceLabelObjectAccessor< LabelObjectType > AccessorType; \
00164       AccessorType accessor; \
00165       this->TemplatedGenerateData(accessor); \
00166       break; \
00167       } \
00168     case LabelObjectType::MEDIAN: \
00169       { \
00170       typedef typename Functor::MedianLabelObjectAccessor< LabelObjectType > AccessorType; \
00171       AccessorType accessor; \
00172       this->TemplatedGenerateData(accessor); \
00173       break; \
00174       } \
00175     case LabelObjectType::KURTOSIS: \
00176       { \
00177       typedef typename Functor::KurtosisLabelObjectAccessor< LabelObjectType > AccessorType; \
00178       AccessorType accessor; \
00179       this->TemplatedGenerateData(accessor); \
00180       break; \
00181       } \
00182     case LabelObjectType::SKEWNESS: \
00183       { \
00184       typedef typename Functor::SkewnessLabelObjectAccessor< LabelObjectType > AccessorType; \
00185       AccessorType accessor; \
00186       this->TemplatedGenerateData(accessor); \
00187       break; \
00188       } \
00189     case LabelObjectType::WEIGHTED_ELONGATION: \
00190       { \
00191       typedef typename Functor::WeightedElongationLabelObjectAccessor< LabelObjectType > AccessorType; \
00192       AccessorType accessor; \
00193       this->TemplatedGenerateData(accessor); \
00194       break; \
00195       } \
00196     case LabelObjectType::WEIGHTED_FLATNESS: \
00197       { \
00198       typedef typename Functor::WeightedFlatnessLabelObjectAccessor< LabelObjectType > AccessorType; \
00199       AccessorType accessor; \
00200       this->TemplatedGenerateData(accessor); \
00201       break; \
00202       }
00203 
00204 #endif
00205