Skip to contents

Read an image into a lightweight annot_image handle, auto-detecting the backend from the file unless one is named.

Usage

at_read_image(path, backend = NULL, ..., call = rlang::caller_env())

Arguments

path

Single string path to an image file.

backend

Optional backend name; auto-detected when NULL.

...

Passed to the backend's reader. They must be plain serializable values (numbers, strings, logicals and lists of them): they are recorded in the image's source descriptor so a saved project can reopen the file the same way.

call

The calling environment, for error reporting.

Value

An annot_image whose source is the absolute path of the file, with a source_descriptor (path, backend, options, file signature) and a per-read cache identity.

Examples

img <- at_read_image(at_example_path("tissue"))
at_dims(img)
#> [1] 512 512