ITK  5.4.0
Insight Toolkit
itkBinaryMedianImageFilter.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 itkBinaryMedianImageFilter_h
19 #define itkBinaryMedianImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
49 template <typename TInputImage, typename TOutputImage>
50 class ITK_TEMPLATE_EXPORT BinaryMedianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_MOVE(BinaryMedianImageFilter);
54 
56  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
57  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
58 
60  using InputImageType = TInputImage;
61  using OutputImageType = TOutputImage;
62 
68 
70  itkNewMacro(Self);
71 
73  itkOverrideGetNameOfClassMacro(BinaryMedianImageFilter);
74 
76  using InputPixelType = typename InputImageType::PixelType;
77  using OutputPixelType = typename OutputImageType::PixelType;
78 
81 
83 
85  itkSetMacro(Radius, InputSizeType);
86 
88  itkGetConstReferenceMacro(Radius, InputSizeType);
89 
92  itkSetMacro(BackgroundValue, InputPixelType);
93  itkSetMacro(ForegroundValue, InputPixelType);
98  itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
99  itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
108  void
109  GenerateInputRequestedRegion() override;
110 
111 #ifdef ITK_USE_CONCEPT_CHECKING
112  // Begin concept checking
114  itkConceptMacro(InputConvertibleToOutputCheck,
118  // End concept checking
119 #endif
120 
121 protected:
123  ~BinaryMedianImageFilter() override = default;
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override;
126 
137  void
138  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
139 
140 
141 private:
142  InputSizeType m_Radius{};
143 
144  InputPixelType m_ForegroundValue{};
145  InputPixelType m_BackgroundValue{};
146 };
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 # include "itkBinaryMedianImageFilter.hxx"
151 #endif
152 
153 #endif
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::BinaryMedianImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkBinaryMedianImageFilter.h:82
itk::BinaryMedianImageFilter
Applies a version of the median filter optimized for binary images.
Definition: itkBinaryMedianImageFilter.h:50
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::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::BinaryMedianImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkBinaryMedianImageFilter.h:76
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
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::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::BinaryMedianImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkBinaryMedianImageFilter.h:77