Orfeo Toolbox  3.16
itkLabelImageToStatisticsLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkLabelImageToStatisticsLabelMapFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-08-10 11:54:59 $
7  Version: $Revision: 1.3 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkLabelImageToStatisticsLabelMapFilter_h
18 #define __itkLabelImageToStatisticsLabelMapFilter_h
19 
20 #include "itkImageToImageFilter.h"
22 #include "itkLabelMap.h"
25 
26 
27 namespace itk {
28 
41 template<class TInputImage, class TFeatureImage, class TOutputImage=LabelMap< StatisticsLabelObject< ITK_TYPENAME TInputImage::PixelType, ::itk::GetImageDimension<TInputImage>::ImageDimension> > >
43  public ImageToImageFilter<TInputImage, TOutputImage>
44 {
45 public:
51 
53  typedef TInputImage InputImageType;
54  typedef typename InputImageType::Pointer InputImagePointer;
55  typedef typename InputImageType::ConstPointer InputImageConstPointer;
56  typedef typename InputImageType::RegionType InputImageRegionType;
57  typedef typename InputImageType::PixelType InputImagePixelType;
58 
59  typedef TOutputImage OutputImageType;
60  typedef typename OutputImageType::Pointer OutputImagePointer;
61  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
62  typedef typename OutputImageType::RegionType OutputImageRegionType;
63  typedef typename OutputImageType::PixelType OutputImagePixelType;
64  typedef typename OutputImageType::LabelObjectType LabelObjectType;
65 
66  typedef TFeatureImage FeatureImageType;
67  typedef typename FeatureImageType::Pointer FeatureImagePointer;
68  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
69  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
70 
72  itkStaticConstMacro(InputImageDimension, unsigned int,
73  TInputImage::ImageDimension);
74  itkStaticConstMacro(OutputImageDimension, unsigned int,
75  TInputImage::ImageDimension);
76  itkStaticConstMacro(ImageDimension, unsigned int,
77  TInputImage::ImageDimension);
78 
81 
83  itkNewMacro(Self);
84 
88 
89 #ifdef ITK_USE_CONCEPT_CHECKING
90 
91  itkConceptMacro(InputEqualityComparableCheck,
93  itkConceptMacro(IntConvertibleToInputCheck,
95  itkConceptMacro(InputOStreamWritableCheck,
98 #endif
99 
104  itkSetMacro(BackgroundValue, OutputImagePixelType);
105  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
106 
111  itkSetMacro(ComputeFeretDiameter, bool);
112  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
113  itkBooleanMacro(ComputeFeretDiameter);
114 
119  itkSetMacro(ComputePerimeter, bool);
120  itkGetConstReferenceMacro(ComputePerimeter, bool);
121  itkBooleanMacro(ComputePerimeter);
122 
124  void SetFeatureImage(const TFeatureImage *input)
125  {
126  // Process object is not const-correct so the const casting is required.
127  this->SetNthInput( 1, const_cast<TFeatureImage *>(input) );
128  }
129 
131  const FeatureImageType * GetFeatureImage()
132  {
133  return static_cast<FeatureImageType*>(this->ProcessObject::GetInput(1));
134  }
135 
137  void SetInput1(const InputImageType *input)
138  {
139  this->SetInput( input );
140  }
141 
143  void SetInput2(const FeatureImageType *input)
144  {
145  this->SetFeatureImage( input );
146  }
147 
154  itkSetMacro(ComputeHistogram, bool);
155  itkGetConstReferenceMacro(ComputeHistogram, bool);
156  itkBooleanMacro(ComputeHistogram);
157 
163  itkSetMacro(NumberOfBins, unsigned int);
164  itkGetConstReferenceMacro(NumberOfBins, unsigned int);
165 
166 
167 protected:
170  void PrintSelf(std::ostream& os, Indent indent) const;
171 
175  void GenerateInputRequestedRegion();
176 
178  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
179 
182  void GenerateData();
183 
184 
185 private:
186  LabelImageToStatisticsLabelMapFilter(const Self&); //purposely not implemented
187  void operator=(const Self&); //purposely not implemented
188 
192  unsigned int m_NumberOfBins;
194 
195 }; // end of class
196 
197 } // end namespace itk
198 
199 #ifndef ITK_MANUAL_INSTANTIATION
201 #endif
202 
203 #endif

Generated at Sat Feb 2 2013 23:48:21 for Orfeo Toolbox with doxygen 1.8.1.1