"xifti"
Coerce a path to a GIFTI file, metric or label "gifti"
object,
data matrix or vector to a data matrix representing cortical data
(and optionally a corresponding mask).
That is, entries for xifti$data$cortex_\[left/right\]
and
xifti$meta$cortex$medial_wall_mask$\[left/right\]
. If cortex
is
a path to a GIFTI file or a metric "gifti"
, any column names or
a non-empty label table will also be extracted.
make_cortex(
cortex,
mwall = NULL,
idx = NULL,
cortex_is_masked = NULL,
rm_blank_mwall = TRUE,
rm_bad_mwall = TRUE,
mwall_values = NULL,
side = NULL,
mwall_source = NULL
)
A list with components "data", "mwall", "col_names" and "labels".
A path to a metric or label GIFTI file, metric or label
"gifti"
, or numeric vector/matrix representing cortical data.
If cortex
is a path to a GIFTI file or "gifti"
,
the column names and the label table will also be extracted if they
exist in the GIFTI.
A path to a metric or label GIFTI file, metric or label "gifti"
,
\(V_{[L/R]} x 1\) logical matrix or length \(V_{[L/R]}\) logical vector
representing the medial wall mask. FALSE
values should indicate
vertices that make up the medial wall. If the medial wall is unknown, use
NULL
(default).
Only applies if cortex
is a GIFTI file path. This is
a numeric vector indicating the data indices to read. If NULL
(default), read all the data. Must be a subset of the indices present in the
file, or an error will occur.
Has the medial wall been masked from cortex
yet? NULL
(default) indicates whether it has been masked or not is
unknown.
If !cortex_is_masked
, cortex
should be \(V_{[L/R]} x T\).
If cortex_is_masked
, cortex
should be
\((V_{[L/R]} - mwall_{[L/R]}) x T\). If is.null(cortex_is_masked)
,
it may be either or.
If the medial wall mask is all TRUE
(indicating no medial wall vertices), should it be discarded? Default:
TRUE
. If FALSE
, keep it.
If the medial wall mask doesn't match up with the
data (e.g. the vertex count doesn't add up), should it be discarded?
Default: TRUE
. If FALSE
, raise an error.
If the medial wall mask was not provided (or if it was
discarded), infer it from rows in cortex
that are constantly one of
these values. Example: c(0, NA, NaN)
. If NULL
(default),
do not attempt to infer the medial wall mask from the data values.
"left"
or "right"
? Just used to print warnings.
Description of where the mwall came from. Just used to print warnings.