fMRIprep not producing confound timeseries file: anat_fit_wf.fast error reported

Summary of what happened:

I am pre-processing anatomical (T1) and functional data for multiple subjects. While I have successfully pre-processed 21 subjects, the last 7 return an error that I believe is resulting in a lack of confound_timeseries.tsv file, which is needed for the next step in our analysis. All subjects input data is in BIDS format, all of which is the same, so it is unclear why this error is now occurring. The error relates to: Node Name: fmriprep_23_2_wf.sub_WLfMRI041_wf.anat_fit_wf.fast

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

fmriprep-docker /Users/lendlab/Desktop/WL_fMRI/data/BIDS /Users/lendlab/Desktop/WL_fMRI/data/derivatives/fmriprep participant --participant-label sub-WLfMRI033 --fs-license-file /Users/lendlab/Desktop/WL_fMRI/license.txt --bids-filter-file /Users/lendlab/Desktop/WL_fMRI/anat_filter_JMS.py

Version:

23.2.3

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

Docker

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

I do not have the output to provide, however, no errors are reported (there are some warnings). The BIDS data that has run successfully is formatted the same as the BIDS data that is not running successfully.

Relevant log outputs (up to 20 lines):

Node Name: fmriprep_23_2_wf.sub_WLfMRI041_wf.anat_fit_wf.fast
File: /out/sub-WLfMRI041/log/20240925-202014_d1b38fee-cd4b-444d-8cb3-2ec372f74399/crash-20240926-013018-root-fast-ec8b9450-7279-4f9e-869c-5c15b8b24210.txt
Working Directory: /tmp/work/fmriprep_23_2_wf/sub_WLfMRI041_wf/anat_fit_wf/fast
Inputs:
args:
bias_iters:
bias_lowpass:
environ: {'FSLOUTPUTTYPE': 'NIFTI_GZ'}
hyper:
img_type:
in_files:
init_seg_smooth:
init_transform:
iters_afterbias:
manual_seg:
mixel_smooth:
no_bias: True
no_pve:
number_classes:
other_priors:
out_basename:
output_biascorrected:
output_biasfield:
output_type: NIFTI_GZ
probability_maps: True
segment_iters:
segments: True
use_priors:
verbose:
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.10/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.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/fmriprep/lib/python3.10/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 fast.

Cmdline:
	fast -N -p -g -S 1 /tmp/work/fmriprep_23_2_wf/sub_WLfMRI041_wf/anat_fit_wf/fast/sub-WLfMRI041_ses-Session2_T1w_noise_corrected_corrected_xform_masked.nii.gz
Stdout:

Stderr:
	Killed
Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
	    setattr(outputs, key, val)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/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.10/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.10/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: The 'tissue_class_map' trait of a FASTOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/tmp/work/fmriprep_23_2_wf/sub_WLfMRI041_wf/anat_fit_wf/fast/sub-WLfMRI041_ses-Session2_T1w_noise_corrected_corrected_xform_masked_seg.nii.gz'  was specified.

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 400, in run
	    outputs = self.aggregate_outputs(runtime)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
	    raise FileNotFoundError(msg)
	FileNotFoundError: No such file or directory '/tmp/work/fmriprep_23_2_wf/sub_WLfMRI041_wf/anat_fit_wf/fast/sub-WLfMRI041_ses-Session2_T1w_noise_corrected_corrected_xform_masked_seg.nii.gz' for output 'tissue_class_map' of a FAST interface```

### Screenshots / relevant information:
Processing system: 
macOS Catalina
Version 10.15.7
Processor: 3.4 GHz Quad-Core Intel Core i7
Memory: 8 GB 1600 MHz DDR3
_____

Hi @Julie_Schneider and welcome to neurostars!

This means you are out of memory, can you devote more resources?

Best,
Steven

Hi @Steven – I never realized that Killed was a function of lacking memory. This is incredibly helpful. I was able to devote more resources and this appears to have resolved the issue.

Sincere thanks for your advice!
Julie

1 Like

Hi @Steven,

I’m Dr. Schneider’s student. For the memory problem you suggested ealier, we resampled the data from 360X512X512 to 180X512X512. And also, we expanded the memory limit to 16 CPUs, with a CPU limit of 10.

Currently we are running with fMRIPrep v22.0.2. All data runs, but error occurs before confounds file is produced. Here is the error report. We are not sure about this and would really appreciate it if you can help explain what it is. Thanks!

File "/opt/conda/envs/fmriprep/lib/python3.11/concurrent/futures/_base.py", line 401,
in
__get_result
raise self._exception
concurrent. futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
SvgoParserError: <input›: 711:12523: Unclosed root tag
709
710
> 711
...Dik58Xv8nLUr66uRn2X33F0dBT1p051f2NMr825ubmor8rPpfSKv3
SvgoParserError: <input›: 713:12556: Unclosed root tag
711
712
> 713
...z61ZWVaB&cHIz6qvw1pM9pbGws6re3t6N+Z2cn6qugRkZGoj69dvr7
node: events: 496
throw er:
// Unhandled
'errori
event
Error: write EPIPE
at afterWriteDispatched (node: internal/stream_base_commons:160:15)
at writeGeneric (node: internal/stream_base_commons:151:3)
at Socket. writeGeneric (node:net: 952:11)
at Socket. _write (node:net: 964:8)
at write0rBuffer (node: internal/streams/writable:564:12)
at
write (node: internal/streams/writable:493:10)
at Writable.write (node:internal/streams/writable:502:10)
at writeOutput(/opt/conda/envs/fmriprep/lib/node_modules/svgo/lib/svgo/coa.js:438:20)
at processSVGData(/opt/conda/envs/fmriprep/lib/nodemodules/svgo/lib/svao/coa.is:407:10)
at Socket.<anonymous> (/opt/conda/envs/fmriprep/lib/node_modules/svgo/lib/svgo/coa.js:257:13
Emitted error event on Socket instance at:
at emitErrorNT (node: internal/streams/destrov:169:8)
at emitErrorCloseNT (node: internal/streams/destrov:128:3)
at process. processTicksAndRejections (node:internal/process/task_queues: 82:21) 
errno: -32,
code: 'EPIPE'
syscall: 'write'

Best,
Tengwen

Hi @tengwen,

I wouldn’t downsample data before fmriprep. It’s better if fmriprep resamples the data as part of its one-shot spatial normalization / resample workflow. Also, adding more CPUs leads to more memory usage. You should focus on changing the RAM devoted to the job.

It would help to see what command you used that leads to that error. But the broken process pool is usually indicative of memory issues. Also, updating fmriprep is always good to lessen chances the bug was already fixed in a different release.

Best,
Steven