Orfeo Toolbox  3.16
itkLabelStatisticsKeepNObjectsImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkLabelStatisticsKeepNObjectsImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-08-11 14:24:43 $
7  Version: $Revision: 1.4 $
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 __itkLabelStatisticsKeepNObjectsImageFilter_h
18 #define __itkLabelStatisticsKeepNObjectsImageFilter_h
19 
20 #include "itkImageToImageFilter.h"
22 #include "itkLabelMap.h"
27 
28 
29 namespace itk {
30 
47 template<class TInputImage, class TFeatureImage>
49  public ImageToImageFilter<TInputImage, TInputImage>
50 {
51 public:
57 
59  typedef TInputImage InputImageType;
60  typedef TInputImage OutputImageType;
61  typedef typename InputImageType::Pointer InputImagePointer;
62  typedef typename InputImageType::ConstPointer InputImageConstPointer;
63  typedef typename InputImageType::RegionType InputImageRegionType;
64  typedef typename InputImageType::PixelType InputImagePixelType;
65  typedef typename OutputImageType::Pointer OutputImagePointer;
66  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
67  typedef typename OutputImageType::RegionType OutputImageRegionType;
68  typedef typename OutputImageType::PixelType OutputImagePixelType;
69 
70  typedef TFeatureImage FeatureImageType;
71  typedef typename FeatureImageType::Pointer FeatureImagePointer;
72  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
73  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
74 
76  itkStaticConstMacro(InputImageDimension, unsigned int,
77  TInputImage::ImageDimension);
78  itkStaticConstMacro(OutputImageDimension, unsigned int,
79  TInputImage::ImageDimension);
80  itkStaticConstMacro(ImageDimension, unsigned int,
81  TInputImage::ImageDimension);
82 
90 
92  itkNewMacro(Self);
93 
97 
98 #ifdef ITK_USE_CONCEPT_CHECKING
99 
100  itkConceptMacro(InputEqualityComparableCheck,
102  itkConceptMacro(IntConvertibleToInputCheck,
104  itkConceptMacro(InputOStreamWritableCheck,
107 #endif
108 
113  itkSetMacro(BackgroundValue, OutputImagePixelType);
114  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
115 
119  itkGetConstMacro(NumberOfObjects, unsigned long);
120  itkSetMacro(NumberOfObjects, unsigned long);
121 
127  itkGetConstMacro( ReverseOrdering, bool );
128  itkSetMacro( ReverseOrdering, bool );
129  itkBooleanMacro( ReverseOrdering );
130 
135  itkGetConstMacro( Attribute, AttributeType );
136  itkSetMacro( Attribute, AttributeType );
137  void SetAttribute( const std::string & s )
138  {
139  this->SetAttribute( LabelObjectType::GetAttributeFromName( s ) );
140  }
141 
143  void SetFeatureImage(const TFeatureImage *input)
144  {
145  // Process object is not const-correct so the const casting is required.
146  this->SetNthInput( 1, const_cast<TFeatureImage *>(input) );
147  }
148 
150  const FeatureImageType * GetFeatureImage()
151  {
152  return static_cast<const FeatureImageType*>(this->ProcessObject::GetInput(1));
153  }
154 
156  void SetInput1(const InputImageType *input)
157  {
158  this->SetInput( input );
159  }
160 
162  void SetInput2(const FeatureImageType *input)
163  {
164  this->SetFeatureImage( input );
165  }
166 
167 
168 protected:
171  void PrintSelf(std::ostream& os, Indent indent) const;
172 
176  void GenerateInputRequestedRegion();
177 
179  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
180 
183  void GenerateData();
184 
185 private:
186  LabelStatisticsKeepNObjectsImageFilter(const Self&); //purposely not implemented
187  void operator=(const Self&); //purposely not implemented
188 
190  unsigned long m_NumberOfObjects;
193 }; // end of class
194 
195 } // end namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
199 #endif
200 
201 #endif

Generated at Sat Feb 2 2013 23:50:26 for Orfeo Toolbox with doxygen 1.8.1.1