Orfeo Toolbox  4.0
itkLabelImageToStatisticsLabelMapFilter.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 __itkLabelImageToStatisticsLabelMapFilter_h
19 #define __itkLabelImageToStatisticsLabelMapFilter_h
20 
24 
25 namespace itk
26 {
40 template< typename TInputImage, typename TFeatureImage, typename TOutputImage =
41  LabelMap< StatisticsLabelObject< typename TInputImage::PixelType,
42  TInputImage::ImageDimension > > >
44  public ImageToImageFilter< TInputImage, TOutputImage >
45 {
46 public:
52 
54  typedef TInputImage InputImageType;
55  typedef typename InputImageType::Pointer InputImagePointer;
56  typedef typename InputImageType::ConstPointer InputImageConstPointer;
57  typedef typename InputImageType::RegionType InputImageRegionType;
58  typedef typename InputImageType::PixelType InputImagePixelType;
59 
60  typedef TOutputImage OutputImageType;
61  typedef typename OutputImageType::Pointer OutputImagePointer;
62  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
63  typedef typename OutputImageType::RegionType OutputImageRegionType;
64  typedef typename OutputImageType::PixelType OutputImagePixelType;
65  typedef typename OutputImageType::LabelObjectType LabelObjectType;
66 
67  typedef TFeatureImage FeatureImageType;
68  typedef typename FeatureImageType::Pointer FeatureImagePointer;
69  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
70  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
71 
73  itkStaticConstMacro(InputImageDimension, unsigned int,
74  TInputImage::ImageDimension);
75  itkStaticConstMacro(OutputImageDimension, unsigned int,
76  TInputImage::ImageDimension);
77  itkStaticConstMacro(ImageDimension, unsigned int,
78  TInputImage::ImageDimension);
79 
82 
84  itkNewMacro(Self);
85 
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
92  itkConceptMacro( InputEqualityComparableCheck,
94  itkConceptMacro( IntConvertibleToInputCheck,
96  itkConceptMacro( InputOStreamWritableCheck,
98  // End concept checking
99 #endif
100 
105  itkSetMacro(BackgroundValue, OutputImagePixelType);
106  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
107 
112  itkSetMacro(ComputeFeretDiameter, bool);
113  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
114  itkBooleanMacro(ComputeFeretDiameter);
115 
120  itkSetMacro(ComputePerimeter, bool);
121  itkGetConstReferenceMacro(ComputePerimeter, bool);
122  itkBooleanMacro(ComputePerimeter);
123 
125  void SetFeatureImage(const TFeatureImage *input)
126  {
127  // Process object is not const-correct so the const casting is required.
128  this->SetNthInput( 1, const_cast< TFeatureImage * >( input ) );
129  }
130 
133  {
134  return static_cast< FeatureImageType * >( this->ProcessObject::GetInput(1) );
135  }
136 
138  void SetInput1(const InputImageType *input)
139  {
140  this->SetInput(input);
141  }
142 
144  void SetInput2(const FeatureImageType *input)
145  {
146  this->SetFeatureImage(input);
147  }
148 
155  itkSetMacro(ComputeHistogram, bool);
156  itkGetConstReferenceMacro(ComputeHistogram, bool);
157  itkBooleanMacro(ComputeHistogram);
158 
164  itkSetMacro(NumberOfBins, unsigned int);
165  itkGetConstReferenceMacro(NumberOfBins, unsigned int);
166 
167 protected:
170  void PrintSelf(std::ostream & os, Indent indent) const;
171 
176 
178  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
179 
182  void GenerateData();
183 
184 private:
185  LabelImageToStatisticsLabelMapFilter(const Self &); //purposely not
186  // implemented
187  void operator=(const Self &); //purposely not
188  // implemented
189 
193  unsigned int m_NumberOfBins;
195 }; // end of class
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
200 #endif
201 
202 #endif

Generated at Sat Mar 8 2014 15:02:21 for Orfeo Toolbox with doxygen 1.8.3.1