View source: R/write_cifti_fs.R
| write.fs.morph.cifti | R Documentation |
.dscalar file.Write a per-vertex data vector (or several of them, as the maps of the
file) to a CIFTI-2 dense scalar file. This is the inverse of
read.fs.morph.cifti: the data are given for the complete surface, and
the vertices that the file contains are selected with the mapping of a template file
(which is what a grayordinates file needs, since it leaves out the medial wall).
write.fs.morph.cifti(
filepath,
data,
template = NULL,
structure = NULL,
map_names = NULL,
metadata = NULL
)
filepath |
character string, the path of the file to write. The name should end
with |
data |
numeric vector or matrix or named list, the per-vertex data:
The vertex order is the order of the surface mesh, which is also the order in which
|
template |
character string (the path of a CIFTI-2 file), an |
structure |
character string or |
map_names |
character vector 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.parcellated.cifti(),
write.fs.parcellation.cifti(),
write.fs.series.cifti()
template <- system.file("extdata", "cifti", "tiny.dscalar.nii", package = "freesurferformats")
out_file <- file.path(tempdir(), "written.dscalar.nii")
data <- read.fs.morph.cifti(template, "lh")
data[2] <- 555 # change one value
write.fs.morph.cifti(out_file, data, template = template, structure = "lh")
read.fs.morph.cifti(out_file, "lh")[1:3]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.