ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkSaltAndPepperNoiseImageFilter.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
19#ifndef itkSaltAndPepperNoiseImageFilter_h
20#define itkSaltAndPepperNoiseImageFilter_h
21
23
24namespace itk
25{
26
66template <class TInputImage, class TOutputImage = TInputImage>
67class ITK_TEMPLATE_EXPORT SaltAndPepperNoiseImageFilter : public NoiseBaseImageFilter<TInputImage, TOutputImage>
68{
69public:
70 ITK_DISALLOW_COPY_AND_MOVE(SaltAndPepperNoiseImageFilter);
72
78
80 itkNewMacro(Self);
81
83 itkOverrideGetNameOfClassMacro(SaltAndPepperNoiseImageFilter);
84
86 using typename Superclass::OutputImageType;
87 using typename Superclass::OutputImagePointer;
90
92 using InputImageType = TInputImage;
93 using InputImagePointer = typename InputImageType::Pointer;
94 using InputImageConstPointer = typename InputImageType::ConstPointer;
95 using InputImageRegionType = typename InputImageType::RegionType;
96 using InputImagePixelType = typename InputImageType::PixelType;
97
100 itkGetConstMacro(Probability, double);
101 itkSetMacro(Probability, double);
103
106 itkSetMacro(SaltValue, OutputImagePixelType);
107 itkGetConstMacro(SaltValue, OutputImagePixelType);
109
110
113 itkSetMacro(PepperValue, OutputImagePixelType);
114 itkGetConstMacro(PepperValue, OutputImagePixelType);
116
117
118 itkConceptMacro(InputConvertibleToOutputCheck,
120
121protected:
123 ~SaltAndPepperNoiseImageFilter() override = default;
124
125 void
126 PrintSelf(std::ostream & os, Indent indent) const override;
127
128 void
129 ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
130
131private:
132 double m_Probability{ 0.01 };
135};
136} // end namespace itk
137
138#ifndef ITK_MANUAL_INSTANTIATION
139# include "itkSaltAndPepperNoiseImageFilter.hxx"
140#endif
141
142#endif
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition itkIndent.h:50
typename OutputImageType::PixelType OutputImagePixelType
NoiseBaseImageFilter< TInputImage, TOutputImage > Superclass
typename InputImageType::ConstPointer InputImageConstPointer
typename OutputImageType::PixelType OutputImagePixelType
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
~SaltAndPepperNoiseImageFilter() override=default
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::RegionType InputImageRegionType
void PrintSelf(std::ostream &os, Indent indent) const override
typename InputImageType::Pointer InputImagePointer
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType