membrane_mask#

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

Creates a membrane mask consisting of two parallel disks with Gaussian leaflet intensity profiles.

The disk boundary uses soft_edge() (via soft_edge_width and method). The axial leaflet profiles are physical Gaussians controlled by thickness and are not affected by the soft-edge parameters. cutoff_sigma applies to both the disk edge and the leaflet profile truncation.

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.

cutoff_sigmafloat, optional

Truncation threshold in standard deviations, applied to both the disk soft edge and the leaflet height profile, defaults to 3.

soft_edge_widthfloat, optional

Soft-edge width in voxels for the disk boundary, defaults to 0.5.

methodstr, optional

Soft-edge method for disk boundary: "gaussian" (default) or "cosine".

Returns:
NDArray

The created membrane mask.

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)