elliptical_mask#

elliptical_mask(shape, radius, center=None, orientation=None)[source]#

Creates an ellipsoidal mask.

Parameters:
shapetuple of ints

Shape of the mask to be created.

radiustuple of floats

Radius of the mask.

centertuple of floats, optional

Center of the mask, default to shape // 2.

orientationNDArray, optional.

Orientation of the mask as rotation matrix with shape (d,d).

Returns:
NDArray

The created ellipsoidal mask.

Raises:
ValueError

If the length of center and radius is not one or the same as shape.

Examples

>>> from tme.matching_utils import elliptical_mask
>>> mask = elliptical_mask(shape=(20,20), radius=(5,5), center=(10,10))