Skip to contents

Construct the batch annotation application from explicit inputs, without launching a browser or touching global options. The result can be run with shiny::runApp(), embedded in another Shiny application, or exercised in tests; at_annotate() is a launcher around it.

Usage

at_app(
  input = NULL,
  session = NULL,
  control = "off",
  labels = character(),
  layers = NULL,
  out_dir = NULL,
  read_only = FALSE,
  view = NULL,
  ...,
  call = rlang::caller_env()
)

Arguments

input

What to annotate: an annot_project, annot_image, a character vector of image paths, a directory of images, or NULL.

session

An annot_session to resume. Supply input or session, not both; with neither, the bundled example session is used.

control

"off" (default; no control service) or an at_control_handle from at_control_start() whose session the app then displays and synchronises with.

labels, layers, out_dir

Passed to at_session() when input is not a session.

read_only

Logical; disable all annotation edits (view and inspect only).

view

Optional initial band view, e.g. list(operation = "rgb", bands = c(30, 20, 10)).

...

Reserved; must be empty.

call

The calling environment, for error reporting.

Value

A shiny.appobj.

Details

All Shiny sessions of one app object share its in-memory queue: reloading the page or opening a second tab continues from the latest edits instead of the session the app was built with. Edits are stored per queue entry; two tabs editing the same image keep the last edit.

Annotations autosave to the session's out_dir (unless the session was created with autosave = FALSE); the app warns when that folder is inside R's temporary directory, which is deleted when R exits. Before it first replaces an existing _session.rds that holds another queue or more ROIs, the app keeps a timestamped _session-*.previous.rds copy.

The Data page reads folder and handoff paths on the machine running R. The app is meant for local use; for a shared deployment set options(hyperannotatR.app_root = "/allowed/folder") to refuse paths outside one folder.

Examples

app <- at_app(session = at_example_session(2))
class(app)
#> [1] "shiny.appobj"
if (FALSE) { # \dontrun{
shiny::runApp(app)
} # }