[Insight-users] add noise

Luis Ibanez luis.ibanez at kitware.com
Fri May 12 09:14:38 EDT 2006


Hi Cecilia,

There is no currently a filter in ITK for adding Gaussian noise.

However you can easily put one together by combining the
following classes:

1) Insight/Code/BasicFilters/itkRandomImageSource.h
    Insight/Code/BasicFilters/itkRandomImageSource.txx

2) Insight/Code/Numerics/Statistics/itkNormalVariateGenerator.h
    Insight/Code/Numerics/Statistics/itkNormalVariateGenerator.cxx


The RandomImageSource is designed to generate an image with noise
following a Uniform distribution. You can replace the computation
of the uniform distribution by going to lines: 153-155 of the
itkRandomImageSource.txx and in there make calls to the Normal
VariateGenerator.


As a second option, you could simply take the values currently
generated from the uniform distribution, and pass them as argument
to an inverse erf() function, the values that are produced as output
will follow a Gaussian distribution.


You probably want to rename the resulting filter as a
GaussianNoiseSource, or something along those lines.

Once you get this filter working, you could simply use the AddImage
filter in order to combine your input image with the Gaussian noise
image that you obtain from this filter.


Do you need the random image to be reproducible ?
or do you want it to be different every time that you run the filter ?


Please let us know if you find any problems,


    Thanks


      Luis



=========================================
cecilia.zanella at studio.unibo.it wrote:
> Hi,
> I have to add (Gaussian) noise to a synthetic volume: is there an ITK filter 
> able to execute this task?
> Thank you all...
> 
> Cecilia
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 




More information about the Insight-users mailing list