ITK  6.0.0
Insight Toolkit
itkRankImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 {
67 template <typename TInputImage,
68  typename TOutputImage,
69  typename TKernel = FlatStructuringElement<TInputImage::ImageDimension>>
70 class ITK_TEMPLATE_EXPORT RankImageFilter
71  : public MovingHistogramImageFilter<TInputImage,
72  TOutputImage,
73  TKernel,
74  Function::RankHistogram<typename TInputImage::PixelType>>
75 {
76 public:
77  ITK_DISALLOW_COPY_AND_MOVE(RankImageFilter);
78 
83  using Superclass = MovingHistogramImageFilter<TInputImage,
84  TOutputImage,
85  TKernel,
87 
89  itkNewMacro(Self);
90 
92  itkOverrideGetNameOfClassMacro(RankImageFilter);
93 
95  using InputImageType = TInputImage;
96  using OutputImageType = TOutputImage;
98  using SizeType = typename TInputImage::SizeType;
100  using PixelType = typename TInputImage::PixelType;
101  using OffsetType = typename TInputImage::OffsetType;
102  using typename Superclass::OutputImageRegionType;
103  using OutputPixelType = typename TOutputImage::PixelType;
104  using InputPixelType = typename TInputImage::PixelType;
105 
106  using typename Superclass::HistogramType;
107 
109  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
110 
112  using KernelType = TKernel;
113 
115  using KernelIteratorType = typename KernelType::ConstIterator;
116 
119 
120  itkSetClampMacro(Rank, float, 0.0, 1.0);
121  itkGetConstMacro(Rank, float);
122 
123  bool
125  {
126  return HistogramType::UseVectorBasedAlgorithm();
127  }
128 
129 protected:
130  RankImageFilter();
131  ~RankImageFilter() override = default;
132 
133  void
134  PrintSelf(std::ostream & os, Indent indent) const override;
135 
136  void
137  ConfigureHistogram(HistogramType & histogram) override;
138 
139 private:
140  float m_Rank{};
141 }; // end of class
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 # include "itkRankImageFilter.hxx"
146 #endif
147 
148 #endif
itk::RankImageFilter
Rank filter of a greyscale image.
Definition: itkRankImageFilter.h:70
itk::BoxImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkBoxImageFilter.h:67
itk::MovingHistogramImageFilterBase::KernelIteratorType
typename KernelType::ConstIterator KernelIteratorType
Definition: itkMovingHistogramImageFilterBase.h:126
itkRankHistogram.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BoxImageFilter::RadiusType
typename TInputImage::SizeType RadiusType
Definition: itkBoxImageFilter.h:73
itk::BoxImageFilter::OffsetType
typename TInputImage::OffsetType OffsetType
Definition: itkBoxImageFilter.h:62
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::BoxImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkBoxImageFilter.h:64
itk::BoxImageFilter::IndexType
typename TInputImage::IndexType IndexType
Definition: itkBoxImageFilter.h:61
itk::MovingHistogramImageFilterBase::PixelType
typename TInputImage::PixelType PixelType
Definition: itkMovingHistogramImageFilterBase.h:114
itk::RankImageFilter::GetUseVectorBasedAlgorithm
bool GetUseVectorBasedAlgorithm() const
Definition: itkRankImageFilter.h:124
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::MovingHistogramImageFilter
Implements a generic moving histogram algorithm.
Definition: itkMovingHistogramImageFilter.h:88
itkFlatStructuringElement.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::KernelImageFilter::KernelType
TKernel KernelType
Definition: itkKernelImageFilter.h:71
itk::Function::RankHistogram
Definition: itkRankHistogram.h:51
itkMovingHistogramImageFilter.h
itk::BoxImageFilter::SizeType
typename TInputImage::SizeType SizeType
Definition: itkBoxImageFilter.h:60
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::BoxImageFilter::RegionType
typename TInputImage::RegionType RegionType
Definition: itkBoxImageFilter.h:59