How to apply the FreeSurfer aparc+aseg parcellation on CIFTI time series?

Hello everyone,

I am trying to calculate an FC matrix based on rsfMRI data. I used fmriprep to obtain a CIFTI time series, and also the personalised FreeSurfer aparc+aseg parcellation for each subject. I know how to use wb_command -cifti-parcellate to apply a CIFTI label file to a CIFTI timeseries, but I don’t know how to convert the FreeSurfer parcellation into a CIFTI label file. I have used ciftify before, but as it has not been updated in almost 7 years, it doesn’t seem like the best option. Do you know of any other solution - either to just convert the FreeSurfer parcellations into CIFTI labels, or even a completely different way to apply personalised Desikan-Killiany parcellation to CIFTI time series?

if you are comfortable working in R, you can probably do this using the ciftitools R package, and the fslr32k ROI map data from VertexWiseR/data/ROImap_fslr32k.rdata at main · CogBrainHealthLab/VertexWiseR · GitHub

Thank you for the suggestion, but I am not really comfortable with R. I think there must be a way to do this using the commands in freesurfer and wb_command, but I cannot figure it out…

This is what I tried:

  1. I followed the HCP guidelines on how to convert FreeSurfer label files to GIFTI format, and then used these as the left and right cortical surface label inputs into wb_command -cifti-create-label.

  2. For the subcortical volume part, I changed the FreeSurfer aparc+aseg.mgz file into Nifti using mri_convert and then changed it into a label volume using wb_command -volume-label-import.

mri_convert aparc+aseg.mgz aparc+aseg.nii
wb_command -volume-label-import aparc+aseg.nii FreeSurferAllLut.txt aparc+aseg_label.nii -drop-unused-labels

where FreeSurferAllLut.txt is the label table with the following format (first few lines of the file):

LEFT-CEREBRAL-EXTERIOR
1 70 130 180 255
LEFT-CEREBRAL-WHITE-MATTER
2 245 245 245 255
LEFT-CEREBRAL-CORTEX
3 205 62 78 255
LEFT-LATERAL-VENTRICLE
4 120 18 134 255

However, when I run

wb_command -cifti-create-label aparc+aseg_dseg.dlabel.nii \
-left-label aparc_lh.32k_fs_LR.label.gii \
-right-label aparc_rh.32k_fs_LR.label.gii \
-volume aparc+aseg_label.nii aparc+aseg_label.nii

I get the following error:

ERROR: volume label file does not contain any structure names

What could be causing this? I guess the conversion of the parcellation into a label volume was unsuccessfull, but I have no idea what could have gone wrong.