| Literature DB >> 35051581 |
Damon D Pham1, John Muschelli2, Amanda F Mejia3.
Abstract
There is significant interest in adopting surface- and grayordinate-based analysis of MR data for a number of reasons, including improved whole-cortex visualization, the ability to perform surface smoothing to avoid issues associated with volumetric smoothing, improved inter-subject alignment, and reduced dimensionality. The CIFTI grayordinate file format introduced by the Human Connectome Project further advances grayordinate-based analysis by combining gray matter data from the left and right cortical hemispheres with gray matter data from the subcortex and cerebellum into a single file. Analyses performed in grayordinate space are well-suited to leverage information shared across the brain and across subjects through both traditional analysis techniques and more advanced statistical methods, including Bayesian methods. The R statistical environment facilitates use of advanced statistical techniques, yet little support for grayordinates analysis has been previously available in R. Indeed, few comprehensive programmatic tools for working with CIFTI files have been available in any language. Here, we present the ciftiTools R package, which provides a unified environment for reading, writing, visualizing, and manipulating CIFTI files and related data formats. We illustrate ciftiTools' convenient and user-friendly suite of tools for working with grayordinates and surface geometry data in R, and we describe how ciftiTools is being utilized to advance the statistical analysis of grayordinate-based functional MRI data.Entities:
Keywords: Grayordinate; Toolbox; fMRI
Mesh:
Year: 2022 PMID: 35051581 PMCID: PMC9119143 DOI: 10.1016/j.neuroimage.2022.118877
Source DB: PubMed Journal: Neuroimage ISSN: 1053-8119 Impact factor: 7.400
Fig. 1.Summary of ciftiTools functionality.
ciftiTools supports reading and writing (A), visualization (B), Workbench processing (C), and data manipulation and math (D) for CIFTI- and GIFTI-format data.
Summary of comparison between programmatic tools for CIFTI and GIFTI files.
Checkmarks are assigned if the tool (rows) directly enables a user to complete the task (columns). A “3” for CIFTI functionalities in ciftiTools indicates that only three CIFTI intents are supported: “dtseries,” “dscalar,” and “dlabel.” Moreover, tools receiving checkmarks in the same column may enable the task to different extents. For example, the manipulation functions in hcp-utils support normalizing data values and applying a parcellation, whereas those in cifti-matlab support data and metadata replacement. While ciftiTools is designed to support all listed tasks, other tools are not meant to support all these tasks on their own. For example, hcp-utils is designed to be used in conjunction with NiBabel and nilearn. Lastly, note that some tools have external dependencies: ciftiTools also requires the Connectome Workbench for most of its functionality, ggsegExtra requires FreeSurfer for reading in new parcellations, and ciftify uses FSL, FreeSurfer and the Connectome Workbench to convert and manipulate CIFTI files. An asterisk has been added to the “Language” column for these tools to indicate the need for additional software.
| Language | Read | Write | Plot | Manipulate | |||||
|---|---|---|---|---|---|---|---|---|---|
| CIFTI | GIFTI | CIFTI | GIFTI | Cortex | Subcortex | CIFTI | GIFTI | ||
| ciftiTools | R * | 3 | ✓ | 3 | ✓ | ✓ | ✓ | 3 | ✓ |
| cifti | R | ✓ | |||||||
| gifti | R | ✓ | ✓ | ||||||
| freesurferformats, fsbrain | R | ✓ | ✓ | ✓ | ✓ | ||||
| ggseg, ggseg3d, ggsegExtra | R * | ✓ | ✓ | ||||||
| ciftify | Python * | ✓ | ✓ | ✓ | |||||
| NiBabel | Python | ✓ | ✓ | ✓ | ✓ | ✓ | |||
| nilearn | Python | ✓ | ✓ | ✓ | |||||
| hcp-utils | Python | ✓ | ✓ | ✓ | |||||
| cifti-matlab | MATLAB | ✓ | ✓ | ✓ | |||||
| GIfTI | MATLAB | ✓ | ✓ | ✓ | |||||
Fig. 2.The structure of a “xifti“ object.
A “xifti“ object can be constructed from CIFTI data and GIFTI surface geometry data using read_xifti. The object is a nested, ordered list, and any components that are absent will be NULL, for example if the CIFTI did not contain every brain structure or if no surfaces were provided. Using read_xifti2 or as.xifti, it is also possible to construct a “xifti” object from GIFTI files which contain cortical data and/or a NIFTI file which contains subcortical data, rather than from a CIFTI file. In this case, the CIFTI metadata (intent, brain structures, intent-specific metadata, misc.) will be absent.
Fig. 3.First fMRI volume before and after smoothing with smooth_xifti.
Fig. 4.Schaefer parcellation and PCC parcel.
Fig. 5.PCC seed correlation.
Connectome Workbench commands used by ciftiTools.
Note that any Workbench command, including those not currently integrated in the package, can be executed from within R using the ciftiTools function run_wb_cmd, which conveniently appends the Workbench path to the beginning of the command. Workbench commands can also be executed within the R environment using the base R function system.
| ciftiTools function | Workbench command(s) it interfaces with |
|---|---|
| info_cifti | -nifti-information |
| read_xifti | -cifti-convert, -metric-merge |
| write_xifti | -cifti-create-dense-timeseries, -cifti-create-dense-scalar, -cifti-create-label |
| separate_cifti | -cifti-separate |
| write_nifti | -volume-label-import |
| resample_xifti and resample_gifti | -cifti-separate, -metric-resample, -label-resample, -surface-resample, -surface-create-sphere, -surface-flip-lr, -set-structure, |
| resample_cifti_from_template | -cifti-resample |
| smooth_xifti | -cifti-smoothing, -cifti-change-mapping |
| smooth_gifti | -metric-smoothing |
| convert_xifti | -cifti-change-mapping |
Commonly used functions currently available in ciftiTools.
| Reading in CIFTI or GIFTI data | |
|---|---|
| read_xifti | Read in a CIFTI file as a“xifti“ |
| read_xifti2 | Read in GIFTI files as a“xifti“ |
| as.xifti | Combine numeric data to form a“xifti“ |
| read_surf | Read in a surface GIFTI file as a“surf“ |
| info_cifti | Read the metadata in a CIFTI file |
| load_surf | Read in a surface included in“ciftiTools“ |
| load_parc | Read in a parcellation included in“ciftiTools“ |
|
| |
| write_cifti | Write a“xifti“ to a CIFTI file |
| write_cifti2 | Write a“xifti“ to GIFTI and NIFTI files |
| write_metric_gifti | Write a numeric data matrix to a metric GIFTI file |
| write_surf_gifti | Write a“surf“ to a surface GIFTI file |
| write_subcort_nifti | Write subcortical data to NIFTI files |
| separate_cifti | Separate a CIFTI file into GIFTI and NIFTI files |
|
| |
| apply_xifti | Apply a function along the rows or columns of the“xifti“ data matrix |
| combine_xifti | Combine multiple“xifti“s with non-overlapping brain structures |
| convert_xifti | Convert the intent of a“xifti“ |
| merge_xifti | Concatenate data matrices from multiple“xifti“s |
| newdata_xifti | Replace the data matrix in a“xifti“ |
| remove_xifti | Remove a brain structure or surface from a“xifti“ |
| select_xifti | Select data matrix columns of a“xifti“ |
| transform_xifti | Apply a univariate transformation to a“xifti“ or pair of“xifti“s |
| add_surf | Add surfaces to a“xifti“ |
| move_from_mwall | Move medial wall vertices back into the“xifti“ data matrix |
| move_to_mwall | Move rows with a certain value into the“xifti“ medial wall mask |
|
| |
| summary and print | Summarize the contents |
| as.matrix | Convert data to a locations by measurements numeric matrix |
| dim | Obtain number of locations and number of measurements |
| plot | Visualize the cortical surface and/or subcortical data |
| +, -, *, /, ˆ, %%, %/%, ==, ! = | Operation between a“xifti“ and a scalar, or between two“xifti“s |
| abs, ceiling, exp, floor, log, round, sign, sqrt | Univariate transformation of“xifti“ data |
|
| |
| read_surf | Read in a surface GIFTI file as a“surf“ |
| is.surf | Verify a“surf“ |
| write_surf_gifti | Write a“surf“ to a surface GIFTI file |
| view_surf | Visualize a“surf“ |
| resample_surf | Resample a“surf“ |
| rotate_surf | Rotate the geometry of a“surf“ |