ITK  5.0.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 {
68 template< typename TInputImage, typename TOutputImage, typename TKernel =
69  FlatStructuringElement< TInputImage::ImageDimension > >
70 class ITK_TEMPLATE_EXPORT RankImageFilter:
71  public MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel,
72  Function::RankHistogram< typename TInputImage::PixelType > >
73 {
74 public:
75  ITK_DISALLOW_COPY_AND_ASSIGN(RankImageFilter);
76 
81  using Superclass = MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel,
83 
85  itkNewMacro(Self);
86 
88  itkTypeMacro(RankImageFilter,
90 
92  using InputImageType = TInputImage;
93  using OutputImageType = TOutputImage;
95  using SizeType = typename TInputImage::SizeType;
97  using PixelType = typename TInputImage::PixelType;
98  using OffsetType = typename TInputImage::OffsetType;
99  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
100  using OutputPixelType = typename TOutputImage::PixelType;
101  using InputPixelType = typename TInputImage::PixelType;
102 
103  using HistogramType = typename Superclass::HistogramType;
104 
106  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
107 
109  using KernelType = TKernel;
110 
112  using KernelIteratorType = typename KernelType::ConstIterator;
113 
116 
117  itkSetClampMacro(Rank, float, 0.0, 1.0);
118  itkGetConstMacro(Rank, float)
119 
120  bool GetUseVectorBasedAlgorithm() const
121  {
122  return HistogramType::UseVectorBasedAlgorithm();
123  }
124 
125 protected:
126  RankImageFilter();
127  ~RankImageFilter() override = default;
128 
129  void PrintSelf(std::ostream & os, Indent indent) const override;
130 
131  void ConfigureHistogram( HistogramType & histogram ) override;
132 
133 private:
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
typename TInputImage::SizeType RadiusType
typename Superclass::HistogramType HistogramType
Rank filter of a greyscale image.
typename TInputImage::IndexType IndexType
Implements a generic moving histogram algorithm.
typename TOutputImage::PixelType OutputPixelType
typename TInputImage::RegionType RegionType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TInputImage::OffsetType OffsetType
typename KernelType::ConstIterator KernelIteratorType
typename OutputImageType::RegionType OutputImageRegionType
typename TInputImage::SizeType SizeType
TOutputImage OutputImageType
typename TInputImage::PixelType InputPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49