Skip to contents

Draws a second atlas into an existing plot, so a subcortical atlas can sit inside a cortical one, or two parcellations can be shown together.

Usage

add_atlas(p, atlas, ...)

Arguments

p

A ggseg3d widget or ggsegray rgl object.

atlas

A ggseg_atlas to add.

...

Passed to the atlas's mesh preparation, as in ggseg3d() – hemisphere and surface for a cortical atlas, for instance.

Value

The input object, for piping. A ggsegray is returned unchanged: rgl draws to the open device rather than into the object.

Details

Both atlases are drawn in their own coordinates, and nothing is registered between them – they line up because the ecosystem's atlases share an anatomical frame, not because this reconciles them. A flat (2D) cerebellar surface shares no frame with anatomical meshes, so combining one with another atlas is refused rather than drawn misaligned.

The added atlas keeps its own colours. The plot's legend describes the atlas it was built from, so colour a second atlas by palette rather than by values if the legend needs to be read.

Examples

# \donttest{
# subcortical structures inside a translucent cortex
ggseg3d(atlas = aseg()) |>
  add_glassbrain(opacity = 0.15)
# or two atlases together ggseg3d(atlas = dk(), hemisphere = "left") |> add_atlas(aseg())
# }