Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13790.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved error message when FreeSurfer executable is not found, by `Ayushi Satodiya`_.
3 changes: 0 additions & 3 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
.. _Jukka Nenonen: https://www.linkedin.com/pub/jukka-nenonen/28/b5a/684
.. _Jussi Nurminen: https://github.com/jjnurminen
.. _Kaisu Lankinen: http://bishoplab.berkeley.edu/Kaisu.html
.. _Kalle Makela: https://github.com/Kallemakela
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that! The accidental deletions were caused by Ctrl+Z in my editor. I've restored all the missing entries now.

.. _Katarina Slama: https://github.com/katarinaslama
.. _Katia Al-Amir: https://github.com/katia-sentry
.. _Kay Robbins: https://github.com/VisLab
Expand All @@ -188,7 +187,6 @@
.. _Leonardo Barbosa: https://github.com/noreun
.. _Leonardo Rochael Almeida: https://github.com/leorochael
.. _Liberty Hamilton: https://github.com/libertyh
.. _Lifeng Qiu Lin: https://github.com/Gnefil
.. _Lorenzo Desantis: https://github.com/lorenzo-desantis/
.. _Lukas Breuer: https://www.researchgate.net/profile/Lukas-Breuer-2
.. _Lukas Gemein: https://github.com/gemeinl
Expand Down Expand Up @@ -258,7 +256,6 @@
.. _Paul Pasler: https://github.com/ppasler
.. _Paul Roujansky: https://github.com/paulroujansky
.. _Pavel Navratil: https://github.com/navrpa13
.. _Pavel Popov: https://github.com/paavalipopov
.. _Peter Molfese: https://github.com/pmolfese
.. _Phillip Alday: https://palday.bitbucket.io
.. _Pierre Ablin: https://pierreablin.com
Expand Down
14 changes: 13 additions & 1 deletion mne/bem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,19 @@ def make_watershed_bem(
f"\nResults dir = {ws_dir}\nCommand = {' '.join(cmd)}\n"
)
os.makedirs(op.join(ws_dir))
run_subprocess_env(cmd)
try:
run_subprocess_env(cmd)
except FileNotFoundError as e:
raise RuntimeError(
"FreeSurfer executable 'mri_watershed' not found.\n\n"
"This usually means FreeSurfer is not properly configured.\n"
"Make sure:\n"
"- FREESURFER_HOME is set\n"
"- $FREESURFER_HOME/bin is in your PATH\n"
"- You started Python/Jupyter from a terminal where "
"SetupFreeSurfer.sh is sourced\n\n"
"See https://mne.tools/stable/install/index.html for details."
) from e
del tempdir # clean up directory
if op.isfile(T1_mgz):
new_info = _extract_volume_info(T1_mgz)
Expand Down
Loading