Alter an image with shot noise.
The shot noise follows a Poisson distribution:
- \( I = N(I_0) \)
- where \( N(I_0) \) is a Poisson-distributed random variable of mean \( I_0 \) . The noise is thus dependent on the pixel intensities in the image.
The intensities in the image can be scaled by a user provided value to map pixel values to the actual number of particles. The scaling can be seen as the inverse of the gain used during the acquisition. The noisy signal is then scaled back to its input intensity range:
- \( I = \frac{N(I_0 \times s)}{s} \)
- where \( s \) is the scale factor.
The Poisson-distributed variable \( \lambda \) is computed by using the algorithm:
- \( \begin{array}{l} k \leftarrow 0 \\ p \leftarrow 1 \\ \textbf{repeat} \\ \left\{ \begin{array}{l} k \leftarrow k+1 \\ p \leftarrow p \ast U() \end{array} \right. \\ \textbf{until } p > e^{\lambda} \\ \textbf{return} (k) \end{array} \)
- where \( U() \) provides a uniformly distributed random variable in the interval \( [0,1] \) .
This algorithm is very inefficient for large values of \( \lambda \) , though. Fortunately, the Poisson distribution can be accurately approximated by a Gaussian distribution of mean and variance \( \lambda \) when \( \lambda \) is large enough. In this implementation, this value is considered to be 50. This leads to the faster algorithm:
- \( \lambda + \sqrt{\lambda} \times N()\)
- where \( N() \) is a normally distributed random variable of mean 0 and variance 1.
- Author
- Gaetan Lehmann
This code was contributed in the Insight Journal paper "Noise
Simulation". https://doi.org/10.54294/vh6vbw
- See also
- itk::simple::ShotNoise for the procedural interface
-
itk::ShotNoiseImageFilter for the Doxygen on the original ITK class.
Definition at line 85 of file sitkShotNoiseImageFilter.h.
|
static bool | GetGlobalDefaultDebug () |
|
static void | GlobalDefaultDebugOff () |
|
static void | GlobalDefaultDebugOn () |
|
static void | SetGlobalDefaultDebug (bool debugFlag) |
|
static void | GlobalWarningDisplayOn () |
|
static void | GlobalWarningDisplayOff () |
|
static void | SetGlobalWarningDisplay (bool flag) |
|
static bool | GetGlobalWarningDisplay () |
|
static double | GetGlobalDefaultCoordinateTolerance () |
| Access the global tolerance to determine congruent spaces. More...
|
|
static void | SetGlobalDefaultCoordinateTolerance (double) |
| Access the global tolerance to determine congruent spaces. More...
|
|
static double | GetGlobalDefaultDirectionTolerance () |
| Access the global tolerance to determine congruent spaces. More...
|
|
static void | SetGlobalDefaultDirectionTolerance (double) |
| Access the global tolerance to determine congruent spaces. More...
|
|
static bool | SetGlobalDefaultThreader (const std::string &threader) |
| Set/Get the default threader used for process objects. More...
|
|
static std::string | GetGlobalDefaultThreader () |
| Set/Get the default threader used for process objects. More...
|
|
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
|
static unsigned int | GetGlobalDefaultNumberOfThreads () |
| Set/Get the default threader used for process objects. More...
|
|
void | CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name) |
|
void | CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name) |
|
void | CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name) |
|
virtual unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) |
|
virtual itk::ProcessObject * | GetActiveProcess () |
|
virtual void | OnActiveProcessDelete () |
|
virtual void | onCommandDelete (const itk::simple::Command *cmd) noexcept |
|
virtual void | PreUpdate (itk::ProcessObject *p) |
|
virtual void | RemoveITKObserver (EventCommand &e) |
|
| NonCopyable ()=default |
|
| NonCopyable (const NonCopyable &)=delete |
|
NonCopyable & | operator= (const NonCopyable &)=delete |
|
template<class TImageType > |
static void | FixNonZeroIndex (TImageType *img) |
|
template<class TImageType > |
static TImageType::ConstPointer | CastImageToITK (const Image &img) |
|
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> |
static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
|
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector> |
static Image | CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img) |
|
template<class TImageType > |
static Image | CastITKToImage (TImageType *img) |
|
static const itk::EventObject & | GetITKEventObject (EventEnum e) |
|
template<typename T > |
static std::ostream & | ToStringHelper (std::ostream &os, const T &v) |
|
static std::ostream & | ToStringHelper (std::ostream &os, const char &v) |
|
static std::ostream & | ToStringHelper (std::ostream &os, const signed char &v) |
|
static std::ostream & | ToStringHelper (std::ostream &os, const unsigned char &v) |
|