ggseg: ggseg: Plot brain segmentations with ggplot and plotly

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ggseg.R

Description

Plotting results from analyses done on data derived from brain segmentations is a common need, but may be quite laborious. Results from such analyses are usually easier to interpret if the plot can mimmick the shape and position in the brain it represents.

ggseg plots and returns a ggplot object of plotted aparc regions.

Usage

1
2
3
4
5
6
7
8
9
ggseg(
  .data = NULL,
  atlas = "dk",
  position = "dispersed",
  view = NULL,
  hemisphere = NULL,
  adapt_scales = TRUE,
  ...
)

Arguments

.data

A .data.frame to use for plot aesthetics. Should include a column called "region" corresponding to aparc regions.

atlas

Either a string with the name of atlas to use, or a .data.frame containing atlas information (i.e. pre-loaded atlas).

position

String choosing how to view the .data. Either "dispersed"[default] or "stacked".

view

String to choose view of the .data. Any of c("lateral","medial")[default].

hemisphere

String to choose hemisphere to plot. Any of c("left","right")[default].

adapt_scales

if TRUE, then the axes will be hemisphere without ticks. If FALSE, then will be latitude longitude values. Also affected by position argument

...

other options sent to geom_polygon for plotting, including mapping aes (cannot include x, y, and group aethetics).

Details

This package contains data from various brain parcellations, with convenient functions to inspect the results directly on a brain-plot wither with ggplot (2D polygons) or plotly (3d meshes).

'dk'

The Desikan-Killiany Cortical Atlas [default], Freesurfer cortical segmentations.

'aseg'

Freesurfer automatic subcortical segmentation of a brain volume

Value

a ggplot object

Author(s)

Maintainer: Athanasia Mo Mowinckel a.m.mowinckel@psykologi.uio.no (ORCID)

Authors:

Athanasia Mowinckel and Didac Pineiro

See Also

Useful links:

[ggplot2][ggplot], [aes][aes], [geom_polygon][geom_polygon], [coord_fixed][coord_fixed]

Examples

1
2
3
4
5
6
library(ggplot2)
ggseg()
ggseg(mapping=aes(fill=region))
ggseg(colour="black", size=.7, mapping=aes(fill=region)) + theme_void()
ggseg(position = "stacked")
ggseg(adapt_scales = FALSE)

neuroconductor/ggseg documentation built on May 15, 2021, 11:21 p.m.