nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
751 stars 530 forks source link

Unable to run: fMRI: SPM Auditory dataset workflow #2748

Open avatar-lavventura opened 6 years ago

avatar-lavventura commented 6 years ago

I am trying to run fMRI: SPM Auditory dataset workflow. I have installed fsl.

When I run its source code I have receive following error.

$ python sourceCode.py
181024-17:12:08,64 nipype.workflow INFO:
     Workflow level1 settings: ['check', 'execution', 'logging', 'monitoring']
181024-17:12:08,104 nipype.workflow INFO:
     Running serially.
181024-17:12:08,105 nipype.workflow INFO:
     [Node] Setting-up "level1.datasource" in "/home/netlab/nipype/workflow/spm_auditory_tutorial/workingdir/level1/_subject_id_M00223/datasource".
181024-17:12:08,127 nipype.workflow INFO:
     [Node] Running "datasource" ("nipype.interfaces.io.DataGrabber")
181024-17:12:08,202 nipype.workflow INFO:
     [Node] Finished "level1.datasource".
181024-17:12:08,203 nipype.workflow INFO:
     [Node] Setting-up "level1.firstlevel.preproc.merge" in "/home/netlab/nipype/workflow/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/merge".
181024-17:12:08,235 nipype.workflow INFO:
     [Node] Running "merge" ("nipype.interfaces.fsl.utils.Merge"), a CommandLine Interface with command:
fslmerge -t fM00223_016_merged.nii.gz
181024-17:12:16,601 nipype.workflow INFO:
     [Node] Finished "level1.firstlevel.preproc.merge".
181024-17:12:16,601 nipype.workflow INFO:
     [Node] Setting-up "level1.firstlevel.preproc.realign" in "/home/netlab/nipype/workflow/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/realign".
181024-17:12:16,603 nipype.workflow ERROR:
     Node realign.a0 failed to run on host sametaytac-HP-Z240-Tower-Workstation.
181024-17:12:16,656 nipype.workflow ERROR:
     Saving crash info to /home/netlab/nipype/workflow/crash-20181024-171216-netlab-realign.a0-cfb24b6c-3381-4ba2-a296-f0f53eec7ce7.pklz
Traceback (most recent call last):
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/plugins/linear.py", line 44, in run
    node.run(updatehash=updatehash)
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 408, in run
    cached, updated = self.is_cached()
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 294, in is_cached
    hashed_inputs, hashvalue = self._get_hashval()
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 488, in _get_hashval
    self._get_inputs()
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 531, in _get_inputs
    self.set_input(key, deepcopy(output_value))
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 276, in set_input
    setattr(self.inputs, parameter, deepcopy(val))
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/interfaces/base/traits_extension.py", line 341, in validate
    value = super(MultiObject, self).validate(object, name, newvalue)
  File "/home/netlab/.local/lib/python2.7/site-packages/traits/trait_types.py", line 2337, in validate
    return TraitListObject( self, object, name, value )
  File "/home/netlab/.local/lib/python2.7/site-packages/traits/trait_handlers.py", line 2313, in __init__
    raise excp
TraitError: Each element of the 'in_files' trait of a RealignInputSpec instance must be an existing, uncompressed file (valid extensions: [.hdr, .nii, .img]) or a list of items which are an existing, uncompressed file (valid extensions: [.hdr, .nii, .img]), but a value of u'/home/netlab/nipype/workflow/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/merge/fM00223_016_merged.nii.gz' <type 'unicode'> was specified.
Error setting node input:
Node: realign
input: in_files
results_file: /home/netlab/nipype/workflow/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/merge/result_merge.pklz
value: /home/netlab/nipype/workflow/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/merge/fM00223_016_merged.nii.gz

181024-17:12:16,661 nipype.workflow INFO:
     ***********************************
181024-17:12:16,662 nipype.workflow ERROR:
     could not run node: level1.firstlevel.preproc.realign.a0
181024-17:12:16,662 nipype.workflow INFO:
     crashfile: /home/netlab/nipype/workflow/crash-20181024-171216-netlab-realign.a0-cfb24b6c-3381-4ba2-a296-f0f53eec7ce7.pklz
181024-17:12:16,662 nipype.workflow INFO:
     ***********************************
Traceback (most recent call last):
  File "dd.py", line 397, in <module>
    level1.run()
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/engine/workflows.py", line 595, in run
    runner.run(execgraph, updatehash=updatehash, config=self.config)
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/plugins/linear.py", line 61, in run
    report_nodes_not_run(notrun)
  File "/home/netlab/.local/lib/python2.7/site-packages/nipype/pipeline/plugins/tools.py", line 82, in report_nodes_not_run
    raise RuntimeError(('Workflow did not execute cleanly. '
RuntimeError: Workflow did not execute cleanly. Check log for details

[Q] What may be the reason for this error? How could I fix this error?

miykael commented 6 years ago

Hi @avatar-lavventura,

The problem here is that Realign tries to run on a compressed NIftI file (i.e. a file ending with nii.gz). SPM is not able to uncompress such files. But the output is coming from FSL's Merge. So you could tell this node to save the output uncompressed by implementing the node with:

merge = pe.Node(interface=fsl.Merge(output_type='NIFTI')

As a reminder, the example workflows on the Nipype homepage are at the moment not tested and therefore not guaranteed to work. Have you already looked at the Nipype Tuorial? There, everything is guaranteed to work :-)