sainsc.LazyKDE.load_local_maxima ================================ .. py:method:: sainsc.LazyKDE.load_local_maxima(genes = None, *, spatialdata = False, img_genes = None) Load the gene expression (KDE) of the local maxima. The local maxima (:py:attr:`sainsc.LazyKDE.local_maxima`) are calculated and returned as :py:class:`anndata.AnnData` object. :param genes: List of genes for which the KDE of the local maxima will be calculated. :type genes: collections.abc.Iterable[str], optional :param spatialdata: If True will load the data as a SpatialData object including the totalRNA projection and cell-type map if available. If False an AnnData object is returned. :type spatialdata: bool, optional :param spatialdata: If True will load the data as a SpatialData object including the totalRNA projection and cell-type map if available. If False an AnnData object is returned. :type spatialdata: bool, optional :param img_genes: List of genes for which the KDE is calculated and loaded as multi-channel Image in SpatialData. Only available if `spatialdata` is set to `True`. :type img_genes: collections.abc.Iterable[str], optional :rtype: anndata.AnnData | spatialdata.SpatialData :raises ModuleNotFoundError: If `spatialdata` is set to `True` but the package is not installed. :raises ValueError: If `local_maxima` have not been identified. :raises ValueError: If not all `img_genes` exist in `self.genes`.