ReconAll not found

Hi all,

I have been trying to run recon-all using ReconAll from nipype.interfaces.freesurfer but getting an error that recon-all can’t be found. I can run it just fine from terminal, however. I am on Ubuntu 18.04 running nipype 1.1.3 and Freesurfer 6.0.0. How do I tell nipype where to find Freesurfer?

File “/home/lars/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py”, line 522, in run
runtime = self._run_interface(runtime)
File “/home/lars/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py”, line 1029, in _run_interface
runtime.hostname))
OSError: No command “recon-all” found on host lars-GE63-7RD. Please check that the corresponding package is installed.

I’m using this schema:
from nipype.interfaces.freesurfer import ReconAll
reconall = ReconAll()
reconall.inputs.subject_id = ‘foo’
reconall.inputs.directive = ‘all’
reconall.inputs.subjects_dir = ‘.’
reconall.inputs.T1_files = ‘structural.nii’
reconall.run()

If the FREESURFER_HOME environment variable is defined, nipype should be able to find recon-all.

Hi, thank you for your reply. I have an update. The exact same lines of code work when using IPython and Jupyter Notebook, but return the error described in my inital post when using PyCharm IDE. Do you have a suggestion on how to identify the problem with PyCharm? Does it maybe not have access to my environmental variables and if so, how do I grant them?

EDIT: Using PyCharm’s Environment variables and adding “FREESURFER_HOME=/usr/local/freesurfer” does not do the trick.

EDIT2: Got it to work by adding FREESURFER_HOME to my ~/.profile in addition to my ~/.bashrc

1 Like