Consistent error when undergoing t2snode

Summary of what happened:

I am trying to run fmriprep on one subject with T1w and T2w struct and 2 runs of 4 echos of resting fmri data and I consistently get this error of t2smap_node failing.

The only time freemriprep ran through without any errors is when I was running it with only one echo per run, otherwise I keep getting this error.

This is being run in docker. I have 16 gb ram and amd 5 5600x core 6 processor. I have assigned the maximum amount available. I even tried swap memory of 4 gb in wsl and the —low mem option in fmriprep and regardless of it the error still occurs. Please help.

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


fMRIPrep command: /opt/conda/envs/fmriprep/bin/fmriprep /data /out participant --participant-label sub-01 --fs-license-file /fs/license.txt --output-spaces T1w --fs-no-reconall --me-output-echos --low-mem

Version:

fmriprep 24.1.1

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

This is being run in docker. I have 16 gb ram and amd 5 5600x core 6 processor.

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


PASTE VALIDATOR OUTPUT HERE

Only recommendation was to add a readme file to the root directory.

Relevant log outputs (up to 20 lines):


PASTE LOG OUTPUT HERE
There are two logs, one for run 1 and 1 for run 2. It is not allowing me to upload them so I am pasting the first log here.


Node: fmriprep_24_1_wf.sub_01_wf.bold_task_rest_run_01_echo_1_wf.bold_native_wf.bold_t2smap_wf.t2smap_node
Working directory: /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/t2smap_node

Node inputs:

args = <undefined>
echo_times = [0.0126, 0.02951, 0.04642, 0.06333]
environ = {}
fittype = curvefit
in_files = <undefined>
mask_file = <undefined>

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 t2smap_node.

Cmdline:
	t2smap -d /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_0/boldref_bold/sub-01_task-rest_run-01_echo-1_bold_tshift_xformresampled.nii.gz /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_1/boldref_bold/sub-01_task-rest_run-01_echo-2_bold_tshift_xformresampled.nii.gz /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_2/boldref_bold/sub-01_task-rest_run-01_echo-3_bold_tshift_xformresampled.nii.gz /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_3/boldref_bold/sub-01_task-rest_run-01_echo-4_bold_tshift_xformresampled.nii.gz -e 12.6 29.51 46.42 63.33 --mask /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/dilate_mask/dilated_mask.nii.gz --fittype curvefit
Stdout:

Stderr:
	INFO     t2smap:t2smap_workflow:252 Using output directory: /tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/t2smap_node
	INFO     t2smap:t2smap_workflow:278 Loading input data: ['/tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_0/boldref_bold/sub-01_task-rest_run-01_echo-1_bold_tshift_xformresampled.nii.gz', '/tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_1/boldref_bold/sub-01_task-rest_run-01_echo-2_bold_tshift_xformresampled.nii.gz', '/tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_2/boldref_bold/sub-01_task-rest_run-01_echo-3_bold_tshift_xformresampled.nii.gz', '/tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/_echoidx_3/boldref_bold/sub-01_task-rest_run-01_echo-4_bold_tshift_xformresampled.nii.gz']
	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 't2star_map' trait of a T2SMapOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/t2smap_node/T2starmap.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 '/tmp/work/fmriprep_24_1_wf/sub_01_wf/bold_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/t2smap_node/T2starmap.nii.gz' for output 't2star_map' of a T2SMap interface

Screenshots / relevant information:


Hi @John_Grover and welcome to neurostars!

This indicates you are out of memory. Given you’ve already allowed the most memory possible, you can try running single-threaded (i.e., specifying 1 core in fmriprep command), and only running one run with a BIDS filter file.

Also, --fs-no-reconall is not recommended.

Best,
Steven

Thank you so much for your response kind sir!

My first ever initial run of fmriprp I did, it had fs recon all however it took upwards of 7 hours and still gave that same error. I wanted to fix the error before adding fs recon all back into the pipeline.

I will do as you suggested. Do you think if I upgrade my ram to 32 gb the problem will go away?

Also I have an nvidia 3070 ti rtx graphics card, can this be leveraged for any of the tasks that fmriprep requires?

Hi @John_Grover,

32GB would certainly help. I don’t think fmriprep has any gpu acceleration.

Best,
Steven