| subject.region.centroids | R Documentation |
Computes, for every region of an atlas (annotation), the mean position of the surface vertices that belong to the region. These centroids are the node positions of a connectome visualization, see vis.connectome. This is the equivalent of the _extract_centroids() function of the Python package yabplot.
subject.region.centroids(
subjects_dir,
subject_id,
atlas,
surface = "midthickness",
hemi = "both",
exclude_regions = c("unknown", "medialwall", "")
)
subjects_dir |
character string. The FreeSurfer |
subject_id |
character string, the subject identifier. For a template space, this is the name of the template subject, e.g., 'fs_LR_32' or 'fsaverage'. |
atlas |
character string, the atlas name, e.g., 'schaefer400', 'brainnetome' or 'aal3'. Used to construct the name of the annotation file. |
surface |
character string, the name of the surface on which the centroids are computed. Defaults to 'midthickness' (the surface in the middle between white and pial matter), which is the surface usually used for connectome figures. |
hemi |
character string, one of 'lh', 'rh', or 'both'. Defaults to 'both'. |
exclude_regions |
vector of character strings, the names of atlas regions to exclude. Defaults to the medial wall and the unknown region, which are not real brain regions. |
data.frame with one row per region, the columns 'x', 'y', 'z' (the centroid coordinates), 'region' (the region name) and 'hemi' (the hemisphere). The row names are the region names, which are unique across hemispheres for the atlases that are distributed by fsbrain (see the example).
Other connectome functions:
vis.connectome()
## Not run:
# For the fs_LR_32 template (HCP-style), download the data first:
fsbrain::download_fs_LR_32_meshes();
fsbrain::download_fs_LR_32_atlases();
centroids = subject.region.centroids(subjects_dir = NULL, subject_id = "fs_LR_32",
atlas = "schaefer400", surface = "midthickness");
head(centroids);
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.