I am planning to calculate the functional connectivity matrix based on a customized parcellation of freesurfer. I have the .annot file of freesurfer, and I need the FC matrix based on it. Does anyone know how to do that? I would appreciate it if anyone could give me any idea about this.
Simply read all the files with nibabel. This will give you Numpy arrays, one for labels, one for time series. Then use standard Numpy manipulations to get regions averages, compute connectivity etc.
Thank you so much for your reply, Bertrand!
The .annot file is vertex-based, while the functional data is voxel-based. It seems I can’t process the arrays read by nibabel directly. Besides, the left and right .annot files are separate. Do you have a further idea about this?
(I am trying to use CONN to calculate this surface-based connectivity as well, but it only treated the atlas as an ROI and gave me only one output. If I use the default .annot file of freesurfer (lh.aparc.annot), the output is correct with the FC matrix.)
If your images are samples in volumes, you will make your life easier by relying on a volume-based parcellation. There are then two possibilties:
- Either you rpoject your data to the cortical surface with freesurfer or even nilearn and use freesurfer parcellation
- Or you try to find some colume-based repreosentation of freesurfer parcellation and do your tasks in volume space.
Thanks for your reply.
I am using the mri_label2vol function of freesurfer to convert the .annot file into nifti files, so the parcellation would be volume-based. But nifti files are separate in left and right hemispheres and in fsaverage space, I need to merge left and right nifti files into one first then register that to MNI 152 space.
Do you have an idea about merging .annot or nifti files of left and right hemispheres? Thank you so much!!
I’m not familiar enough with freesurfer, but if you get nifti files kor left and right hemisphere, these probably aren’t volumes but vertex-valued files. There probably exists some sur2vol command in freesurfer ?
Sorry not to help more/