Orfeo Toolbox  3.16
itkBinaryImageToStatisticsLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkBinaryImageToStatisticsLabelMapFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-08-11 14:24:40 $
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 __itkBinaryImageToStatisticsLabelMapFilter_h
18 #define __itkBinaryImageToStatisticsLabelMapFilter_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< unsigned long, ::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 
95  itkSetMacro(FullyConnected, bool);
96  itkGetConstReferenceMacro(FullyConnected, bool);
97  itkBooleanMacro(FullyConnected);
98 
99 #ifdef ITK_USE_CONCEPT_CHECKING
100 
101  itkConceptMacro(InputEqualityComparableCheck,
103  itkConceptMacro(IntConvertibleToInputCheck,
105  itkConceptMacro(InputOStreamWritableCheck,
108 #endif
109 
114  itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
115  itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
116 
121  itkSetMacro(InputForegroundValue, InputImagePixelType);
122  itkGetConstMacro(InputForegroundValue, InputImagePixelType);
123 
128  itkSetMacro(ComputeFeretDiameter, bool);
129  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
130  itkBooleanMacro(ComputeFeretDiameter);
131 
136  itkSetMacro(ComputePerimeter, bool);
137  itkGetConstReferenceMacro(ComputePerimeter, bool);
138  itkBooleanMacro(ComputePerimeter);
139 
141  void SetFeatureImage(const TFeatureImage *input)
142  {
143  // Process object is not const-correct so the const casting is required.
144  this->SetNthInput( 1, const_cast<TFeatureImage *>(input) );
145  }
146 
148  const FeatureImageType * GetFeatureImage()
149  {
150  return static_cast<const FeatureImageType*>(this->ProcessObject::GetInput(1));
151  }
152 
154  void SetInput1(const InputImageType *input)
155  {
156  this->SetInput( input );
157  }
158 
160  void SetInput2(const FeatureImageType *input)
161  {
162  this->SetFeatureImage( input );
163  }
164 
171  itkSetMacro(ComputeHistogram, bool);
172  itkGetConstReferenceMacro(ComputeHistogram, bool);
173  itkBooleanMacro(ComputeHistogram);
174 
180  itkSetMacro(NumberOfBins, unsigned int);
181  itkGetConstReferenceMacro(NumberOfBins, unsigned int);
182 
183 
184 protected:
187  void PrintSelf(std::ostream& os, Indent indent) const;
188 
192  void GenerateInputRequestedRegion();
193 
195  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
196 
199  void GenerateData();
200 
201 
202 private:
203  BinaryImageToStatisticsLabelMapFilter(const Self&); //purposely not implemented
204  void operator=(const Self&); //purposely not implemented
205 
211  unsigned int m_NumberOfBins;
213 
214 }; // end of class
215 
216 } // end namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
220 #endif
221 
222 #endif

Generated at Sat Feb 2 2013 23:27:04 for Orfeo Toolbox with doxygen 1.8.1.1