MIC-DKFZ / batchgenerators

A framework for data augmentation for 2D and 3D image classification and segmentation
Apache License 2.0
1.09k stars 221 forks source link

Guassian noise is applied to all channels rather than individual channel? #86

Closed aritche closed 3 years ago

aritche commented 3 years ago

https://github.com/MIC-DKFZ/batchgenerators/blob/5209f923e81386fcf51b17e4bca717a087d7824a/batchgenerators/augmentations/noise_augmentations.py#L46

Hi, In line 46 of augmentations > nosie_augmentations.py, I am wondering if I am misunderstanding or if there is a bug. The loop on line 40 iterates over the channels of the image, but when the noise is actually added to the data, it is applied to the entire data rather than the specific channel that is currently being iterated? I would expect the above linked line to have some reference to variable 'c' which is being iterated

FabianIsensee commented 3 years ago

it's a bug, good find! I fixed it. Thanks!