Orfeo Toolbox  4.0
itkBinaryImageToStatisticsLabelMapFilter.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 __itkBinaryImageToStatisticsLabelMapFilter_h
19 #define __itkBinaryImageToStatisticsLabelMapFilter_h
20 
24 
25 namespace itk
26 {
40 template< typename TInputImage, typename TFeatureImage, typename TOutputImage =
41  LabelMap< StatisticsLabelObject< SizeValueType, 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  // Begin concept checking
101  itkConceptMacro( InputEqualityComparableCheck,
103  itkConceptMacro( IntConvertibleToInputCheck,
105  itkConceptMacro( InputOStreamWritableCheck,
107  // End concept checking
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 
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 protected:
186  void PrintSelf(std::ostream & os, Indent indent) const;
187 
192 
194  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
195 
198  void GenerateData();
199 
200 private:
201  BinaryImageToStatisticsLabelMapFilter(const Self &); //purposely not
202  // implemented
203  void operator=(const Self &); //purposely not
204  // implemented
205 
211  unsigned int m_NumberOfBins;
213 }; // end of class
214 } // end namespace itk
215 
216 #ifndef ITK_MANUAL_INSTANTIATION
218 #endif
219 
220 #endif

Generated at Sat Mar 8 2014 14:20:05 for Orfeo Toolbox with doxygen 1.8.3.1