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_blur.RandomGaussianBlur(sigma: tuple[float, float] | tuple[float, float, float, float, float, float] = (0, 2), **kwargs)[source]

Bases: VolumeTransform

Blur a 3d volume using a Gaussian filter with random kernel size.

It handles a np.ndarray or torch.Tensor as input and returns a consistent output (same type and shape). Input shape must be (C, H, W, D) or (H, W, D) (spatial dimensions).

Parameters:

sigma : (float, float) or (float, float, float, float, float, float), default=(0, 2)

Range of the standard deviation \sigma of the Gaussian kernel applied to blur the volume. If two values (a,b) are provided, then \sigma \sim \mathcal{U}(a, b). If six values (a_1, b_1, a_2, b_2, a_3, b_3) are provided, then one standard deviation per spatial dimension is sampled \sigma_i \sim \mathcal{U}(a_i, b_i) for i=1,2,3.

kwargs : dict

Keyword arguments given to base nidl.transforms.Transform.

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

Blur the input with a Gaussian filter.

Parameters:

data : np.ndarray or torch.Tensor

Input volume with shape (C, H, W, D) or (H, W, D). Standard deviations in the Gaussian filter are equal across channels.

Returns:

data : np.ndarray or torch.Tensor

Blurred volume. Output type and shape are the same as input.

Follow us

© 2025, nidl developers