ggseg_schaefer: Create Interactive Schaefer Atlas Visualization

View source: R/ggschaefer.R

ggseg_schaeferR Documentation

Create Interactive Schaefer Atlas Visualization

Description

Creates an interactive visualization of the Schaefer atlas using ggseg, with optional value mapping and customizable appearance.

Usage

ggseg_schaefer(
  atlas,
  vals,
  thresh = c(0, 0),
  pos = FALSE,
  palette = "Spectral",
  interactive = TRUE,
  lim = range(vals)
)

Arguments

atlas

An atlas object containing Schaefer parcellation information

vals

Numeric vector of values to visualize on the atlas

thresh

Numeric vector of length 2 specifying (min, max) thresholds. Values outside this range will be set to NA. Default: c(0,0)

pos

Logical. If TRUE, uses raw values; if FALSE, uses absolute values for thresholding. Default: FALSE

palette

Character string specifying the color palette to use. Default: "Spectral"

interactive

Logical. If TRUE, creates an interactive plot with tooltips. Default: TRUE

lim

Numeric vector of length 2 specifying the range for color mapping. Default: range(vals)

Value

A ggplot2 object (if interactive=FALSE) or a ggiraph object (if interactive=TRUE) showing the visualization

Examples

## Not run: 
# Load Schaefer atlas
atlas <- get_schaefer_atlas("7networks", 100)

# Create random values for visualization
vals <- rnorm(100)

# Create interactive plot
ggseg_schaefer(atlas, vals)

# Create static plot with custom thresholds
ggseg_schaefer(atlas, vals, thresh=c(-1, 1), interactive=FALSE)

## End(Not run)


bbuchsbaum/neuroatlas documentation built on Dec. 24, 2024, 4:22 a.m.