ITK  4.9.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 
41 template <class TInputImage, class TOutputImage=TInputImage>
43  public NoiseBaseImageFilter<TInputImage,TOutputImage >
44 {
45 public:
51 
53  itkNewMacro(Self);
54 
57 
63 
65  typedef TInputImage InputImageType;
66  typedef typename InputImageType::Pointer InputImagePointer;
67  typedef typename InputImageType::ConstPointer InputImageConstPointer;
68  typedef typename InputImageType::RegionType InputImageRegionType;
69  typedef typename InputImageType::PixelType InputImagePixelType;
70 
71  itkGetConstMacro(Probability, double);
72  itkSetMacro(Probability, double);
73 
74 #ifdef ITK_USE_CONCEPT_CHECKING
75 
76  itkConceptMacro(InputConvertibleToOutputCheck,
77  (Concept::Convertible<typename TInputImage::PixelType,
78  typename TOutputImage::PixelType>) );
79 
81 #endif
82 
83 protected:
86  }
87 
88  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
89 
90  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
91  ThreadIdType threadId ) ITK_OVERRIDE;
92 
93 private:
94  SaltAndPepperNoiseImageFilter(const Self&) ITK_DELETE_FUNCTION;
95  void operator=(const Self&) ITK_DELETE_FUNCTION;
96 
97  double m_Probability;
98 
99 };
100 
101 } // end namespace itk
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 #include "itkSaltAndPepperNoiseImageFilter.hxx"
105 #endif
106 
107 #endif
Superclass::OutputImagePointer OutputImagePointer
An Abstract Base class for Noise image filters.
Base class for all process objects that output image data.
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::OutputImageRegionType OutputImageRegionType
Superclass::OutputImagePixelType OutputImagePixelType
NoiseBaseImageFilter< TInputImage, TOutputImage > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Superclass::OutputImagePixelType OutputImagePixelType
Superclass::OutputImageRegionType OutputImageRegionType
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.
Superclass::OutputImageType OutputImageType