View source: R/write_cifti_fs.R
| write.fs.parcellation.cifti | R Documentation |
.dlabel file.Write per-vertex label keys (one per vertex of the complete surface, per
structure) to a CIFTI-2 dense label file. This is the inverse of
read.fs.parcellation.cifti.
write.fs.parcellation.cifti(
filepath,
data,
template = NULL,
structure = NULL,
label_table = NULL,
map_name = NULL,
metadata = NULL
)
filepath |
character string, the path of the file to write. The name should end
with |
data |
integer vector, matrix or named list, the label keys per vertex, see
|
template |
character string (the path of a CIFTI-2 file), an |
structure |
character string or |
label_table |
data.frame or |
map_name |
character string or |
metadata |
named character vector or |
the axes that were written, invisibly.
Other cifti functions:
cifti.axis.brain.models(),
cifti.axis.from.template(),
cifti.axis.labels(),
cifti.axis.parcels(),
cifti.axis.parcels.from.annot(),
cifti.axis.scalars(),
cifti.axis.series(),
cifti.brain.model.surface(),
cifti.brain.model.volume(),
cifti.dim.labels(),
cifti.file.type.for.axes(),
cifti.grayordinates(),
cifti.header.from.axes(),
cifti.label.table(),
cifti.parcel(),
cifti.parcels(),
cifti.series.info(),
cifti.structure.data(),
cifti.structures(),
cifti.volume(),
print.fs.cifti(),
print.fs.cifti.data(),
print.fs.connectome(),
read.cifti(),
read.cifti.header(),
read.cifti.rows(),
read.fs.connectome.cifti(),
write.cifti(),
write.fs.connectome.cifti(),
write.fs.morph.cifti(),
write.fs.parcellated.cifti(),
write.fs.series.cifti()
template <- system.file("extdata", "cifti", "tiny.dlabel.nii", package = "freesurferformats")
keys <- read.fs.parcellation.cifti(template, "lh")
label_table <- read.fs.parcellation.cifti(template, "lh", with_label_table = TRUE)$label_table
out_file <- file.path(tempdir(), "written.dlabel.nii")
write.fs.parcellation.cifti(out_file, keys, template = template, structure = "lh",
label_table = label_table)
table(read.fs.parcellation.cifti(out_file, "lh"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.