Skip to contents

Reading `SpatialData`

Usage

readImage(x, ...)

readLabel(x, ...)

readPoint(x, ...)

readShape(x, ...)

readTable(x, anndataR = FALSE)

readSpatialData(
  x,
  images = TRUE,
  labels = TRUE,
  points = TRUE,
  shapes = TRUE,
  tables = TRUE,
  anndataR = TRUE
)

Arguments

x

For readImage/Label/Point/Shape/Table, path to a SpatialData element. For readSpatialData, path to a SpatialData-.zarr store.

...

option arguments passed to and from other methods.

anndataR

logical specifying whether to use anndataR to read tables; by default (FALSE), basilisk, anndata and zellkonverter are used.

images, labels, points, shapes, tables

Control which elements should be read for each layer. The default, NULL, reads all elements; alternatively, may be FALSE to skip a layer, or a integer vector specifying which elements to read.

Value

  • For readSpatialData, a SpatialData.,

  • For element readers, a ImageArray, LabelArray, PointFrame, ShapeFrame, or SingleCellExperiment.

Examples

tf <- tempfile()
dir.create(tf)
base <- unzip_merfish_demo(tf)
#> returning path to cached zip
(x <- readSpatialData(base))
#> class: SpatialData
#> - images(1):
#>   - rasterized (1,522,575)
#> - labels(0):
#> - points(1):
#>   - single_molecule (3714642)
#> - shapes(2):
#>   - anatomical (6,polygon)
#>   - cells (2389,circle)
#> - tables(1):
#>   - table (268,2389)
#> coordinate systems:
#> - global(4): rasterized anatomical cells single_molecule