Skip to content
Open
Changes from all commits
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
13 changes: 12 additions & 1 deletion mne/bem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,18 @@ 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:
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.

Suggested change
except FileNotFoundError:
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 MNE installation documentation for details."
)
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.

Suggested change
)
) from e

del tempdir # clean up directory
if op.isfile(T1_mgz):
new_info = _extract_volume_info(T1_mgz)
Expand Down
Loading