Create a SpatRaster object (package `terra`) using Visium image file
load_g4x_img(
seurat = NULL,
img_path = NULL,
rm_old_img = F,
return.seurat = T,
max_dim = 2000
)
a Seurat object containing G4X data
character string indicating the path of the H&E image to be used. If set to `NULL`, the function will look for any image path 'img' stored in tools slot
boolean, whether or not removing any Image object already loaded in the Seurat object (`Images()`)
boolean, whether returning the input Seurat file with the raster object stored in the `tools` slot (`TRUE`) or the raster 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 G4X H&E image file to create a SpatRaster image for downstream analysis and visualization.