Orfeo Toolbox  4.0
itkLabelStatisticsKeepNObjectsImageFilter.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 __itkLabelStatisticsKeepNObjectsImageFilter_h
19 #define __itkLabelStatisticsKeepNObjectsImageFilter_h
20 
25 
26 namespace itk
27 {
45 template< typename TInputImage, typename TFeatureImage >
47  public ImageToImageFilter< TInputImage, TInputImage >
48 {
49 public:
55 
57  typedef TInputImage InputImageType;
58  typedef TInputImage OutputImageType;
59  typedef typename InputImageType::Pointer InputImagePointer;
60  typedef typename InputImageType::ConstPointer InputImageConstPointer;
61  typedef typename InputImageType::RegionType InputImageRegionType;
62  typedef typename InputImageType::PixelType InputImagePixelType;
63  typedef typename OutputImageType::Pointer OutputImagePointer;
64  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
65  typedef typename OutputImageType::RegionType OutputImageRegionType;
66  typedef typename OutputImageType::PixelType OutputImagePixelType;
67 
68  typedef TFeatureImage FeatureImageType;
69  typedef typename FeatureImageType::Pointer FeatureImagePointer;
70  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
71  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
72 
74  itkStaticConstMacro(InputImageDimension, unsigned int,
75  TInputImage::ImageDimension);
76  itkStaticConstMacro(OutputImageDimension, unsigned int,
77  TInputImage::ImageDimension);
78  itkStaticConstMacro(ImageDimension, unsigned int,
79  TInputImage::ImageDimension);
80 
88 
90  itkNewMacro(Self);
91 
95 
96 #ifdef ITK_USE_CONCEPT_CHECKING
97  // Begin concept checking
98  itkConceptMacro( InputEqualityComparableCheck,
100  itkConceptMacro( IntConvertibleToInputCheck,
102  itkConceptMacro( InputOStreamWritableCheck,
104  // End concept checking
105 #endif
106 
111  itkSetMacro(BackgroundValue, OutputImagePixelType);
112  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
113 
117  itkGetConstMacro(NumberOfObjects, SizeValueType);
118  itkSetMacro(NumberOfObjects, SizeValueType);
119 
125  itkGetConstMacro(ReverseOrdering, bool);
126  itkSetMacro(ReverseOrdering, bool);
127  itkBooleanMacro(ReverseOrdering);
128 
133  itkGetConstMacro(Attribute, AttributeType);
134  itkSetMacro(Attribute, AttributeType);
135  void SetAttribute(const std::string & s)
136  {
138  }
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 
165 protected:
168  void PrintSelf(std::ostream & os, Indent indent) const;
169 
174 
176  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
177 
180  void GenerateData();
181 
182 private:
183  LabelStatisticsKeepNObjectsImageFilter(const Self &); //purposely not
184  // implemented
185  void operator=(const Self &); //purposely not
186  // implemented
187 
192 }; // end of class
193 } // end namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
197 #endif
198 
199 #endif

Generated at Sat Mar 8 2014 15:05:52 for Orfeo Toolbox with doxygen 1.8.3.1