getPixelSize: Get physical size of pixels

View source: R/utils.R

getPixelSizeR Documentation

Get physical size of pixels

Description

This function gets physical size of pixels in each resolution of a OME-TIFF pyramid in BioFormatsImage.

Usage

getPixelSize(file, resolution = 1L)

Arguments

file

Path to an OME-TIFF file.

resolution

Which resolution to query; 1 means the highest resolution. The pixels will be larger for the lower resolutions.

Value

Numeric vector of length 2 of pixel size in x and y. Usually they're the same.

Examples

library(SFEData)
fp <- tempdir()
dir_use <- XeniumOutput("v1", file_path = file.path(fp, "xenium_test"))
# RBioFormats null pointer error
try(getPixelSize(file.path(dir_use, "morphology_focus.ome.tif")))
getPixelSize(file.path(dir_use, "morphology_focus.ome.tif"))
unlink(dir_use, recursive = TRUE)

pachterlab/SpatialFeatureExperiment documentation built on May 17, 2024, 12:24 a.m.