View source: R/morph_atlas_agg.R
subject.atlas.agg | R Documentation |
Aggregate morphometry data over brain atlas regions, e.g., compute the mean thickness value over all regions in an atlas.
subject.atlas.agg(
vertex_morph_data,
vertex_label_names,
agg_fun = base::mean,
requested_label_names = c()
)
vertex_morph_data |
numeric vector. The morphometry data, one value per vertex. The morphometry data are typically loaded from an MGZ or curv format file with the read.fs.curv or read.fs.mgh functions. |
vertex_label_names |
string vector. The region names for the vertices, one string per vertex. The region names are typically loaded from an annotation file with the read.fs.annot function. |
agg_fun |
function. An R function that aggregates data, typically max, mean, min or something similar. Note: this is NOT a string, put the function name without quotes. Defaults to |
requested_label_names |
string vector. The label (or region) names that you want to occur in the output. If not specified, all region names which occur in the data are used. If given, and one of the requested names does NOT occur in the data, it will occur in the output with aggregation value NaN. If given, and one of the names from the data does NOT occur in the requested list, it will NOT occur in the output. So if you specify this, the output dataframe will contain a row for a region if and only if it is in the requested list. |
dataframe with aggregated values for all regions, with 2 columns and n rows, where n is the number of effective regions. The columns are: "region": string, contains the region name. "aggregated": numeric, contains the result of applying agg_fun to the morphometry data in that region.
Other aggregation functions:
group.agg.atlas.native()
,
group.agg.atlas.standard()
,
group.morph.agg.standard.vertex()
Other atlas functions:
get.atlas.region.names()
,
group.agg.atlas.native()
,
group.agg.atlas.standard()
,
group.annot()
,
group.label.from.annot()
,
label.from.annotdata()
,
label.to.annot()
,
regions.to.ignore()
,
spread.values.over.annot()
,
spread.values.over.hemi()
,
spread.values.over.subject()
,
subject.annot()
,
subject.label.from.annot()
,
subject.lobes()
## Not run:
fsbrain::download_optional_data();
subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
morph_data = subject.morph.native(subjects_dir, 'subject1', 'thickness', 'lh');
annot = subject.annot(subjects_dir, 'subject1', 'lh', 'aparc');
agg = subject.atlas.agg(morph_data, annot$label_names);
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.