label.from.annotdata {fsbrain} | R Documentation |
Extract a region from an annotation as a label.
Description
The returned label can be used to mask morphometry data, e.g., to set the values of a certain region to 'NaN' or to extract only values from a certain region.
Usage
label.from.annotdata(
annotdata,
region,
return_one_based_indices = TRUE,
invert = FALSE,
error_on_invalid_region = TRUE
)
Arguments
annotdata |
annotation. An annotation for one hemisphere, as returned by |
region |
string. A valid region name for the annotation, i.e., one of the regions of the atlas used to create the annotation. |
return_one_based_indices |
logical. Whether the indices should be 1-based. Indices are stored zero-based in label files, but R uses 1-based indices. Defaults to TRUE. |
invert |
logical. If TRUE, return the indices of all vertices which are NOT part of the region. Defaults to FALSE. |
error_on_invalid_region |
logical. Whether to throw an error if the given region does not appear in the region list of the annotation. If set to FALSE, this will be ignored and an empty vertex list will be returned. Defaults to TRUE. |
Value
integer vector with label data: the list of vertex indices in the label. See 'return_one_based_indices' for important information.
See Also
Other atlas functions:
get.atlas.region.names()
,
group.agg.atlas.native()
,
group.agg.atlas.standard()
,
group.annot()
,
group.label.from.annot()
,
label.to.annot()
,
regions.to.ignore()
,
spread.values.over.annot()
,
spread.values.over.hemi()
,
spread.values.over.subject()
,
subject.annot()
,
subject.atlas.agg()
,
subject.label.from.annot()
,
subject.lobes()