- freesurfer version: 1.7.4
- operating system: e.g. macOS Ventura 13.0
Hello everyone,
I am stuck on this error message: Command not found: mkheadsurf. If someone can provide some advice on how to fix it, it would be greatly appreciated.
import os
import mne
subjects_dir=“/Applications/freesurfer/7.4.1/subjects/pilot_data”
subject=“sub-01”
os.environ[“FREESURFER_HOME”] = “/Applications/freesurfer/7.4.1”
mne.bem.make_scalp_surfaces(
subject=“sub-01”,
subjects_dir=“pilot_data”,
force=True,
overwrite=False,
no_decimate=False,
threshold=20,
mri=‘T1.mgz’,
verbose=None
)
- Creating a dense scalp tessellation with mkheadsurf…
Running subprocess: mkheadsurf -subjid sub-01 -srcvol T1.mgz -thresh1 20 -thresh2 20
Command not found: mkheadsurf
Traceback (most recent call last):
Cell In[5], line 5
mne.bem.make_scalp_surfaces(
File :12 in make_scalp_surfaces
File /Applications/MNE-Python/.mne-python/lib/python3.10/site-packages/mne/bem.py:2443 in make_scalp_surfaces
run_subprocess(
File :12 in run_subprocess
File /Applications/MNE-Python/.mne-python/lib/python3.10/site-packages/mne/utils/misc.py:131 in run_subprocess
with running_subprocess(command, *args, **kwargs) as p:
File /Applications/MNE-Python/.mne-python/lib/python3.10/contextlib.py:135 in enter
return next(self.gen)
File /Applications/MNE-Python/.mne-python/lib/python3.10/site-packages/mne/utils/misc.py:263 in running_subprocess
p = subprocess.Popen(command, *args, **kwargs)
File /Applications/MNE-Python/.mne-python/lib/python3.10/subprocess.py:971 in init
self._execute_child(args, executable, preexec_fn, close_fds,
File /Applications/MNE-Python/.mne-python/lib/python3.10/subprocess.py:1847 in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘mkheadsurf’
I have verified that the file/script ‘mkheadsurf’ exists in the freesurfer/bin folder.
Advice appreciated. Thank in advance.