Skip to contents

Return raw analysis coordinates or display coordinates together with their source and reversible transform. Image-backed coordinates are normalized to horizontal `x` and vertical `y`. Seurat's standard `VisiumV2` loader stores source `imagerow`/`imagecol` values positionally as centroid `x`/`y`; SCOP restores horizontal image-column and vertical image-row order. Generic FOV centroid tables with explicit `x`/`y` retain their order. SCOP then applies only the selected scale and display-axis flip. This function does not modify the object.

Usage

SpatialCoordinates(
  object,
  image = NULL,
  coord.cols = c("col", "row"),
  space = c("raw", "display"),
  image_policy = "strict",
  image.scale = c("lowres", "hires")
)

Arguments

object

A `Seurat` object.

image

Optional Seurat image name.

coord.cols

Metadata columns used when no image is available.

space

Coordinate space to return.

image_policy

Multi-image selection policy. The default requires an explicit image when more than one image is available.

image.scale

Image scale factor used only when `space = "display"`. Choose `"hires"` when the image slot contains a hires raster. Raw coordinates are always returned in full-resolution units.

Value

A plain list with `data`, `source`, and `transform` entries.