Package org.itk.simple
Class SaltAndPepperNoiseImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.SaltAndPepperNoiseImageFilter
Alter an image with fixed value impulse noise, often called salt and
pepper noise.
Salt (sensor saturation) and pepper (dead pixels) noise is a special
kind of impulse noise where the value of the noise is either the
maximum possible value in the image or its minimum. This is not
necessarily the maximal/minimal possible intensity value based on the
pixel type. For example, the native pixel type for CT is a signed 16
bit integer, but only 12 bits used, so we would like to set the salt
and pepper values to match this smaller intensity range and not the
range the pixel type represents. It can be modeled as:
$ I = \\begin{cases} M, & \\quad \\text{if } U < p/2
\\\\ m, & \\quad \\text{if } U > 1 - p/2 \\\\ I_0,
& \\quad \\text{if } p/2 \\geq U \\leq 1 - p/2
\\end{cases} $
where $ p $ is the probability of the noise event, $ U $ is a uniformly distributed random variable in the $ [0,1] $ range, $ M $ is the greatest possible pixel value, and $ m $ the smallest possible pixel value.
Pixel alteration occurs at a user defined probability. Salt and
pepper pixels are equally distributed.
Gaetan Lehmann
This code was contributed in the Insight Journal paper "Noise
Simulation". https://www.insight-journal.org/browse/publication/721
See:
itk::simple::SaltAndPepperNoise for the procedural interface
itk::SaltAndPepperNoiseImageFilter for the Doxygen on the original ITK class.
C++ includes: sitkSaltAndPepperNoiseImageFilter.h
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::SaltAndPepperNoiseImageFilter::SaltAndPepperNoiseImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
SaltAndPepperNoiseImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::SaltAndPepperNoiseImageFilter::~SaltAndPepperNoiseImageFilter() DestructorImage itk::simple::SaltAndPepperNoiseImageFilter::Execute(Image &&image1) Execute the filter on the input imageprotected void
finalize()
protected static long
getName()
std::string itk::simple::SaltAndPepperNoiseImageFilter::GetName() const Name of this classdouble
double itk::simple::SaltAndPepperNoiseImageFilter::GetProbability() const Set/Get the probability of the salt and pepper noise event.long
getSeed()
uint32_t itk::simple::SaltAndPepperNoiseImageFilter::GetSeed() constvoid
setProbability
(double Probability) Self& itk::simple::SaltAndPepperNoiseImageFilter::SetProbability(double Probability) Set/Get the probability of the salt and pepper noise event.void
setSeed
(long Seed) Self& itk::simple::SaltAndPepperNoiseImageFilter::SetSeed(uint32_t Seed)protected static long
toString()
std::string itk::simple::SaltAndPepperNoiseImageFilter::ToString() const Print ourselves outMethods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
Constructor Details
-
SaltAndPepperNoiseImageFilter
protected SaltAndPepperNoiseImageFilter(long cPtr, boolean cMemoryOwn) -
SaltAndPepperNoiseImageFilter
public SaltAndPepperNoiseImageFilter()itk::simple::SaltAndPepperNoiseImageFilter::SaltAndPepperNoiseImageFilter() Default Constructor that takes no arguments and initializes default parameters
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::SaltAndPepperNoiseImageFilter::~SaltAndPepperNoiseImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setProbability
public void setProbability(double Probability) Self& itk::simple::SaltAndPepperNoiseImageFilter::SetProbability(double Probability) Set/Get the probability of the salt and pepper noise event. Defaults to 0.01. -
getProbability
public double getProbability()double itk::simple::SaltAndPepperNoiseImageFilter::GetProbability() const Set/Get the probability of the salt and pepper noise event. Defaults to 0.01. -
setSeed
public void setSeed(long Seed) Self& itk::simple::SaltAndPepperNoiseImageFilter::SetSeed(uint32_t Seed) -
getSeed
public long getSeed()uint32_t itk::simple::SaltAndPepperNoiseImageFilter::GetSeed() const -
getName
std::string itk::simple::SaltAndPepperNoiseImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::SaltAndPepperNoiseImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::SaltAndPepperNoiseImageFilter::Execute(Image &&image1) Execute the filter on the input image
-