spatialvi.data.SpatialCoordsField#
- class spatialvi.data.SpatialCoordsField(obsm_key)[source]#
AnnData obsm field for 2D/3D spatial coordinates.
Wraps scvi’s ObsmField with coordinate dimensionality validation. Stores coordinates as-is (no normalization) — callers may normalize before registration if needed.
- Parameters:
obsm_key (
str) – Key to access the spatial coordinates inadata.obsm.
Methods
__init__(obsm_key)get_data_registry()Returns a nested dictionary which describes the mapping to the data field.
get_field_data(adata)Returns the requested data as determined by the field.
get_summary_stats(state_registry)Get summary stats.
register_field(adata)Register the field.
transfer_field(state_registry, adata_target, ...)Transfer the field.
validate_field(adata)Validate the field.
view_state_registry(state_registry)View the state registry.
Attributes
COLUMN_NAMES_KEYattr_keyThe key of the data field within the relevant AnnData attribute.
attr_nameThe name of the AnnData attribute where the data is stored.
is_emptyReturns True if the field is empty as a function of its kwargs.
mod_keyThe modality key of the data field within the MuData (if applicable).
registry_keyThe key that is referenced by models via a data loader.