Problem with running some Nipype-FSL interface

239 views
Skip to first unread message

Augustine Koh

unread,
Mar 8, 2014, 11:31:28 PM3/8/14
to nipy...@googlegroups.com
Dear all,

I've recently managed to install nipype and all its dependencies using the miniconda distribution, and also have FSL already installed on my Macbook (OS is MAC OS X version 10.9.2). When I ran the test for nipype installation, I obtained no errors, but there were some skips - Does this indicate some kind of problem?

Everything seemed ok, so I decided to proceed with a simple running of an interface on the test data just to be sure. After launching ipython, I keyed in some lines of codes that I found on https://github.com/nipy/nipype/blob/b1b78251dfd6f3b60c6bc63f79f86b356a8fe9cc/nipype/interfaces/fsl/preprocess.py 
as shown below:

Last login: Sun Mar  9 12:19:26 on ttys001

Hello Auggy!

Kohs-MacBook-Pro:~ Kohaugustine$ PWD

/Users/Kohaugustine

Kohs-MacBook-Pro:~ Kohaugustine$ ipython

Python 2.7.6 |Continuum Analytics, Inc.| (default, Jan 10 2014, 11:23:15) 

Type "copyright", "credits" or "license" for more information.


IPython 1.1.0 -- An enhanced Interactive Python.

?         -> Introduction and overview of IPython's features.

%quickref -> Quick reference.

help      -> Python's own help system.

object?   -> Details about 'object', use 'object??' for extra details.


In [1]: from nipype.interfaces import fsl


In [2]: from nipype.testing import example_data


In [3]: btr = fsl.BET()


In [4]: btr.inputs.in_file = example_data('structural.nii')


In [5]: btr.inputs.frac = 0.7


In [6]: res = btr.run() # doctest: +SKIP

140309-12:21:45,573 interface INFO:

stderr 2014-03-09T12:21:45.573045:** ERROR (nifti_image_read): short header read '/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural.nii'

140309-12:21:45,573 interface INFO:

stderr 2014-03-09T12:21:45.573045:** ERROR: nifti_image_open(/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural): bad header info

140309-12:21:45,573 interface INFO:

stderr 2014-03-09T12:21:45.573045:ERROR: failed to open file /users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural

140309-12:21:45,573 interface INFO:

stderr 2014-03-09T12:21:45.573045:Image Exception : #22 :: ERROR: Could not open image /users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural

140309-12:21:45,573 interface INFO:

stderr 2014-03-09T12:21:45.573045:libc++abi.dylib: terminating with uncaught exception of type RBD_COMMON::BaseException

140309-12:21:45,756 interface INFO:

stderr 2014-03-09T12:21:45.756905:/usr/local/fsl/bin/bet: line 392:  3247 Abort trap: 6           ${FSLDIR}/bin/bet2 $IN $OUT $bet2opts

---------------------------------------------------------------------------

RuntimeError                              Traceback (most recent call last)

<ipython-input-6-307d33c29787> in <module>()

----> 1 res = btr.run() # doctest: +SKIP


/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/interfaces/base.pyc in run(self, **inputs)

    944                         version=self.version)

    945         try:

--> 946             runtime = self._run_interface(runtime)

    947             outputs = self.aggregate_outputs(runtime)

    948             runtime.endTime = dt.isoformat(dt.utcnow())


/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/interfaces/fsl/preprocess.pyc in _run_interface(self, runtime)

    142         runtime = super(BET, self)._run_interface(runtime)

    143         if runtime.stderr:

--> 144             self.raise_exception(runtime)

    145         return runtime

    146 


/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/interfaces/base.pyc in raise_exception(self, runtime)

   1317         message += "Standard error:\n" + runtime.stderr + "\n"

   1318         message += "Return code: " + str(runtime.returncode)

-> 1319         raise RuntimeError(message)

   1320 

   1321     @classmethod


RuntimeError: Command:

bet /users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural.nii /Users/Kohaugustine/structural_brain.nii.gz -f 0.70

Standard output:


Standard error:

** ERROR (nifti_image_read): short header read '/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural.nii'

** ERROR: nifti_image_open(/users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural): bad header info

ERROR: failed to open file /users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural

Image Exception : #22 :: ERROR: Could not open image /users/kohaugustine/continuum_miniconda/miniconda/lib/python2.7/site-packages/nipype/testing/data/structural

libc++abi.dylib: terminating with uncaught exception of type RBD_COMMON::BaseException

/usr/local/fsl/bin/bet: line 392:  3247 Abort trap: 6           ${FSLDIR}/bin/bet2 $IN $OUT $bet2opts

Return code: 0

Interface BET failed to run. 


In [7]: 


and I ran into the problem as shown above? What could have been the cause? Could it be something to do with the path?

Apart from this problem, just a small question here regarding obtaining the help info for the various interfaces available. I've noticed that for some of the interfaces, we key in fsl.FAST? to get the help info, whereas for some of the other interfaces, we key in in this format: fsl.BET.help().    How do we know when we should use which format to get the help info?

Thank you

Cheers,
Augustine

Michael Waskom

unread,
Mar 9, 2014, 3:48:19 PM3/9/14
to nipy...@googlegroups.com
There's not any actual data in that file, it's an empty file that is fine for testing the interface because it "exists", but it's not actually a structural image (note how the doctests doesn't actually run the btr.run() line). Try running BET on one of your own files.

Augustine Koh

unread,
Mar 16, 2014, 9:44:48 AM3/16/14
to nipy...@googlegroups.com
Dear Michael,

Thanks for your elucidation! the interface worked when I ran it on my own file!

Cheers
Reply all
Reply to author
Forward
0 new messages