Skip to contents

Adds a translucent brain surface to a ggseg3d plot for anatomical reference. Particularly useful for subcortical and tract visualizations where spatial context helps interpretation. Works with both htmlwidget (ggseg3d) and rgl (ggsegray) objects. The default "inflated" surface ships with ggseg.formats; every other surface is drawn from ggseg.meshes.

Usage

add_glassbrain(
  p,
  hemisphere = c("left", "right"),
  surface = "inflated",
  colour = "#CCCCCC",
  opacity = 0.3,
  brain_meshes = NULL
)

Arguments

p

A ggseg3d widget or ggsegray rgl object.

hemisphere

Character vector. Hemispheres to add: "left", "right", or both. "lh" and "rh" are accepted as well.

surface

Surface type: "inflated", "semi-inflated", "white", "pial", "midthickness", "sphere", "smoothwm" or "orig". ggseg3d() additionally accepts "LCBC", an alias for "inflated".

colour

Character. Colour for the glass brain surface (hex or named).

opacity

Numeric. Transparency of the glass brain (0-1).

brain_meshes

Optional user-supplied mesh data. Passed through to ggseg.formats::get_brain_mesh() for format details.

Value

The input object (modified), for piping.

Examples

# \donttest{
ggseg3d(atlas = aseg()) |>
  add_glassbrain("left", opacity = 0.2)
# } if (FALSE) { # \dontrun{ # rgl requires OpenGL; not run in check environments. ggsegray(atlas = aseg()) |> add_glassbrain(opacity = 0.15) |> pan_camera("right lateral") } # }