Skip to content

cornucopia.io

ToTensorTransform

ToTensorTransform(dim=None, dtype=None, device=None, **kwargs)

Bases: FinalTransform

Convert to Tensor (or to other dtype/device)

Parameters:

Name Type Description Default
dtype dtype
None
device device
None

LoadTransform

LoadTransform(ndim=None, dtype=None, *, device=None, returns=None, append=False, include=None, exclude=None, **kwargs)

Bases: FinalTransform

Load data from disk

Parameters:

Name Type Description Default
ndim int

Number of spatial dimensions (default: guess from file)

None
dtype str or dtype

Data type (default: guess from file)

None
device str or device

Device on which to load data (default: cpu)

None

Other Parameters:

Name Type Description
to_ras bool

Reorient data so that it has a RAS layout. Only used by Babel reader.

rot90 bool

Rotate by 90 degrees in-plane. Only used by Pillow reader.

field str

Field to load from a npz file. Only used by Numpy reader.