Skip to content

Commit

Permalink
Merge branch 'master' of ssh://phabricator.mitk.org:2222/source/dldabg
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianIsensee committed Oct 18, 2021
2 parents 419df7f + 57f7758 commit 0423445
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion batchgenerators/augmentations/noise_augmentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def augment_gaussian_noise(data_sample: np.ndarray, noise_variance: Tuple[float,
variance_here = variance if variance is not None else \
noise_variance[0] if noise_variance[0] == noise_variance[1] else \
random.uniform(noise_variance[0], noise_variance[1])
data_sample = data_sample + np.random.normal(0.0, variance_here, size=data_sample.shape)
# bug fixed: https://github.com/MIC-DKFZ/batchgenerators/issues/86
data_sample[c] = data_sample[c] + np.random.normal(0.0, variance_here, size=data_sample[c].shape)
return data_sample


Expand Down
5 changes: 3 additions & 2 deletions batchgenerators/utilities/custom_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Union, Tuple, Callable, Any
from typing import Union, Tuple, Any, Callable
import numpy as np

ScalarType = Union[Union[int, float], Tuple[float, float], Callable[[Any, ...], Union[float, int]]]

ScalarType = Union[Union[int, float], Tuple[float, float], Callable[..., Union[int, float]]]


def sample_scalar(scalar_type: ScalarType, *args):
Expand Down

0 comments on commit 0423445

Please sign in to comment.