ITK  6.0.0
Insight Toolkit
itkMaskedRankImageFilter.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 itkMaskedRankImageFilter_h
19 #define itkMaskedRankImageFilter_h
20 
22 #include <list>
23 #include <map>
24 #include <set>
25 #include "itkRankHistogram.h"
27 
28 namespace itk
29 {
63 template <typename TInputImage,
64  typename TMaskImage,
65  typename TOutputImage,
66  typename TKernel = FlatStructuringElement<TInputImage::ImageDimension>>
67 class ITK_TEMPLATE_EXPORT MaskedRankImageFilter
68  : public MaskedMovingHistogramImageFilter<TInputImage,
69  TMaskImage,
70  TOutputImage,
71  TKernel,
72  Function::RankHistogram<typename TInputImage::PixelType>>
73 {
74 public:
75  ITK_DISALLOW_COPY_AND_MOVE(MaskedRankImageFilter);
76 
79  using Superclass = MaskedMovingHistogramImageFilter<TInputImage,
80  TMaskImage,
81  TOutputImage,
82  TKernel,
84 
87 
89  itkNewMacro(Self);
90 
92  itkOverrideGetNameOfClassMacro(MaskedRankImageFilter);
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:
131  ~MaskedRankImageFilter() 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 "itkMaskedRankImageFilter.hxx"
146 #endif
147 
148 #endif
itk::BoxImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkBoxImageFilter.h:67
itk::MaskedRankImageFilter::GetUseVectorBasedAlgorithm
bool GetUseVectorBasedAlgorithm() const
Definition: itkMaskedRankImageFilter.h:124
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
itkMaskedMovingHistogramImageFilter.h
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::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::MaskedMovingHistogramImageFilter
Definition: itkMaskedMovingHistogramImageFilter.h:43
itkFlatStructuringElement.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::MaskedRankImageFilter
Rank filter of a greyscale image.
Definition: itkMaskedRankImageFilter.h:67
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
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