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

View source: R/as.gifti.R

as.metric_giftiR Documentation

Format metric data as a "gifti"

Description

Format a V \times T numeric matrix (V vertices, T measurements) or a length-T list of length-V numeric vectors as a "gifti" 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 \times 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.

Details

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

Value

The "gifti"


ciftiTools documentation built on Oct. 4, 2024, 1:12 a.m.