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
- adata
AnnData 2um bin VisiumHD object.
- basis
str, 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_key
str, 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.- mpp
floatorNone, 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.- buffer
int, optional (default: 0) How many extra pixels to include to each side the cropped grid for extra visualisation.
- adata