membrane_mask#

membrane_mask(shape, radius, thickness, separation, symmetry_axis=2, center=None, sigma_decay=0.5, cutoff_sigma=3, **kwargs)[source]#

Creates a membrane mask consisting of two parallel disks with Gaussian intensity profile. Uses efficient broadcasting approach: flat disk mask × height profile.

Parameters:
shapetuple of ints

Shape of the mask to be created.

radiusfloat

Radius of the membrane disks.

thicknessfloat

Thickness of each disk in the membrane.

separationfloat

Distance between the centers of the two disks.

symmetry_axisint, optional

The axis perpendicular to the membrane disks, defaults to 2.

centertuple of floats, optional

Center of the membrane (midpoint between the two disks), defaults to shape // 2.

sigma_decayfloat, optional

Controls edge sharpness relative to radius, defaults to 0.5.

cutoff_sigmafloat, optional

Cutoff for height profile in standard deviations, defaults to 3.

Returns:
NDArray

The created membrane mask with Gaussian intensity profile.

Raises:
ValueError

If thickness is negative. If separation is negative. If center and shape do not have the same length. If symmetry_axis is out of bounds.

Examples

>>> from tme.matching_utils import membrane_mask
>>> mask = membrane_mask(shape=(50,50,50), radius=10, thickness=2, separation=15)