ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSaltAndPepperNoiseImageFilter.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 
19 #ifndef itkSaltAndPepperNoiseImageFilter_h
20 #define itkSaltAndPepperNoiseImageFilter_h
21 
23 
24 namespace itk
25 {
26 
59 template <class TInputImage, class TOutputImage=TInputImage>
60 class ITK_TEMPLATE_EXPORT SaltAndPepperNoiseImageFilter :
61  public NoiseBaseImageFilter<TInputImage,TOutputImage >
62 {
63 public:
69 
71  itkNewMacro(Self);
72 
75 
77  typedef typename Superclass::OutputImageType OutputImageType;
78  typedef typename Superclass::OutputImagePointer OutputImagePointer;
79  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
80  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
81 
83  typedef TInputImage InputImageType;
84  typedef typename InputImageType::Pointer InputImagePointer;
85  typedef typename InputImageType::ConstPointer InputImageConstPointer;
86  typedef typename InputImageType::RegionType InputImageRegionType;
87  typedef typename InputImageType::PixelType InputImagePixelType;
88 
91  itkGetConstMacro(Probability, double);
92  itkSetMacro(Probability, double);
94 
95 #ifdef ITK_USE_CONCEPT_CHECKING
96 
97  itkConceptMacro(InputConvertibleToOutputCheck,
98  (Concept::Convertible<typename TInputImage::PixelType,
99  typename TOutputImage::PixelType>) );
100 
102 #endif
103 
104 protected:
106  virtual ~SaltAndPepperNoiseImageFilter() ITK_OVERRIDE {}
107 
108  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
109 
110  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
111  ThreadIdType threadId ) ITK_OVERRIDE;
112 
113 private:
114  ITK_DISALLOW_COPY_AND_ASSIGN(SaltAndPepperNoiseImageFilter);
115 
116  double m_Probability;
117 
118 };
119 } // end namespace itk
120 
121 #ifndef ITK_MANUAL_INSTANTIATION
122 #include "itkSaltAndPepperNoiseImageFilter.hxx"
123 #endif
124 
125 #endif
An Abstract Base class for Noise image filters.
Base class for all process objects that output image data.
Superclass::OutputImageRegionType OutputImageRegionType
NoiseBaseImageFilter< TInputImage, TOutputImage > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Superclass::OutputImagePixelType OutputImagePixelType
Superclass::OutputImagePointer OutputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
Alter an image with fixed value impulse noise, often called salt and pepper noise.