cropSamples: Crop to zoom in on given ROIs

View source: R/imageManipulation.R

cropSamplesR Documentation

Crop to zoom in on given ROIs

Description

Crop to zoom in on given ROIs

Usage

cropSamples(overlay, sampleIDs, buffer = 0.1, sampsOnly = TRUE)

Arguments

overlay

SpatialOverlay object

sampleIDs

sampleIDs of ROIs to keep in image

buffer

percent of new image size to add to each edge as a buffer

sampsOnly

should only ROIs with given sampleIDs be in image

Value

SpatialOverlay object

Examples


muBrain <- readRDS(unzip(system.file("extdata", "muBrainSubset_SpatialOverlay.zip", 
                                    package = "SpatialOmicsOverlay")))

image <- downloadMouseBrainImage()

muBrain <- addImageOmeTiff(overlay = muBrain, 
                           ometiff = image, res = 8)

samps <- sampNames(muBrain)

muBrainCrop <- suppressWarnings(cropSamples(overlay = muBrain, 
                                            sampleIDs = samps, 
                                            sampsOnly = TRUE))

plotSpatialOverlay(overlay = muBrainCrop, scaleBar = FALSE,
                   hiRes = TRUE, legend = FALSE)


Nanostring-Biostats/SpatialOmicsOverlay documentation built on April 20, 2024, 5:36 a.m.