Create a SpatRaster object (package `terra`) using Visium image file
visium2rast(
seurat = NULL,
img_path = NULL,
rm_old_img = F,
return.seurat = T,
max_dim = 2000
)
a Seurat object containing Visium/Visium-HD data
character string indicating the path of the H&E image to be used for Visium/VisiumHD. If set to `NULL`, no image is loaded and stored in Seurat object
boolean, whether or not removing any Image object already loaded in the Seurat object (`Images()`)
boolean, whether returning the input Seurat file with the nb object stored in the `misc` slot (`TRUE`) or the nb object alone (`FALSE`). Default value is `TRUE`
numeric value indicating the ideal maximum pixel dimension accepted for Visium H&E image. If image size is bigger than this value, a scale factor will be applied to lower image pixel resolution/size up to the defined maximum value
Seurat object with the new raster image stored in the `misc` slot or the raster image alone, depending on the `return.seurat` parameter
This function will use Visium H&E image file to create a SpatRaster image for downstream analysis and visualization. The function is compatible with either Visium or Visium-HD data format.