Skip to contents

Method to extract images

Usage

GetImages(object, image_use = c("raw", "transformed"))

# S4 method for Staffli
GetImages(object, image_use = c("raw", "transformed"))

# S4 method for Seurat
GetImages(object, image_use = c("raw", "transformed"))

Arguments

object

A Staffli or Seurat object

image_use

A string specifying the image type to get

Value

A list of images in raster format

Examples


# Load example data
se_mbrain <- readRDS(system.file("extdata/mousebrain", "se_mbrain", package = "semla")) |> 
   LoadImages()
#> 
#> ── Loading H&E images ──
#> 
#>  Loading image from /private/var/folders/91/twz8ld_x3f98sr9yc2hq9xpn47blx2/T/RtmpQDm3p7/temp_libpathed1b712617f8/semla/extdata/mousebrain/spatial/tissue_lowres_image.jpg
#>  Scaled image from 600x565 to 400x377 pixels
#>  Saving loaded H&E images as 'rasters' in Seurat object

# Fetch Staffli object
staffli_object <- GetStaffli(se_mbrain)

# Fetch images from a Staffli object
images <- GetImages(staffli_object)


# Fetch images from a Seurat object
images <- GetImages(se_mbrain)