error with multiple but not single runs - rsfmri_fsl_compcorr

22 views
Skip to first unread message

Cris Lanting

unread,
Feb 18, 2014, 10:40:24 AM2/18/14
to nipy...@googlegroups.com
Dear all,

I've been trying to set-up a nipype pipeline to analyze resting state data (based on http://nipy.org/nipype/users/examples/rsfmri_fsl_compcorr.html)
If I run the pipeline with one file ('rs1.nii') over multiple subjects ('subject1','subject2') it works like a charm, but if I want to extend it to multiple runs it fails.

This works:
subject_list = ['subject1','subject2']
infosource = pe.Node(interface=util.IdentityInterface(fields=['subject_id']),
                     name="infosource")
infosource.iterables = ('subject_id', subject_list)
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
                                               outfields=['func', 'struct']),
                     name = 'datasource')
datasource.inputs.base_directory = data_dir
datasource.inputs.template = '%s/%s.nii'
# Map field names to individual subject runs.
info = dict(func=[['subject_id', ['rs1']]])

But it fails if I alter the last line into:
info = dict(func=[['subject_id', ['rs1','rs2']]])

It then gives the following error:

TraitError: The 'in_file' trait of a SliceTimerInputSpec instance must be an existing file name, but a value of ['/Users/crislanting/Projects/RestingState/rest/subject2/rs1.nii', '/Users/crislanting/Projects/RestingState/rest/subject2/rs2.nii'] <type 'list'> was specified.


If I look at other examples (e.g., http://nipy.org/nipype/_downloads/fmri_spm.py) it seems it would be fine to define the files the way I did (in a list):
info = dict(func=[['subject_id', ['f3','f5','f7','f10']]],i
            struct=[['subject_id','struct']])

Is there something missing like an iterable over runs or is it something peculiar about traits?
Additionally, is there a simple way to disable the slice-timing as the data is acquired using sparse-sampling (TR = 12 s with a silent ISI of 10 s)? 
(referring to "from nipype.workflows.fmri.fsl import create_resting_preproc")

Cheers,
Cris

Satrajit Ghosh

unread,
Feb 21, 2014, 2:31:14 PM2/21/14
to nipy-user
hi chris,

all the nodes in that workflow are regular nodes.


you would have to rewrite that function using MapNodes at appropriate places.

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/groups/opt_out.

Cris Lanting

unread,
Feb 21, 2014, 5:18:33 PM2/21/14
to nipy...@googlegroups.com
Thanks Satra - a good nudge in the right direction! http://nipy.org/nipype/users/mapnode_and_iterables.html is also quite helpful in retrospect...
I've also (at least conceptually) figured out how to get rid of the slice-timing node.

Cheers,
Cris
Reply all
Reply to author
Forward
0 new messages