gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
592 stars 138 forks source link

Feature-request/bug: Pycortex readout of new fmriprep format #432

Open ChristianNSchmitz opened 2 years ago

ChristianNSchmitz commented 2 years ago

Dear Gallantlab, I would like to use pycortex on a dataset already preprocessed by fmriprep. Until now, pycortex adheres to the old path structure with a derivatives directory containing an fmriprep as well as an freesurfer directory. However, since fMRIPrep 21.0 this appears to be a legacy layout: https://fmriprep.org/en/stable/outputs.html#legacy-layout Do you have plans to update the pycortex readout for fMRIPrep >=21.0?

Thanks and best wishes, Chris

mvdoc commented 2 years ago

Hi Chris, you are welcome to send a pull request with the changes necessary for fMRIPrep >= 21.0. We don't really have the bandwidth now to keep that module maintained (and we don't use fMRIPrep ourselves).

Note however that you can use cortex.freesurfer.import_subj with the freesurfer subject directory generated by fmriprep. This is the standard way in pycortex to import subjects. So something like this should work

import cortex
cortex.freesurfer.import_subj("sub-ABCD", freesurfer_subject_dir="/path/to/freesurfer_dir")

(If you have exported FREESURFER_DIR to your environment, you do not need to pass the kwarg freesurfer_subject_dir).

For the purposes of visualization, the two approaches should be the same.