snapshot_brain: Save ggseg3d widget as image

View source: R/additions.R

snapshot_brainR Documentation

Save ggseg3d widget as image

Description

Takes a screenshot of a ggseg3d widget and saves it as a PNG image. Requires a Chrome-based browser to be installed.

Usage

snapshot_brain(p, file, width = 600, height = 500, delay = 1, zoom = 2, ...)

Arguments

p

ggseg3d widget object

file

string. Output file path (should end in .png)

width

numeric. Image width in pixels (default: 600)

height

numeric. Image height in pixels (default: 500)

delay

numeric. Seconds to wait for widget to render before capture (default: 1)

zoom

numeric. Zoom factor for higher resolution (default: 2)

...

Additional arguments passed to webshot2::webshot

Value

The file path (invisibly)

Examples

## Not run: 
ggseg3d() |>
  pan_camera("left lateral") |>
  snapshot_brain("brain.png")

## End(Not run)

ggseg3d documentation built on Feb. 21, 2026, 1:06 a.m.