Fmriprep: TypeError: 'numpy.int64' object is not iterable (ica_aroma_confound_extraction)

Created on 2 May 2018  路  4Comments  路  Source: nipreps/fmriprep

As per https://neurostars.org/t/ica-aroma-error-in-fmriprep-mask-and-image-must-be-the-same-size/1605/4

[Node] Running "ica_aroma_confound_extraction" ("fmriprep.interfaces.confounds.ICAConfounds")
180502-07:17:39,469 workflow WARNING:
     [Node] Error on "fmriprep_wf.single_subject_104_wf.func_preproc_task_rest_run_08_wf.ica_aroma_wf.ica_aroma_confound_extraction" (/root/src/fmriprep/work/fmriprep_wf/single_subject_104_wf/func_preproc_task_rest_run_08_wf/ica_aroma_wf/ica_aroma_confound_extraction)
Traceback (most recent call last):
  File "/usr/local/miniconda/bin/fmriprep", line 11, in <module>
    load_entry_point('fmriprep==1.0.12.dev0', 'console_scripts', 'fmriprep')()
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/cli/run.py", line 280, in main
    fmriprep_wf.run(**plugin_settings)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/workflows.py", line 595, in run
    runner.run(execgraph, updatehash=updatehash, config=self.config)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/plugins/base.py", line 168, in run
    self._clean_queue(jobid, graph, result=result))
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/plugins/base.py", line 227, in _clean_queue
    raise RuntimeError("".join(result['traceback']))
RuntimeError: Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/plugins/multiproc.py", line 68, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 479, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 563, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 643, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/interfaces/base/core.py", line 516, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/interfaces/confounds.py", line 112, in _run_interface
    self.inputs.in_directory, newpath=runtime.cwd)
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/interfaces/confounds.py", line 239, in _get_ica_confounds
    aggr_confounds = np.asarray([melodic_mix_arr.T[x] for x in motion_ic_indices])
TypeError: 'numpy.int64' object is not iterable
bug

All 4 comments

This is almost certainly that np.loadtxt is seeing a file with one element, and loading it as a scalar instead of a vector of length 1.

https://github.com/poldracklab/fmriprep/blob/a5d4b3689974b24c297cb3a0a7f434892aef6710/fmriprep/interfaces/confounds.py#L222

I think if we pass ndmin=1, that should resolve this.

Would that make sense overall? Meaning, is it possible that motion_ics only has one index?

Was this page helpful?
0 / 5 - 0 ratings