bin2cell.scaled_he_image
- bin2cell.scaled_he_image(adata, mpp=1, crop=True, buffer=150, spatial_cropped_key=None, store=True, img_key=None, save_path=None)
Create a custom microns per pixel render of the full scale H&E image for visualisation and downstream application. Store resulting image and its corresponding size factor in the object. If cropping to just the spatial grid, also store the cropped spatial coordinates. Optionally save to file.
Input
- adata
AnnData 2um bin VisiumHD object. Path to high resolution H&E image provided via
source_image_pathtob2c.read_visium().- mpp
float, optional (default: 1) Microns per pixel of the desired H&E image to create.
- crop
bool, optional (default:True) If
True, will limit the image to the actual spatial coordinate area, withbufferadded to each dimension.- buffer
int, optional (default: 150) Only used with
crop=True. How many extra pixels (in original resolution) to include on each side of the captured spatial grid.- spatial_cropped_key
strorNone, optional (default:None) Only used with
crop=True..obsmkey to store the adjusted spatial coordinates in. IfNone, defaults to"spatial_cropped_X_buffer", whereXis the value ofbuffer.- store
bool, optional (default:True) Whether to store the generated image within the object.
- img_key
strorNone, optional (default:None) Only used with
store=True. The image key to store the image under in the object. IfNone, defaults to"X_mpp_Y_buffer", whereXis the value ofmppandYis the value ofbufferin the instance ofcrop=True. If no cropping is to be done, defaults to"X_mpp".- save_path
filepathorNone, optional (default:None) If specified, will save the generated image to this path (e.g. for StarDist use).
- adata