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.volume_transform.VolumeTransform(p: float | None = None)[source]

Bases: Transform

Transformation applied to a 3d volume.

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

Checks if the input data shape is 3d or 4d.

Parameters:

data : np.ndarray or torch.Tensor

The input data with shape (C, H, W, D) or (H, W, D)

Returns:

np.ndarray or torch.Tensor

Data with type and shape checked.

Raises:

ValueError

If the input data is not numpy.ndarray or torch.Tensor or if the shape is not 3d or 4d.

Follow us

© 2025, nidl developers