Learn R Programming

ggseg3d

This package mainly contains a plotting function ggseg3d and data.frames of different brain atlases for plotting. Plotting results of analyses on regions or networks often involves swapping between statistical tools, like R and Matlab, and software for brain imaging to correctly visualise analysis results.

This package aims to make it possible to plot results directly through R.

Atlases

There are currently four atlases available in the package:

  1. dk_3d - Desikan-Killiany atlas (aparc).
  2. aseg_3d - Automatic sub-cortical segmentation.

If you want to create your own custom atlas or discover other compatible atlases, please see the companion package ggsegExtra.

Installation

We recommend installing {ggsegExtra} through the ggseg r-universe.

# Enable this universe
options(repos = c(
    ggseg = 'https://ggseg.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'))

# Install some packages
install.packages('ggsegExtra')

The package can be installed using {remotes}. The package includes some large datasets for the brain coordinates. Please be patient during download and install, it will take some time.

install.packages("remotes")
remotes::install_github("ggseg/ggseg3d", build_vignettes = TRUE)

The functions are now installed, and you may load them when you want to use them. All functions are documented in standard R fashion.

Use

The package also has a vignette, to help you get started using it. You can access it here, or via R:

library(ggseg3d)
vignette("ggseg3d")
p <- ggseg3d(atlas=dk_3d) %>% 
  remove_axes() %>% 
  pan_camera("right lateral")

p <- ggseg3d(atlas=aseg_3d) %>% 
  add_glassbrain() %>% 
  remove_axes() %>% 
  pan_camera("right lateral")

Report bugs or requests

Don’t hesitate to ask for support using github issues, or requesting new atlases. While we would love getting help in creating new atlases, you may also request atlases through the issues, and we will try to get to it.

Funding

This tool is partly funded by:

EU Horizon 2020 Grant: Healthy minds 0-100 years: Optimising the use of European brain imaging cohorts (Lifebrain).

Grant agreement number: 732592.

Call: Societal challenges: Health, demographic change and well-being

Copy Link

Version

Install

install.packages('ggseg3d')

Monthly Downloads

400

Version

1.6.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Athanasia Mo Mowinckel

Last Published

June 1st, 2021

Functions in ggseg3d (1.6.3)

ggseg3d_atlas-class

`ggseg3d_atlas` class
is_ggseg3d_atlas

Check if is ggseg_atlas-class
aseg_3d

FreeSurfer automatic subcortical segmentation of a brain volume
add_glassbrain

Add glass brain to ggseg3d plot
pan_camera

Pan camera position of ggseg3d plot
remove_axes

Remove axis information from ggseg3d plot
dk_3d

Desikan-Killiany Cortical Atlas
ggseg3d

ggseg3d: Plot brain segmentations with plotly