ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBinaryMedianImageFilter.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 itkBinaryMedianImageFilter_h
19 #define itkBinaryMedianImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
48 template< typename TInputImage, typename TOutputImage >
49 class ITK_TEMPLATE_EXPORT BinaryMedianImageFilter:
50  public ImageToImageFilter< TInputImage, TOutputImage >
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_ASSIGN(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 
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);
95 
98  itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
99  itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
101 
108  void GenerateInputRequestedRegion() override;
109 
110 #ifdef ITK_USE_CONCEPT_CHECKING
111  // Begin concept checking
112  itkConceptMacro( InputEqualityComparableCheck,
114  itkConceptMacro( InputConvertibleToOutputCheck,
115  ( Concept::Convertible< typename TInputImage::PixelType,
116  typename TOutputImage::PixelType > ) );
117  itkConceptMacro( SameDimensionCheck,
119  itkConceptMacro( InputOStreamWritableCheck,
121  // End concept checking
122 #endif
123 
124 protected:
126  ~BinaryMedianImageFilter() override = default;
127  void PrintSelf(std::ostream & os, Indent indent) const override;
128 
139  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
140 
141 
142 private:
144 
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkBinaryMedianImageFilter.hxx"
152 #endif
153 
154 #endif
typename InputImageType::PixelType InputPixelType
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 InputImageType::SizeType InputSizeType
Applies a version of the median filter optimized for binary images.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::PixelType OutputPixelType
typename InputImageType::RegionType InputImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)