Build brain polygon render data for a surface atlas
Source:R/ce_shared_exports.R
build_brain_polygon_data.RdProjects surface atlas geometry into 2D polygon panels for each hemisphere and view. Results are memoised so repeated calls with identical arguments return cached data.
Usage
build_brain_polygon_data(
surfatlas,
views,
surface,
projection_smooth = 0L,
depth_cull = TRUE
)Arguments
- surfatlas
A surfatlas object (e.g. from
schaefer_surf()).- views
Character vector of views to render (e.g.
c("lateral", "medial")).- surface
Character: surface type (
"inflated","pial","white").- projection_smooth
Integer: number of Laplacian smoothing iterations on projected coordinates (default
0L).- depth_cull
Logical. If
TRUE(default), remove faces hidden behind nearer cortical surface faces in the projected view.
Value
A list with two elements:
polygonsTibble of 2D projected polygon vertices with columns
x, y, poly_id, parcel_id, label, hemi, view, panel.boundariesTibble of boundary edges with columns
x, y, xend, yend, panel.
Examples
if (FALSE) { # \dontrun{
atlas <- get_schaefer_surfatlas(100)
polygons <- build_brain_polygon_data(atlas,
views = "lateral",
surface = "inflated"
)
} # }