spateo.preprocessing.image ========================== .. py:module:: spateo.preprocessing.image .. autoapi-nested-parse:: Image preprocessing. Functions --------- .. autoapisummary:: spateo.preprocessing.image.remove_background Module Contents --------------- .. py:function:: remove_background(adata: anndata.AnnData, threshold: Union[float, str] = 'auto', slice: Optional[str] = None, used_img_layer: Optional[str] = None, return_img_layer: Optional[str] = None, inplace: bool = False, show: bool = True) -> Optional[anndata.AnnData] Preprocessing of an image. Remove background with the global threshold. Pixel intensity is set to 0, for all the pixels intensity, less than the threshold value. If the threshold is not provided, it will be calculated by OSTU's method. :param adata: AnnData object. :param threshold: Global threshold used. If the threshold is not provided, it will be calculated by OSTU's method. :param slice: Name of the slice. :param used_img_layer: Name of used image layer. :param return_img_layer: Name of output image layer. :param inplace: Perform computation inplace or return result. :param show: Show the preprocessed image or not. :returns: :attr:`AnnData.uns`\ `['spatial'][slice]['images'][return_img_layer]` The preprocessed image :attr:`AnnData.uns`\ `['spatial'][slice]['scalefactors'][return_img_layer]` The scale factor for the spots