...
HCP has developed 3 ways to read and write CIFTI files in MATLAB:
BETA TESTING, FOR MRI USERS (This tool is mostly stable, and will become our Our primary recommendation soon):
I (formerly option C). A new CIFTI library has been written for matlab, which is backwards compatible with ciftiopen, etc from option II, but provides information about what each CIFTI index represents. There are no external dependencies when reading CIFTI-2 files, which should cover all HCP CIFTI files in virtually all data releases. To read CIFTI-1 files with this code, install Connectome Workbench v1.0 or newer, available here. If you you feel comfortable trying this library that we have been using for internal processing for a short time, it is available at This library is available at https://github.com/Washington-University/cifti-matlab.
STABLE:
II (formerly option B). Using Workbench v1.0 or newer + GIFTI toolbox code (descriptions below). This method has the limitation of not telling you what the CIFTI indices represent (what vertex or voxel, etc) and it creates intermediate files (that are deleted as part of the provided code). For this approach you need a couple of prerequisites:
...
III (formerly option A). PLEASE DON'T USE THIS OPTION WITH HCP MRI DATA AT THIS TIME. Using the code developed for the HCP megconnectome data analysis pipelines that are implemented using the FieldTrip toolbox. The code is available in stand-alone format from https://github.com/Washington-University/cifti-matlab/releases/tag/v1-final. This approach loads the complete CIFTI XML header information into a MATLAB structure, including information on what each CIFTI index represents. Where possible it will also load gifti surface files.
...