LoadImages: Function used to read HE images in jpeg or png format

LoadImagesR Documentation

Function used to read HE images in jpeg or png format

Description

Function used to read HE images in jpeg or png format

Usage

LoadImages(
  object,
  image.paths = NULL,
  xdim = 400,
  crop.to.fiducials = FALSE,
  crop.scale.factors = c(9, 10, 10, 8),
  verbose = TRUE,
  time.resolve = FALSE
)

## S3 method for class 'Staffli'
LoadImages(
  object,
  image.paths = NULL,
  xdim = 400,
  crop.to.fiducials = FALSE,
  crop.scale.factors = c(9, 10, 10, 8),
  verbose = TRUE,
  time.resolve = TRUE
)

## S3 method for class 'Seurat'
LoadImages(
  object,
  image.paths = NULL,
  xdim = 400,
  crop.to.fiducials = FALSE,
  crop.scale.factors = c(9, 10, 10, 8),
  verbose = TRUE,
  time.resolve = TRUE
)

Arguments

object

Seurat or Staffli object

image.paths

Paths to HE images. This is only required if image paths are missing in the Seurat object.

xdim

Sets the pixel width for scaling, e.g. 400 (maximum allowed width is 2000 pixels)

crop.to.fiducials

Set to TRUE if you want to crop out background from the images outside the fiducials.

crop.scale.factors

Numeric vector of length 4 providing a scaling factor for each side of the image. The scaling factors define the number of spot widths away from the capture area to include in the cropped image if 'crop.to.fiducials' is set to TRUE. The default values are c(9, 10, 10, 8) which corresponds to left, top, right and bottom.

verbose

Print messages

time.resolve

Activate to stop R from loading raw images into memory

Value

A Staffli object

A Seurat object

Examples

## Not run: 
# Create a new Staffli object and plot images
st.obj <- CreateStaffliObject(imgs, meta.data)
st.obj <- LoadImages(st.obj, verbose = TRUE)
plot(st.obj)

## End(Not run)

## Not run: 
# Load images into a Seurat object and plot images
se <- LoadImages(se, verbose = TRUE)
ImagePlot(se)

## End(Not run)

jbergenstrahle/STUtility documentation built on March 14, 2023, 7:15 a.m.