orientation#

format_orientation(orientation, inverse=False, default=None)[source]#

Convert orientation to standard format.

Arguments

orientationtuple, str or None

The orientation specification.

inversebool

If True, invert orientation.

defaultobject

The default value if orientation is None;

Returns

orientationtuple of ints

The orientation sequence.

See also

orientation

invert_orientation(orientation)[source]#

Returns the inverse orientation taking axis inversions into account.

Arguments

orientationtuple, str or None

The orientation specification.

Returns

orientationtuple

The inverse orientation sequence.

See also

orientation

orient(data, orientation, inverse=False)[source]#

Orients a data array according to the given orientation.

Arguments

dataarray or Source

The data to orient.

orientationtuple or str

The orientation specification.

inversebool

If True, invert the orientation.

Returns

orientedarray

The oriented data array.

See also

orientation

orient_points(points, orientation, shape=None, inverse=False)[source]#

Orients an array of coordinates according to the given orientation.

Arguments

pointsarray or Source

The data points to orient, as nxd array where d is dimension.

orientationtuple or str

The orientation specification.

shapetuple

The shape of the data array before reorientation needed in case some axes are reversed.

inversebool

If True, invert the orientation.

Returns

orientedarray

The oriented data array.

orient_resolution(resolution, orientation, inverse=False)[source]#

Permutes a resolution tuple according to the given orientation.

Arguments

resolutiontuple

The resolution specification.

orientationtuple or str

The orientation specification.

inversebool

If True, invert the orientation.

Returns

resolutiontuple

The re-oriented resolution sequence.

See also

orientation

orient_shape(shape, orientation, inverse=False)[source]#

Permutes a shape according to the given orientation.

Arguments

shapetuple

The shape specification.

orientationtuple or str

The orientation specification.

inversebool

If True, invert the orientation.

Returns

shapetuple

The oriented shape tuple.

See also

orientation

orientation_to_transposition(orientation, inverse=False)[source]#

Extracts the transposition permutation from an orientation.

Arguments

orientationtuple or str

The orientation specification.

inversebool

If True, return inverse permutation.

Returns

permutationtuple of ints

The permutation sequence.

See also

orientation