bin2cell.get_crop

bin2cell.get_crop(adata, basis='spatial', spatial_key='spatial', mpp=None, buffer=0)

Get a PIL-formatted crop tuple from a provided object and coordinate representation.

Input

adataAnnData

2um bin VisiumHD object.

basisstr, optional (default: "spatial")

Whether to use "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 micron per pixel value to use. Mandatory for GEX (basis="array"), if not provided with morphology (basis="spatial") will assume full scale image.

bufferint, optional (default: 0)

How many extra pixels to include to each side the cropped grid for extra visualisation.