| readImgData {SpatialExperiment} | R Documentation |
Function to read in images and scale factors for 10x Genomics Visium data,
and return as a valid imgData DataFrame.
readImgData( path = ".", sample_id = names(path), imageSources = file.path(path, "tissue_lowres_image.png"), scaleFactors = file.path(path, "scalefactors_json.json"), load = TRUE )
path |
a path where to find one or more images |
sample_id |
the |
imageSources |
the images source path(s) |
scaleFactors |
the .json file where to find the scale factors |
load |
logical; should the image(s) be loaded into memory
as a |
Helena L. Crowell
dir <- system.file(
file.path("extdata", "10xVisium", "section1", "spatial"),
package = "SpatialExperiment")
# base directory contains
# - scale factors (scalefactors_json.json)
# - one image (tissue_lowres_image.png)
list.files(dir)
# read in images & scale factors
# as valid 'imgData' 'DFrame'
readImgData(dir, sample_id = "foo")