CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
560 stars 183 forks source link

Inaccurate description of addCTNoise function parameters #321

Closed leekunpeng closed 3 years ago

leekunpeng commented 3 years ago

Expected Behavior

image

The two parameters for adding Gaussian noise are the mean and the standard deviation, but in fact the variance is used in the program.

Actual Behavior

image

In fact, the standard deviation is not used, and the sigma parameter refers to the variance. I think you should modify this description。

Specifications

tsadakane commented 3 years ago

Indeed. As described in https://www.mathworks.com/help/images/ref/imnoise.html the imnoise function interprets the argument at the position as the variance of the output.

If the Image Processing Toolbox is not installed and the Statitics Toolbox is installed, https://github.com/CERN/TIGRE/blob/7e761f505e3c156a816d77fcc8570333a8ed528d/MATLAB/Utilities/addCTnoise.m#L102 is used. Is this line acceptable for you?

I have made a PR #320, which provides the random number generator that uses GPU (cuda). Your comment can be another reason to change the default implementation to cuda. Thank you!

AnderBiguri commented 3 years ago

Thanks for the report! I am away, but will try to verify this and the cuda PR when I am back and merge/fix it.

Thanks again.

AnderBiguri commented 3 years ago

Fixed via #320