Class SaltAndPepperNoiseImageFilter

java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.SaltAndPepperNoiseImageFilter

public class SaltAndPepperNoiseImageFilter extends ImageFilter
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
  • 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

      protected static long getCPtr(SaltAndPepperNoiseImageFilter obj)
    • swigRelease

      protected static long swigRelease(SaltAndPepperNoiseImageFilter obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageFilter
    • delete

      public void delete()
      virtual itk::simple::SaltAndPepperNoiseImageFilter::~SaltAndPepperNoiseImageFilter() Destructor
      Overrides:
      delete in class ImageFilter
    • 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

      public String getName()
      std::string itk::simple::SaltAndPepperNoiseImageFilter::GetName() const Name of this class
      Overrides:
      getName in class ProcessObject
    • toString

      public String toString()
      std::string itk::simple::SaltAndPepperNoiseImageFilter::ToString() const Print ourselves out
      Overrides:
      toString in class ProcessObject
    • execute

      public Image execute(Image image1)
      Image itk::simple::SaltAndPepperNoiseImageFilter::Execute(Image &&image1) Execute the filter on the input image