Skip to contents

Read ExtImage from disk

Usage

readExtImage(path, metadata = NULL, ...)

Arguments

path

String containing a path to a directory, itself created with a saveObject method.

metadata

Named list containing metadata for the object - most importantly, the type field that controls dispatch to the correct loading function. If NULL, this is automatically read by readObjectFile(path).

...

Arguments passed to readImage.

Value

A ExtImage object for SFE.

See also

Other readObject-SFE-image: readBioFormatsImage(), readSpatRaster()

Examples

library(SFEData)
fp <- tempfile()
fsave <- file.path(fp, "exi")
x1 <- XeniumOutput(dataset = "v1", file_path = file.path(fp, "xenium1"))
#> see ?SFEData and browseVignettes('SFEData') for documentation
#> loading from cache
#> The downloaded files are in /tmp/RtmpfBErth/file2aa8499795d0/xenium1/xenium_lr 
sfe <- readXenium(x1)
#> >>> Cell segmentations are found in `.csv` file(s)
#> >>> Reading cell and nucleus segmentations
#> >>> Making POLYGON geometries
#> >>> Checking polygon validity
#> >>> Saving geometries to parquet files
#> >>> Reading cell metadata -> `cells.csv`
#> >>> Reading h5 gene count matrix
#> >>> filtering cellSeg geometries to match 16324 cells with counts > 0
#> >>> filtering nucSeg geometries to match 16324 cells with counts > 0
bfi <- getImg(sfe)
exi <- toExtImage(bfi)
#> Resolution subscript out of bound, reading the lowest resolution
saveObject(exi, fsave)
exi2 <- readObject(fsave)
unlink(fsave, recursive = TRUE)