Menu

Deep learning for NeuroImaging in Python.

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class nidl.volume.transforms.augmentation.intensity.random_noise.RandomGaussianNoise(mean: float | tuple[float, float] = 0.0, std: tuple[float, float] = (0.1, 1.0), **kwargs)[source]

Bases: VolumeTransform

Add Gaussian noise to input data with random parameters.

The input data can have any shape with type np.ndarray or torch.Tensor. The output has consistent type and shape with the input.

Parameters:

mean : float or (float, float), default=0.0

Mean \mu of the Gaussian distribution from which the noise is sampled. If two values (a, b) are given, then \mu \sim \mathcal{U}(a, b).

std : (float, float), default=(0.1, 1.0)

Range of the standard deviation (a, b) of the Gaussian distribution from which the noise is sampled \sigma \sim \mathcal{U}(a, b).

kwargs : dict

Keyword arguments given to base nidl.transforms.Transform.

apply_transform(data: ndarray | Tensor) ndarray | Tensor[source]

Add Gaussian noise to the input.

Parameters:

data : np.ndarray or torch.Tensor

The input volume.

Returns:

data : np.ndarray or torch.Tensor

Input with noise.

Follow us

© 2025, nidl developers