This function identifies which vertices in a cortical surface mesh correspond
to one or more specified regions of interest (ROIs), based on the 36 regions of
the Desikan-Killiany atlas distributed with FreeSurfer (aparc.annot
).
If no ROIs are specified, it returns a full lookup table of all ROIs with vertex
counts, proportions, and lobe assignments.
Usage
locate_roi(rois = NULL, n_verts = 163842, hemi = c("lh", "rh"), verbose = TRUE)
Arguments
- rois
Optional character vector of ROI names to locate (e.g.,
c("insula", "precentral")
). IfNULL
(default), the function returns a full ROI lookup table.- n_verts
Integer. Total number of surface vertices to consider (default:
163842
"fsaverage").- hemi
String: "lh" or "rh". Used to point to the hemisphere-specific aparc annotation file.
- verbose
Logical (default:
TRUE
).
Value
If
rois
isNULL
, returns adata.frame
with:roi_id
: ROI numeric IDroi_label
: ROI namevw_count
: Number of vertices in the ROIvw_prop
: Proportion of total vertices in the ROIroi_lobe
: Anatomical lobe classificationlobe_count
: Total number of vertices in the lobelobe_prop
: Proportion of vertices in the lobe
If
rois
is provided, returns a logical vector of lengthn_verts
, whereTRUE
indicates the vertex belongs to one of the selected ROIs.