View source: R/write_cifti_fs.R
| write.fs.series.cifti | R Documentation |
.dtseries file.Write a per-vertex time series (or several structures at once) to a CIFTI-2
dense series file. This is the inverse of read.fs.series.cifti.
write.fs.series.cifti(
filepath,
data,
template = NULL,
structure = NULL,
start = 0,
step = 1,
unit = "SECOND",
metadata = NULL
)
filepath |
character string, the path of the file to write. The name should end
with |
data |
numeric matrix or named list, the data: a matrix with one row per vertex of the complete surface and one column per series point (time point), or a named list of such matrices per structure. |
template |
character string (the path of a CIFTI-2 file), an |
structure |
character string or |
start |
numeric, the value of the first series point, see
|
step |
numeric, the difference between consecutive series points. |
unit |
character string, the unit of the series, one of 'SECOND', 'HERTZ', 'METER' or 'RADIAN'. |
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.parcellation.cifti()
template <- system.file("extdata", "cifti", "tiny.dscalar.nii", package = "freesurferformats")
series <- matrix(seq_len(10 * 3), nrow = 10L) # 10 vertices (lh), 3 time points
out_file <- file.path(tempdir(), "written.dtseries.nii")
write.fs.series.cifti(out_file, series, template = template, structure = "lh", step = 0.72)
dim(read.fs.series.cifti(out_file, "lh"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.