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

Chris Filo Gorgolewski krzysztof.gorgolewski at gmail.com
Mon Aug 10 19:31:53 CEST 2015


Hi,
Do you get the same error with the most up to date version of Nipype (0.10)?

Best,
Chris

PS please use neurostars.org for user support next time.

On Mon, Aug 10, 2015 at 10:26 AM, Katie Surrence <katiesurrence at gmail.com>
wrote:

> 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
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150810/57aa375c/attachment.html>


More information about the Neuroimaging mailing list