ICA-AROMA error in FMRIPREP: 'Mask and image must be the same size'

Thanks, Oscar and James! Sorry I missed that other post. I ran the suggested command and it seemed to resolve that issue for that subject. However, when I ran it on a different subject, I encountered a new error (which I don’t think has been mentioned on NeuroStars):

[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

I’m not sure if it’s related, but I’ve noticed the masking fails for some of these data (seems to happen when “prescan normalization” is turned on during acquisition). The recent fix seemed to prevent crashes for the subject here (fmriprep output here: https://osf.io/876pn/), but for this other subject it seems to still be failing – but with this new error.