Skip to content

Instantly share code, notes, and snippets.

Case 1
SubjectSource ->['4D.nii']->Spm.Realign->'4D.nii'->FSL.Smooth->'4D.nii'
in contrast to:
SubjectSource ->['4D.nii']->Spm.Realign->['4D.nii']->FSL.Smooth->'4D.nii'
Case 2
SubjectSource ->['4D.nii']->Spm.Realign->'4D.nii'->SPM.Smooth->'4D.nii'->FSL.Bet
even thou SPM.Smooth also accept lists
'''
Created on Apr 7, 2010
@author: filo
'''
from nipype.interfaces.base import traits, isdefined
from enthought.traits.has_traits import HasTraits
class OutputMultiPath(traits.List):
""" Implements a user friendly traits that accepts one or more
'''
Created on Apr 7, 2010
@author: filo
'''
from nipype.interfaces.base import traits, isdefined, TraitedSpec
from enthought.traits.trait_base import _Undefined
class OutputMultiPath(traits.List):
'''
Created on Apr 7, 2010
@author: filo
'''
from nipype.interfaces.base import traits, isdefined, TraitedSpec
from enthought.traits.trait_base import _Undefined
class MultiPath(traits.List):
info_text = 'a list of paths'
filo@filo-dtc:~/workspace/nipype-git/examples$ python spm_tutorial2.py
4.1.5
/usr/lib/pymodules/python2.6/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated
import struct, sets, time
INFO:workflow:in: ('func', 'preproc.realign.infile')
INFO:workflow:in: ('struct', 'preproc.coregister.target')
INFO:workflow:in: ('struct', 'preproc.normalize.source')
INFO:workflow:in: ('subject_id', 'analysis.modelspec.subject_id')
INFO:workflow:in: (('subject_id', <function subjectinfo at 0x334e050>), 'analysis.modelspec.subject_info')
INFO:workflow:out: ('analysis.contrastestimate.con_images', 'contrasts.@con')
filo@filo-dtc:~/workspace/nipype-git/examples$ ipython spm_tutorial2.py
4.1.5
/usr/lib/pymodules/python2.6/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated
import struct, sets, time
INFO:workflow:in: ('func', 'preproc.realign.infile')
INFO:workflow:in: ('struct', 'preproc.coregister.target')
INFO:workflow:in: ('struct', 'preproc.normalize.source')
INFO:workflow:in: ('subject_id', 'analysis.modelspec.subject_id')
INFO:workflow:in: (('subject_id', <function subjectinfo at 0x1f320c8>), 'analysis.modelspec.subject_info')
INFO:workflow:out: ('analysis.contrastestimate.con_images', 'contrasts.@con')
from enthought.traits.has_traits import HasTraits
from enthought.traits.trait_base import Undefined
from copy import deepcopy
from nipype.interfaces.traits import File
a = HasTraits()
a.add_trait('foo', File(exists=True))
a.foo = Undefined
from IPython.kernel import client
from nodes import DummyClass #change to wherever you've put DummyClass
taskclient = client.TaskClient()
cmdstr = "result = task.run()"
task = client.StringTask(cmdstr,
push = dict(task=DummyClass()),
pull = 'result')
filo@filo-dtc:~/workspace/nipype$ git checkout 8c388d3262b1b3eedf79
Note: checking out '8c388d3262b1b3eedf79'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
DEBUG:workflow:Collecting precomputed outputs:
DEBUG:workflow:Aggregate: False
DEBUG:workflow:setting input: level1.smooth0->level1.analysis.modelspec30 {'connect': [('smoothed_files', 'functional_runs')]}
DEBUG:workflow:setting node input: functional_runs->['/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf3.nii', '/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf5.nii', '/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf7.nii', '/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf10.nii']
DEBUG:workflow:setting nodelevel input functional_runs = ['/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf3.nii', '/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf5.nii', '/media/sdb2/nipype_examples/bootstrapping/workingdir/level1/_subject_id_s1/smooth/srf7.nii', '/media/sdb2/nipype_examples/bootstrapping/worki