Hi guys. Following the suggestion of @larsoner in this other topic, I tried to install the latest main of mne-bids-pipeline from GitHub to make sure to be up to date.
Now I’m encountering new sorts of errors that I can’t fix.
During preprocessing/_06a2_find_ica_artifacts step, the pipeline throws a FileNotFoundError related to:
So latest main added support for handling sessions differently (hopefully better!). @drammock should be able to comment on whether the behavior above is expected (and thus BIDSification was done incorrectly somehow) or if it’s a bug with MNE-BIDS-Pipeline that we should fix. Looks like it expects the FreeSurfer surface to have ses in the path if session is named… but maybe we should fall back to also considering the path without ses …
The first problem I can’t figure out because (1) you didn’t provide the full traceback, (2) the link you provided doesn’t work (returns 404 error), and (3) if I check line number 617 that is indicated in the URL… it doesn’t exist (the file only has 400 lines). Can you provide the full traceback please?
┌────────┬ preprocessing/_06a2_find_ica_artifacts ───────────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/bin/mne_bids_pipeline”, line 8, in
sys.exit(main())
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_main.py”, line 253, in main
step_module.main(config=config_imported)
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/steps/preprocessing/_06a2_find_ica_artifacts.py”, line 615, in main
logs = parallel(
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/steps/preprocessing/_06a2_find_ica_artifacts.py”, line 617, in
cfg=get_config(config=config, subject=subject),
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/steps/preprocessing/_06a2_find_ica_artifacts.py”, line 584, in get_config
runs_tasks=get_runs_tasks(config=config, subject=subject, session=session),
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_config_utils.py”, line 388, in get_runs_tasks
noise_path = _get_noise_path(
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_import_data.py”, line 707, in _get_noise_path
raw_fname = _read_json(_empty_room_match_path(raw_fname, cfg))[“fname”]
File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_io.py”, line 17, in _read_json
with open(fname, encoding=“utf-8”) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/leozm/CRNL_projects/MNEBIDS_mimosa_criticality/data/sample_for_Leonardo/BIDS/derivatives/mne-bids-pipeline/sub-063/meg/sub-063_task-rest_run-01_emptyroommatch.json’
but I’m still getting the same error, the ses folder is skipped:
┌────────┬ preprocessing/_06a2_find_ica_artifacts ────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/bin/mne_bids_pipeline”, line 10, in sys.exit(main()) ~~~~^^ File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/_main.py”, line 253, in main step_module.main(config=config_imported) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/steps/preprocessing/_06a2_find_ica_artifacts.py”, line 615, in main logs = parallel( run_func( …<5 lines>… for subject, session in ss ) File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/steps/preprocessing/_06a2_find_ica_artifacts.py”, line 617, in cfg=get_config(config=config, subject=subject), ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/steps/preprocessing/_06a2_find_ica_artifacts.py”, line 584, in get_config runs_tasks=get_runs_tasks(config=config, subject=subject, session=session), ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/_config_utils.py”, line 390, in get_runs_tasks noise_path = _get_noise_path( mf_reference_run=mf_reference_run, …<4 lines>… kind=“orig”, ) File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/_import_data.py”, line 707, in _get_noise_path raw_fname = _read_json(_empty_room_match_path(raw_fname, cfg))[“fname”] ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env_latest/lib/python3.13/site-packages/mne_bids_pipeline/_io.py”, line 17, in _read_json with open(fname, encoding=“utf-8”) as f: ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: ‘/home/leozm/CRNL_projects/MNEBIDS_mimosa_criticality/data/sample_for_Leonardo_latest_mne/BIDS/derivatives/mne-bids-pipeline/sub-063/meg/sub-063_task-rest_run-01_emptyroommatch.json’