Note

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

nidl.transforms.VolumeTransform

class nidl.transforms.VolumeTransform(p=None)[source]

Bases: Transform

Transformation applied to a 3d volume.

parse_data(data)[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.