if (FALSE) {
# Load annotation
annot_file = system.file("extdata", "lh.aparc.annot.gz",
package = "freesurferformats",
mustWork = TRUE);
annot = read.fs.annot(annot_file);
# New method: write the annotation instance:
write.fs.annot(tempfile(fileext=".annot"), fs.annot=annot);
# Old method: write it from its parts:
write.fs.annot(tempfile(fileext=".annot"), length(annot$vertices),
annot$colortable_df, labels_as_colorcodes=annot$label_codes);
}
Run the code above in your browser using DataLab