Freesurfer error on mne-bids-pipeline

Hi all,

I tried the mne-bids-pipeline using the command
mne_bids_pipeline --steps=freesurfer --config config.py.

Freesurfer stops at :

cd /media/robbis/DATA/meg/eeg_project/bids/derivatives/mne-bids-pipeline/freesurfer; ln -s /usr/local/freesurfer/7.3.2/subjects/fsaverage; cd - 

ln: failed to create symbolic link './fsaverage': File exists

As you noticed, I’m running Freesurfer 7.3.2 and the same command ran outside mne-bids-pipeline is running ok.

The config.py is this:

study_name = "eeg_project"
bids_root = "/media/robbis/DATA/meg/eeg_project/bids/"
deriv_root = "/media/robbis/DATA/meg/eeg_project/bids/derivatives/mne-bids-pipeline/reftep"
subjects_dir = "/media/robbis/DATA/meg/eeg_project/bids/derivatives/mne-bids-pipeline/freesurfer/"

# To get all subjects for example:
# from mne_bids import get_entity_vals
# subjects = sorted(get_entity_vals(bids_root, entity_key='subject'))
subjects = ["101", "102", "103", "104", "105", "106", 
            "107", "108", "109", "110", "111"
            ]

run_source_estimation = True
bem_mri_images = "T1"
recreate_bem = False
freesurfer_verbose = True

ch_types = ["eeg"]
runs = ["01"]

baseline = None
reject = None
spatial_filter = None

h_freq = 40
l_freq = None

task = "rest"
task_is_rest = True

epochs_tmin = 0.0
epochs_tmax = 10.0
rest_epochs_overlap = 0.0
rest_epochs_duration = 10.0
baseline = None

parallel_backend = "loky"
dask_open_dashboard = True

log_level = "error"

Is it a version problem or something else?

Thanks in advance,
Roberto

Hello, can you remove fsaverage from /media/robbis/DATA/meg/eeg_project/bids/derivatives/mne-bids-pipeline/freesurfer/ and try again?

Best wishes,
Richard

Hi,

thanks for answering.
I made several (and not systematic) things, among those one was to remove all the folder from and rerun again and so on, but it was failing again.

It turned out that also freesurfer bidsapp throw that exception and I hacked the run.py at line 195:

    # fst_links_to_make = ["fsaverage", "lh.EC_average","rh.EC_average"]
    fst_links_to_make = ["lh.EC_average","rh.EC_average"]

Now it seems to run but I have to be more systematic. I think I will do this when the freesurfer will stop! :sweat_smile:

I’ll keep you updated if you want!

Cheers,
Roberto