spatialtis.read_images#
- spatialtis.read_images(images, masks, markers=None, annotations=None, image_axes='cyx', intensity_measure='mean', shape_approx='convex', concavity=1.5, geopandas_compatible=True, is3d=False, sparse=False)[source]#
Read single cell data from images and masks.
- Parameters
- imageslist of str or path
Images files.
- maskslist of str or path
Masks files, should be one to one match to image.
- markerspd.DataFrame
The name of markers. A dataframe that annotate markers’ name, target, tag etc.
- annotationspd.DataFrame
The annotations to your image ROI, for example: if you have two images, you can annotate it with pd.DataFrame({‘ROI’: [‘ROI1’, ‘ROI2’]).
- image_axes{‘cyx’, ‘xyc’}, default: ‘cyx’.
The layout order of your input images.
- intensity_measurestr, default: ‘mean’
The way to measure pixel intensity, available for any numpy method, mostly used are ‘mean’, ‘sum’ or ‘max’.
- shape_approx{‘convex’, ‘concave’}, default: ‘convex’
The method to approximate the cell shape. ‘convex’ is fast, ‘concave’ is slow but accurate.
- concavityfloat, default: 1.5
Control the concave result.
- geopandas_compatiblebool, default: True
Convert centroid and shape to wkt format if True.
- is3dbool, default: False.
Treat input image as 3D stack.
- sparsebool, default: False.
Convert expression matrix to sparse format.