napari_prism.im.dearray_tma

Contents

napari_prism.im.dearray_tma#

napari_prism.im.dearray_tma(spatialdata, label_name, expected_diameter_um=700, expectation_margin=0.2, expected_rows=0, expected_cols=0, inplace=True)#

Automatically dearrays a TMA on masks stored in the .labels attribute of the provided spatialdata object.

Parameters:
  • spatialdata (SpatialData) – The spatialdata object to dearray.

  • label_name (str) – The name of the label to dearray.

  • expected_diameter_um (float | int (default: 700)) – The expected diameter of the TMA cores in microns.

  • expectation_margin (float | int (default: 0.2)) – The margin of error for the expected diameter.

  • expected_rows (int (default: 0)) – The expected number of rows in the TMA.

  • expected_cols (int (default: 0)) – The expected number of columns in the TMA.

  • inplace (bool (default: True)) – If True, modifies the spatialdata object in place. If False, returns the dearrayed TMA cores and envelope.

Return type:

SpatialData | tuple[GeoDataFrame, GeoDataFrame, AnnData, BaseTransformation]

Returns:

If inplace is True, returns the modified spatialdata object. If False, returns a tuple of the dearrayed TMA cores, envelope, and transformations.