Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

getpwdcmd error in mne.bem.make_scalp_surfaces #13133

Open
darcywaller opened this issue Feb 27, 2025 · 5 comments
Open

getpwdcmd error in mne.bem.make_scalp_surfaces #13133

darcywaller opened this issue Feb 27, 2025 · 5 comments

Comments

@darcywaller
Copy link

I am receiving an error when running the make_scalp_surfaces function in a Jupyter notebook. The following command
mne.bem.make_scalp_surfaces(subject=subject,subjects_dir=subjects_dir,mri='T1.mgz')

outputs
1. Creating a dense scalp tessellation with mkheadsurf...
Running subprocess: mkheadsurf -subjid sub-104 -srcvol T1.mgz -thresh1 20 -thresh2 20
getpwdcmd: Command not found.

with the verbose error log displaying an error in run_subprocess that leads to
CalledProcessError: Command '['mkheadsurf', '-subjid', 'sub-104', '-srcvol', 'T1.mgz', '-thresh1', '20', '-thresh2', '20']' returned non-zero exit status 1..

Freesurfer is loaded with FREESURFER_HOME defined and subject and subjects_dir are certainly defined and do not generate errors when running mne.bem.make_flash_bem in the previous cell.

I'm running MNE version 1.8.0 and freesurfer version 7.3.2. Could you please advise what might be the issue?

Copy link

welcome bot commented Feb 27, 2025

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

@larsoner
Copy link
Member

Can you successfully run mkheadsurf --help on your system?

@darcywaller
Copy link
Author

Yes! mkheadsurf --help is successfully returning the function documentation in the terminal and with ! in my jupyter notebook.

@shresth-keshari
Copy link
Contributor

@darcywaller You're right that FREESURFER_HOME is set correctly, especially since mne.bem.make_flash_bem is working. However, make_scalp_surfaces specifically relies on mkheadsurf, which isn't used in make_flash_bem.

Try running the command directly in a terminal:
mkheadsurf -subjid sub-104 -srcvol T1.mgz -thresh1 20 -thresh2 20
If it works here but fails in Jupyter, the issue is with Jupyter’s environment.
If it fails here too, FreeSurfer itself may be misconfigured.

@darcywaller
Copy link
Author

Running that full mkheadsurf command in both the terminal and the jupyter notebook still produces
getpwdcmd: Command not found.

I'm assuming this is a freesurfer bug and can work with my local IT team or freesurfer support (it's a Linux module I cannot change the version of) to try to resolve.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants