mesa.ecospatial.generate_patches
- mesa.ecospatial.generate_patches(spatial_data, library_key, library_id, scaling_factor, spatial_key)
Generate a list of patches from a spatial data object, scaling them according to a given factor.
- Parameters:
spatial_data (Union[
ad.AnnData,pd.DataFrame]) – The spatial data from which to generate patches. This can be either an AnnData object or a DataFrame.library_key (str) – Key to identify the specific library within the spatial_data.
library_id (str) – Identifier for the specific library, used to segregate or identify the data subset.
scaling_factor (Union[int, float]) – Factor by which the spatial dimensions are scaled to determine the size of each patch.
spatial_key (Union[str, List[str]]) – Key(s) to access specific spatial information within spatial_data.
- Returns:
A list of spatially defined patches derived from the spatial_data.
- Return type: