FSL & Nipype IOError

478 views
Skip to first unread message

CL

unread,
Oct 5, 2014, 9:25:14 PM10/5/14
to nipy...@googlegroups.com
Hello,

I recently installed nipype in a neurodebian virtual box. I believe I have correctly altered the necessary environmental variables in .bashrc for FSL to include-

FSLDIR=/usr/share/fsl/5.0
PATH
=${FSLDIR}/bin:${PATH}
export FSLDIR PATH
. ${FSLDIR}/etc/fslconf/fsl.sh


I am able to run BET, SUSAN ect through terminal, however when I try to run the same commands through nipype in ipython or spyder, I receive the error-

/usr/lib/pymodules/python2.7/nipype/interfaces/fsl/base.py:116: UserWarning: FSL environment variables not set. setting output type to NIFTI
  warnings
.warn(('FSL environment variables not set. setting output '
Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
 
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
    execfile
(filename, namespace)
 
File "/home/brain/.spyder2/.temp.py", line 10, in <module>
    myBet
.run()
 
File "/usr/lib/pymodules/python2.7/nipype/interfaces/base.py", line 946, in run
    runtime
= self._run_interface(runtime)
 
File "/usr/lib/pymodules/python2.7/nipype/interfaces/fsl/preprocess.py", line 142, in _run_interface
    runtime
= super(BET, self)._run_interface(runtime)
 
File "/usr/lib/pymodules/python2.7/nipype/interfaces/base.py", line 1376, in _run_interface
   
(self.cmd.split()[0], runtime.hostname))
IOError: bet could not be found on host neurodebian
Interface BET failed to run.


The code that produced this error was

import nipype.interfaces.fsl as fsl



inPath
= '/home/brain/Desktop/T1.nii.gz'
outPath
='/home/brain/Desktop/T1bet.nii.gz'


myBet
= fsl.BET()
myBet
.inputs.in_file = inPath
myBet
.inputs.out_file = outPath


myBet
.run()


What could cause this? Could it be something specific to neurodebian? Any help would be greatly appreciated.

Thank you!

Satrajit Ghosh

unread,
Oct 5, 2014, 9:36:01 PM10/5/14
to nipy-user
hi,

if outside of python you type 'bet' in the command line it should display it's help. 

perhaps you didn't source the bashrc after modification?

cheers,

satra

--

---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CL

unread,
Oct 14, 2014, 12:10:47 PM10/14/14
to nipy...@googlegroups.com
bashrc has been sourced, I can cd into $FSLDIR. I don't believe the issue is specifically with bet, any FSL tool (I've also tried SUSAN) will give the same error.

Satrajit Ghosh

unread,
Oct 16, 2014, 11:12:19 AM10/16/14
to nipy-user
hi,

if you type bet into the command line, does it actually return help. so here is the sequence you should try in the same terminal (script.py is the code you have):

$ which bet #should return the path to bet
$ python script.py 

cheers,

satra

CL

unread,
Oct 16, 2014, 11:45:22 AM10/16/14
to nipy...@googlegroups.com
Thank you for the assistance, I determined yesterday that iPython and Spyder were using a different shell profile than terminal, and as such did not have access to the environmental variables.
Reply all
Reply to author
Forward
0 new messages