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
28namespace itk
29{
67template <typename TInputImage,
68 typename TOutputImage,
69 typename TKernel = FlatStructuringElement<TInputImage::ImageDimension>>
70class ITK_TEMPLATE_EXPORT RankImageFilter
71 : public MovingHistogramImageFilter<TInputImage,
72 TOutputImage,
73 TKernel,
74 Function::RankHistogram<typename TInputImage::PixelType>>
75{
76public:
77 ITK_DISALLOW_COPY_AND_MOVE(RankImageFilter);
78
84 TOutputImage,
85 TKernel,
87
89 itkNewMacro(Self);
90
92 itkOverrideGetNameOfClassMacro(RankImageFilter);
93
95 using InputImageType = TInputImage;
96 using OutputImageType = TOutputImage;
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
129protected:
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
139private:
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
typename TInputImage::RegionType RegionType
typename TInputImage::SizeType SizeType
typename TInputImage::PixelType InputPixelType
typename TInputImage::SizeType RadiusType
typename TInputImage::IndexType IndexType
typename TOutputImage::PixelType OutputPixelType
typename TInputImage::OffsetType OffsetType
Base class for all process objects that output image data.
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Implements a generic moving histogram algorithm.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Rank filter of a greyscale image.
void PrintSelf(std::ostream &os, Indent indent) const override
typename KernelType::ConstIterator KernelIteratorType
~RankImageFilter() override=default
bool GetUseVectorBasedAlgorithm() const
typename TInputImage::PixelType PixelType
void ConfigureHistogram(HistogramType &histogram) override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....