[Neuroimaging] FmriRealign4d: TypeError: __init__() takes at least 4 arguments (7 given)

Katie Surrence katiesurrence at gmail.com
Mon Aug 10 19:26:01 CEST 2015


Dear Python neuroimagers,

I'm brand new to NiPype, so excuse the very basic question.

I am trying to use the FmriRealign4d algorithm.

Based on the example here
<http://nipy.sourceforge.net/nipype/interfaces/generated/nipype.interfaces.nipy.preprocess.html>
I wrote the following to try to slice time correct/realign a single run:

_____________________________

from nipype.interfaces.nipy.preprocess import FmriRealign4d
import os

pth = "/media/truecrypt1/SocCog/tmp1/run1L2"

infile = os.path.join(pth, '4D.nii')

realigner = FmriRealign4d()
realigner.inputs.in_file = [infile]
realigner.inputs.tr = 2.2
realigner.inputs.slice_order = range(0, 36, 2) + range(1, 35, 2)
realigner.inputs.time_interp = True
res = realigner.run()


_________________________________


(I added the explicit definition of time_interp because I got an error when
I didn't.)

Here's the new error:

_________________________________________

/usr/local/lib/python2.7/dist-
packages/nipype-0.9.2-py2.7.egg/nipype/interfaces/base.py:376: UserWarning:
Input slice_order requires inputs: time_interp
  warn(msg)
Traceback (most recent call last):
  File "/home/katie/ks_scripts/python_scripts/pimriscripts/real4d.py", line
17, in <module>
    res = realigner.run()
  File
"/usr/local/lib/python2.7/dist-packages/nipype-0.9.2-py2.7.egg/nipype/interfaces/base.py",
line 946, in run
    runtime = self._run_interface(runtime)
  File
"/usr/local/lib/python2.7/dist-packages/nipype-0.9.2-py2.7.egg/nipype/interfaces/nipy/preprocess.py",
line 162, in _run_interface
    start=self.inputs.start)
TypeError: __init__() takes at least 4 arguments (7 given)
Interface FmriRealign4d failed to run.

Process finished with exit code 1

_______________________________________+


I tried following the error in the debugger and it's going so deep into
such a complicated code base it seems very unlikely I'd be able to figure
it out.  Does anyone have any idea how to make this run?  I know it's
highly possible I'm doing something very obvious wrong.

Thanks very much for your help.

Best,
Katie

-- 
Katie Surrence, M.S.
Research Coordinator
Social Cognition Laboratory
New York State Psychiatric Institute
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150810/006fae49/attachment.html>


More information about the Neuroimaging mailing list