medpy.features.intensity.centerdistance_xdminus1#

medpy.features.intensity.centerdistance_xdminus1(image, dim, voxelspacing=None, mask=slice(None, None, None))[source]#

Implementation of centerdistance that allows to compute sub-volume wise centerdistances.

The same notes as for centerdistance apply.

Parameters:
imagearray_like or list/tuple of array_like

A single image or a list/tuple of images (for multi-spectral case).

dimint or sequence of ints

The dimension or dimensions along which to cut the image into sub-volumes.

voxelspacingsequence of floats

The side-length of each voxel.

maskarray_like

A binary mask for the image.

Returns:
centerdistance_xdminus1ndarray

The distance of each voxel to the images center in the supplied dimensions.

Raises:
ArgumentError

If a invalid dim index of number of dim indices were supplied

Examples

Considering a 3D medical image we want to compute the axial slice-wise centerdistances instead of the ones over the complete image volume. Assuming that the third image dimension corresponds to the axial axes of the image, we call

>>> centerdistance_xdminus1(image, 2)

Note that the centerdistance of each slice will be equal.