Skip to contents

Retrieves the QPTIFFMetadata object (an OME-organised hierarchy of slide / image / channel / scale metadata) stored inside a QPTIFFImage. The generic falls back to metadata for S4 objects such as SummarizedExperiment, so metadata(img) and metadata(spe) both work when bgnormR is loaded.

Usage

metadata(x, ...)

# S3 method for class 'QPTIFFImage'
metadata(x, ...)

Arguments

x

A QPTIFFImage.

...

Unused.

Value

A QPTIFFMetadata object (a named list).

Details

The returned object mirrors the OME hierarchy:

slide

Slide-constant identity (id, barcode, operator, ...).

images

One scene per distinct image, each with image_info (optics, camera, scan_resolution), channels (per-channel name, fluorophore, dye_from_name, exposure_time_us, wavelengths, color_rgb, ...) and scales (per pyramid level).

acquisition_format

One of "brightfield", "polaris_scanband", "fusion_paged", "ome_tiff", "ome_zarr", or "unknown".

Use the accessors (qpi_format, qpi_channels, qpi_pixel_size_um, channel_table, ...) rather than indexing the nested list directly.

Examples

path <- system.file("extdata", "PA_HNC_sample.ome.tiff", package = "bgnormR")
img  <- read_qptiff(path)
#> Reading TIFF directory structure ...
#> Reading OME-TIFF metadata ...
#> Reading IFD page layouts ...
#> Loading 5 channel(s) ...
#> Loading 5 channel(s) ...
meta <- metadata(img)
#> Error: unable to find an inherited method for function ‘metadata’ for signature ‘x = "QPTIFFImage"’
qpi_format(meta)
#> Error: object 'meta' not found
# Per-channel dye information as a tidy table
channel_table(meta)[, c("name", "fluorophore", "dye_from_name")]
#> Error: object 'meta' not found