| Title: | Mapping Cortical Folding Patterns |
|---|---|
| Description: | Visualizes sulcal morphometry data derived from 'BrainVisa' <https://brainvisa.info/> including width, depth, surface area, and length. The package enables mapping of statistical group results or subject-level values onto cortical surface maps, with options to focus on all sulci or only selected regions of interest. Users can display all four measures simultaneously or restrict plots to chosen measures, creating composite, publication-quality brain visualizations in R to support the analysis and interpretation of sulcal morphology. |
| Authors: | Mahan Shafie [aut, cre], Fabrizio Pizzagalli [aut] |
| Maintainer: | Mahan Shafie <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.6 |
| Built: | 2026-05-19 07:50:43 UTC |
| Source: | https://github.com/cran/sulcimap |
Clear sulcimap cached assets
clear_sulcimap_cache()clear_sulcimap_cache()
Logical TRUE if cache removed or did not exist
Lightweight assets for light example Unzips a tiny assets bundle and returns the directory path.
get_assets_light()get_assets_light()
A character scalar: path to the unzipped assets directory.
Unzips the bundled assets into a cache (persistent for users, temporary under checks)
get_sulcimap_assets_dir()get_sulcimap_assets_dir()
Character scalar: full path to the root of extracted assets
Full path to a bundled PNG (after extraction)
get_sulcus_image(name)get_sulcus_image(name)
name |
Relative path inside the assets (e.g. "leftlat/S.C._left.png") |
Character scalar: full path
List bundled PNGs (after extraction)
list_sulci_images()list_sulci_images()
Character vector of relative PNG paths
Generates composite brain figures (left/right lateral/medial) by mapping sulcal values.
plot_sulci( sulcus_values, palette = "gyr", value_range = NULL, save_dir = NULL, measure = c("all", "opening", "depth", "surface", "length"), show_colorbar = TRUE, caption = expression(-log[10](p)), ... )plot_sulci( sulcus_values, palette = "gyr", value_range = NULL, save_dir = NULL, measure = c("all", "opening", "depth", "surface", "length"), show_colorbar = TRUE, caption = expression(-log[10](p)), ... )
sulcus_values |
data.frame or path/to/csv
Either (1) a two-column dataframe with |
palette |
character
Color palette for mapping values and the colorbar. Options include
|
value_range |
numeric length-2 or NULL (default
|
save_dir |
character or NULL (default |
measure |
character What to plot:
|
show_colorbar |
logical Show or hide the color bar on the figure. |
caption |
character or expression
Label displayed with the color bar. For math, use e.g. |
... |
Advanced options:
|
If save_dir = NULL, returns a ggplot (or patchwork) object
representing the brain figure, which can be further modified and saved.
If save_dir is not NULL, the plot image(s) are automatically saved in that directory
and the function (invisibly) returns a character vector with the path(s) to the saved file(s).
# Minimal executable example using assets_light ex <- data.frame( Sulcus = c("S.C._left.opening", "S.C._right.opening", "S.F.int._left.opening", "S.F.int._right.opening"), Value = c(1, 0.5, 0.8, 0.4) ) assets_light <- sulcimap::get_assets_light() p <- plot_sulci( sulcus_values = ex, measure = "opening", palette = "gyr", show_colorbar = FALSE, base_dir = assets_light, save_dir = NULL ) # p is a ggplot/patchwork object; printing it will draw the figure. # Full example # df should have columns: Sulcus (BrainVISA-style names with suffixes), Value # plot_out <- plot_sulci( # sulcus_values = df, # palette = "gyr", # value_range = NULL, # save_dir = NULL, # measure = "opening", # show_colorbar = TRUE, # caption = expression(-log[10](p)) # )# Minimal executable example using assets_light ex <- data.frame( Sulcus = c("S.C._left.opening", "S.C._right.opening", "S.F.int._left.opening", "S.F.int._right.opening"), Value = c(1, 0.5, 0.8, 0.4) ) assets_light <- sulcimap::get_assets_light() p <- plot_sulci( sulcus_values = ex, measure = "opening", palette = "gyr", show_colorbar = FALSE, base_dir = assets_light, save_dir = NULL ) # p is a ggplot/patchwork object; printing it will draw the figure. # Full example # df should have columns: Sulcus (BrainVISA-style names with suffixes), Value # plot_out <- plot_sulci( # sulcus_values = df, # palette = "gyr", # value_range = NULL, # save_dir = NULL, # measure = "opening", # show_colorbar = TRUE, # caption = expression(-log[10](p)) # )