bin2cell.get_mpp_coords

bin2cell.get_mpp_coords(adata, basis='spatial', spatial_key='spatial', mpp=None)

Get an mpp-adjusted representation of spatial or array coordinates of the provided object. Origin in top left, dimensions correspond to np.array() representation of image ([:,0] is up-down, [:,1] is left-right). The resulting coordinates are integers for ease of retrieval of labels from arrays or defining crops.

adataAnnData

2um bin VisiumHD object.

basisstr, optional (default: "spatial")

Whether to get "spatial" or "array" coordinates. The former is the source morphology image, the latter is a GEX-based grid representation.

spatial_keystr, optional (default: "spatial")

Only used with basis="spatial". Needs to be present in .obsm. Rounded coordinates will be used to represent each bin when retrieving labels.

mppfloat or None, optional (default: None)

The mpp value. Mandatory for GEX (basis="array"), if not provided with morphology (basis="spatial") will assume full scale image.