ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkRankImageFilter.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 __itkRankImageFilter_h
19 #define __itkRankImageFilter_h
20 
22 #include <list>
23 #include <map>
24 #include <set>
25 #include "itkRankHistogram.h"
27 
28 namespace itk
29 {
66 template< class TInputImage, class TOutputImage, class TKernel =
67  FlatStructuringElement< TInputImage::ImageDimension > >
68 class ITK_EXPORT RankImageFilter:
69  public MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel,
70  Function::RankHistogram< typename TInputImage::PixelType > >
71 {
72 public:
77  typedef MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel,
79 
81  itkNewMacro(Self);
82 
84  itkTypeMacro(RankImageFilter,
86 
88  typedef TInputImage InputImageType;
89  typedef TOutputImage OutputImageType;
90  typedef typename TInputImage::RegionType RegionType;
91  typedef typename TInputImage::SizeType SizeType;
92  typedef typename TInputImage::IndexType IndexType;
93  typedef typename TInputImage::PixelType PixelType;
94  typedef typename TInputImage::OffsetType OffsetType;
95  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
96  typedef typename TOutputImage::PixelType OutputPixelType;
97  typedef typename TInputImage::PixelType InputPixelType;
98 
99  typedef typename Superclass::HistogramType HistogramType;
100 
102  itkStaticConstMacro(ImageDimension, unsigned int,
103  TInputImage::ImageDimension);
104 
106  typedef TKernel KernelType;
107 
109  typedef typename KernelType::ConstIterator KernelIteratorType;
110 
112  typedef typename KernelType::SizeType RadiusType;
113 
114  itkSetMacro(Rank, float)
115  itkGetConstMacro(Rank, float)
116 
117  bool GetUseVectorBasedAlgorithm()
118  {
119  return HistogramType::UseVectorBasedAlgorithm();
120  }
121 
122 protected:
123  RankImageFilter();
125 
126  void PrintSelf(std::ostream & os, Indent indent) const;
127 
128  virtual void ConfigureHistogram( HistogramType & histogram );
129 
130 private:
131  RankImageFilter(const Self &); //purposely not implemented
132  void operator=(const Self &); //purposely not implemented
133 
134  float m_Rank;
135 }; // end of class
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkRankImageFilter.hxx"
140 #endif
141 
142 #endif
143