File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Improved error message when FreeSurfer executable is not found, by :newcontrib: `Ayushi Satodiya `.
Original file line number Diff line number Diff line change 3535.. _Ashley Drew : https ://github . com /ashdrew
3636.. _Asish Panda : https ://github . com /kaichogami
3737.. _Austin Hurst : https ://github . com /a -hurst
38+ .. _Ayushi Satodiya : https ://github . com /ayuclan
3839.. _Beige Jin : https ://github . com /BeiGeJin
3940.. _Ben Beasley : https ://github . com /musicinmybrain
4041.. _Benedikt Ehinger : https ://www . benediktehinger . de
Original file line number Diff line number Diff line change @@ -1313,7 +1313,19 @@ def make_watershed_bem(
13131313 f"\n Results dir = { ws_dir } \n Command = { ' ' .join (cmd )} \n "
13141314 )
13151315 os .makedirs (op .join (ws_dir ))
1316- run_subprocess_env (cmd )
1316+ try :
1317+ run_subprocess_env (cmd )
1318+ except FileNotFoundError as e :
1319+ raise RuntimeError (
1320+ "FreeSurfer executable 'mri_watershed' not found.\n \n "
1321+ "This usually means FreeSurfer is not properly configured.\n "
1322+ "Make sure:\n "
1323+ "- FREESURFER_HOME is set\n "
1324+ "- $FREESURFER_HOME/bin is in your PATH\n "
1325+ "- You started Python/Jupyter from a terminal where "
1326+ "SetupFreeSurfer.sh is sourced\n \n "
1327+ "See https://mne.tools/stable/install/index.html for details."
1328+ ) from e
13171329 del tempdir # clean up directory
13181330 if op .isfile (T1_mgz ):
13191331 new_info = _extract_volume_info (T1_mgz )
You can’t perform that action at this time.
0 commit comments