fMRIPrep MCFLIRT Error

Summary of what happened:

I am running fMRIPrep with Docker and got the error pasted below. Please let me know what other information to provide. Many thanks in advance!

Command used (and if a helper script was used, a link to the helper script or the command generated):

PASTE CODE HERE

Version:

Environment (Docker, Singularity / Apptainer, custom installation):

Docker

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

240724-16:10:15,259 nipype.workflow ERROR:
         could not run node: fmriprep_24_0_wf.sub_ID_wf.bold_task_reward_wf.bold_fit_wf.bold_hmc_wf.mcflirt
240724-16:10:15,337 nipype.workflow CRITICAL:
         fMRIPrep failed: Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node mcflirt.

Cmdline:
        mcflirt -in /data/sub-ID/func/sub-ID_task-reward_bold.nii -out /work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-ID_task-reward_bold_mcf.nii.gz -reffile /work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/hmc_boldref_wf/gen_avg/sub-ID_task-reward_bold_average.nii -mats -plots -rmsabs -rmsrel
Stdout:

Stderr:
        Killed
Traceback:
        Traceback (most recent call last):
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
            setattr(outputs, key, val)
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
            value = super(File, self).validate(objekt, name, value, return_pathlike=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
            self.error(objekt, name, str(value))
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/traits/base_trait_handler.py", line 74, in error
            raise TraitError(
        traits.trait_errors.TraitError: The 'out_file' trait of a MCFLIRTOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-ID_task-reward_bold_mcf.nii.gz' <class 'str'> was specified.

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 400, in run
            outputs = self.aggregate_outputs(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
            raise FileNotFoundError(msg)
        FileNotFoundError: No such file or directory '/work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-ID_task-reward_bold_mcf.nii.gz' for output 'out_file' of a MCFLIRT interface```

Screenshots / relevant information:


Hi @caponte2 and welcome to neurostars!

In the future please do not delete the Software Support post template which tells you what information to provide. You can see I re-added it back to your post this time.

Killed indicates you ran out of memory during processing.

Best,
Steven

Sorry about that, duly noted.
Thank you for your response. :slight_smile:

Hi again @Steven,

Could you please confirm that my machine has enough memory to run fMRIPrep on the following subject func folder which has a size of 4.84GB?

I have fMRIPrep installed using Docker on Windows 10 Enterprise with 32GB RAM 16 cores.

I typed the following:

docker run --rm -it -v "/mnt/c/Users/caponte2/Documents/BIDS/DICOM/dcm2bids_test2:/data:ro" -v "/mnt/c/Users/caponte2/Documents/BIDS_FMRIprep:/out" -v "/mnt/c/Users/caponte2/Documents/BIDS_FMRIprep_workdir:/work" -v "/mnt/c/Users/caponte2/Documents/BIDS/DICOM:/license:ro" -e FS_LICENSE=/license/license.txt nipreps/fmriprep:latest /data /out participant --work-dir /work

I ran this again with additional flags: --nthreads 1 --omp-nthreads 8 --low-mem and I got the output below:

240725-09:04:55,14 nipype.workflow WARNING:
         [Node] Error on "fmriprep_24_0_wf.sub_ID_wf.bold_task_reward_wf.bold_fit_wf.bold_hmc_wf.mcflirt" (/work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt)
240725-09:04:55,317 nipype.workflow ERROR:
         Node mcflirt failed to run on host 91fcacf2be25.
240725-09:04:55,411 nipype.workflow ERROR:
         Saving crash info to /out/sub-ID/log/20240725-084940_6d5e3b4b-a2db-4f17-8743-b74a0608e060/crash-20240725-090455-root-mcflirt-d47aa6bf-1b50-4968-b353-ea215a94fb9e.txt
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node mcflirt.

Cmdline:
        mcflirt -in /data/sub-ID/func/sub-ID_task-reward_bold.nii -out /work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-ID_task-reward_bold_mcf.nii.gz -reffile /work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/hmc_boldref_wf/gen_avg/sub-ID_task-reward_bold_average.nii -mats -plots -rmsabs -rmsrel
Stdout:

Stderr:
        Killed
Traceback:
        Traceback (most recent call last):
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
            setattr(outputs, key, val)
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
            value = super(File, self).validate(objekt, name, value, return_pathlike=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
            self.error(objekt, name, str(value))
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/traits/base_trait_handler.py", line 74, in error
            raise TraitError(
        traits.trait_errors.TraitError: The 'out_file' trait of a MCFLIRTOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-ID_task-reward_bold_mcf.nii.gz' <class 'str'> was specified.

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 400, in run
            outputs = self.aggregate_outputs(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
            raise FileNotFoundError(msg)
        FileNotFoundError: No such file or directory '/work/fmriprep_24_0_wf/sub_ID_wf/bold_task_reward_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-ID_task-reward_bold_mcf.nii.gz' for output 'out_file' of a MCFLIRT interface

What could be the issue?

Thank you for your help with this.

Best,
Carlos

Hi @caponte2,

Still looks like you’re low on memory. Did you change the settings on the docker app to allow more memory? Have you tried only running a single BOLD run? Have you considered cloud-based processing via brainlife.io?

Usually nthreads is set higher than omp-nthreads.

Best,
Steven

Thank you @Steven. I will look into brainlife.io and running a single BOLD run.

Best,
Carlos