Learn R Programming

ciftiTools (version 0.9.0)

convert_to_dlabel: Convert the intent of a CIFTI file or "xifti" object

Description

Convert the intent of a CIFTI file or "xifti" object

Usage

convert_to_dlabel(
  x,
  cifti_target_fname = NULL,
  values = NULL,
  nsig = Inf,
  colors = "Set2",
  add_white = TRUE,
  return_conversion_table = FALSE
)

convert_to_dscalar(x, cifti_target_fname = NULL, names = NULL)

convert_to_dtseries( x, cifti_target_fname = NULL, time_start = 0, time_step = 1, time_unit = c("second", "hertz", "meter", "radian") )

convert_xifti( x, to = c("dscalar", "dtseries", "dlabel"), cifti_target_fname = NULL, ... )

Arguments

x

The CIFTI file name or "xifti" object to convert.

cifti_target_fname

File name for the converted CIFTI. Only used if x is a CIFTI file name. If NULL (default), will use the same name as x but with the extension updated.

values

(Optional) A vector of the original data values. They should all be unique. They may not all occur in the "xifti" data, but every datapoint in the "xifti" must occur in values. Data will be mapped to integers from $0$ to $N-1$ (the "keys"), with $N$ being the number of values. They will be sorted.

If values is a named vector, the rownames of the label table in the resulting "xifti" will be those names. Otherwise, the rownames will be the values themselves.

nsig

Take this many significant digits for the data values. If Inf (default), do not round.

colors

(Optional) "ROY_BIG_BL", the name of a ColorBrewer palette (see RColorBrewer::brewer.pal.info and colorbrewer2.org), the name of a viridisLite palette, or a character vector of colors. Default: "Set2".

add_white

Append white to the beginning of the colors? Default: TRUE.

return_conversion_table

Return the conversion table along with the converted "xifti"? Default: FALSE

names

The column names. If NULL (default), will be set to "Column 1", "Column 2", ... .

time_start, time_step, time_unit

(Optional) metadata for the new dtseries

to

The desired intent: "dscalar" (default), "dtseries", or "dlabel"

...

Only used if x is a "xifti" object. Additional options specific to the target type and intent, e.g. for convert_to_dlabel.

Value

If x is a CIFTI, the target is a "dlabel" and return_conversion_table, a length-2 list with the first entry being the ".dlabel" "xifti" and the second being the conversion table. Otherwise, the "xifti" or the output CIFTI file name is directly returned.

Functions

  • convert_to_dlabel: Give the ".dlabel" intent (code 3007/ConnDenseLabel) to an input "xifti". Will use the same label table for each data column.

  • convert_to_dscalar: Give the ".dscalar" intent (code 3006/ConnDenseScalar) to an input CIFTI file or "xifti" object.

  • convert_to_dtseries: Give the ".dtseries" intent (code 3002/ConnDenseSeries) to an input "xifti" object.

See Also

Other functions for manipulating `xifti` objects: add_surf(), apply_xifti(), combine_xifti(), merge_xifti(), newdata_xifti(), remove_xifti(), select_xifti(), transform_xifti()