ciftiTools (version 0.1.6.0)

as.metric_gifti: Format metric data as a "gifti" object

Description

Format a \(V x T\) numeric matrix (V vertices, T measurements) or a length-T list of length-V numeric vectors as a "gifti" object using a template "gifti". The brain hemisphere (left or right) must be indicated.

Usage

as.metric_gifti(
  data,
  hemisphere = c("left", "right"),
  intent = "NONE",
  data_type = NULL
)

Arguments

data

\(V x T\) numeric matrix, or length \(T\) list of length \(V\) numeric vectors

hemisphere

The side of the brain the data represents: "left" (default) or "right". Used to fill the "AnatomicalStructurePrimary" metadata field.

intent

The NIFTI intent, with prefix "NIFTI_INTENT_*". Default: "NONE". For a list of intents see https://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/group__NIFTI1__INTENT__CODES.html/document_view

data_type

The NIFTI type of data: "NIFTI_TYPE_INT32" or "NIFTI_TYPE_FLOAT32". Can also be NULL (default), in which case the NIFTI type will be inferred from data.

Value

The "gifti" object

Details

If data is already a "gifti" object, data$data will be used and any metadata will be overwritten by the template or discarded.