Skip to content

Types

OneOrSeveral

A single scalar value or a sequence (list, tuple, ...) of scalar values

BoundType

There is a lack of standardization for bound names across packages. We mostly work with scipy's convention and/or with aliases that relate to the implicit boundary conditions in discrete transforms (Fourier, sine and cosine). We also accept less common aliases, although their use is discouraged

Fourier SciPy Other Description
"border" "nearest", "replicate", "repeat" a a | a b c d | d d
"constant" "zero", "zeros" 0 0 | a b c d | 0 0
"dft" "wrap" "circular", "circulant" c d | a b c d | a b
"dct1" "mirror" c b | a b c d | c b
"dct2" "reflect" b a | a b c d | d c
"dst1" "antimirror" -a 0 | a b c d | 0 -d
"dst2" "antireflect" -b -a | a b c d | -d -c

OrderType

Interpolation orders are integers in the range {0..7}

ExtrapolateType

Extrapolation can be a boolean or one of {'center', 'edge'}

  • True: use bound to extrapolate out-of-bound value
  • False or 'center': do not extrapolate values that fall outside of the centers of the first and last voxels.
  • 'edge': do not extrapolate values that fall outside of the edges of the first and last voxels.

AnchorType

What feature should be aligned across the input and output tensors.

  • If 'edge', align the exterior edges of the first and last voxels.
  • If 'center', align the centers of the first and last voxels.
  • If None, the center of the first voxel is aligned, and the requested factor is exactly applied.

If 'edge' or 'center', the effective scaling factor may slightly differ from the requested scaling factor.