preprocessing = pe.Workflow(name='preprocessing')
preprocessing.base_dir = '/path/2/studydirectory/'
preprocessing.connect(seg,'modulated_class_images',reslice2ref_all,'in_files')
So, it does not report any errors when I make this connection and will run through the entire analysis up to NewSegment. The problem arises when the modulated class images are fed into in_files. See, normally the outputs of segment or most other processes are 'an existing filename.' The problem here is that this is a list of items which contains existing file names. The workflow does not know how to access this.
The strange thing is that if you use spm SliceTimeCorrection, the output file there is "(a list of items which are an existing file name or an existing file name)." I have seen this run flawlessly for 3D data (which means its output would be a list of existing filenames), which means that the workflow can handle lists of filenames.
The error that I receive is:
Each element of the 'in_files' trait of a ResliceToReferenceInput instance must be an existing file name, but a value of [] <type 'list'> was specified.
So, my question is: How do I get around this issue? Do I have to wait until the NewSegment job is completed and run it outside the pipeline (which completely defeats the purpose of working inside the workflow)? Or is there some way to tell the workflow that I am specifying a list? Or is the problem because it is a "list of items which are a list of items which are an existing file name"--which means it's a list of a list of existing filenames?
Thank you,
--Helmet Karim
--
---
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/d/optout.
reslice = pe.MapNode(spm.utils.ResliceToReference(),'in_file', 'reslice')
where 'in_file' was iterable field. Later, in the pipeline I connected them with:
preprocessing.connect(seg,'modulated_class_images',reslice,'in_files')
This results in the same error that I received earlier. Not sure why. I really thought that that would work. Have I made a mistake here?
Thanks,
--Helmet
Satra,
from nipype import spm
import nipype.pipeline.engine as pe
seg = pe.Node(interface = spm.NewSegment(),name = 'NewSegment')
seg.inputs.channel_info = (0.0001, 60, (True, True))
seg.inputs.warping_regularization = 4
seg.inputs.sampling_distance = 3
tissue1 = ((TPMfile, 1), 2, (True,True), (True, False))
tissue2 = ((TPMfile, 2), 2, (True,True), (True, False))
tissue3 = ((TPMfile, 3), 2, (True,True), (True, False))
tissue4 = ((TPMfile, 4), 3, (False,False), (True, False))
tissue5 = ((TPMfile, 5), 4, (False,False), (True, False))
tissue6 = ((TPMfile, 6), 2, (False,False), (True, False))
seg.inputs.write_deformation_fields = [False,True]
seg.inputs.affine_regularization = 'mni'
seg.inputs.tissues = [tissue1, tissue2, tissue3, tissue4, tissue5,tissue6]
When I ran this, I noticed that it would output the unmodulated normalized files but NOT the modulated files. So I decided to change the tissue types such that they all had 'True' instead of 'False' at the very end {i.e. tissue1 = ((TPMfile, 1), 2, (True,True), (True, True)) }. This output the modulated and unmodulated. When I switched it to (False,True) for the last tuple in tissue, it only output the modulated files. So the problem was that the documentation says the opposite. The manual says that the last tuple be "- which maps to save [Modulated, Unmodualted] - a tuple of two" but it should actually be unmodulated then modulated. Please test this and fix the typo in the manual. You were right though that it was NOT outputting the modulated files because I was mistakenly outputting only the unmodulated.
Thanks again for your help,
--Helmet