FMRIPREP1.4.0 does not work using SyN distortion correction

fmriprep
#1

Hi all,

fmriprep (version 1.4.0) did not work when --use-syn-sdc applied, while did work without --use-syn-sdc.
All data passed BIDS validation.

My script was:

fmriprep-docker /home/jshino/BIDS /home/jshino/results participant -w /home/jshino/work --output-spaces MNI152NLin6Asym:res-2 anat --participant-label 01 -t facelocalizer --fs-license-file /home/jshino/license.txt --use-syn-sdc --use-aroma

The error in terminal was:

Error while checking node hash, forcing re-run. Although this error may not prevent the workflow from running, it could indicate a major problem. Please report a new issue at https://github.com/nipy/nipype/issues adding the following information:

Node: fmriprep_wf.single_subject_01_wf.func_preproc_task_facelocalizer_wf.sdc_wf.syn_sdc_wf.atlas_2_ref
Interface: niworkflows.interfaces.fixes.FixHeaderApplyTransforms
Traceback:
Traceback (most recent call last):

File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/base.py”, line 338, in _local_hash_check
cached, updated = self.procs[jobid].is_cached()

File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 296, in is_cached
hashed_inputs, hashvalue = self._get_hashval()

File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 493, in _get_hashval
self._get_inputs()

File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 540, in _get_inputs
self.set_input(key, deepcopy(output_value))

File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 278, in set_input
setattr(self.inputs, parameter, deepcopy(val))

File “/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py”, line 172, in error
value )

traits.trait_errors.TraitError: The ‘transforms’ trait of an ApplyTransformsInputSpec instance must be a list of items which are an existing file name or ‘identity’, but a value of [’/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/ref_2_t1/transform0GenericAffine.mat’, ‘/scratch/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniInverseComposite.h5’, ‘/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat’] <class ‘list’> was specified.

Error setting node input:
Node: atlas_2_ref
input: transforms
results_file: /scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/transform_list/result_transform_list.pklz
value: [’/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/ref_2_t1/transform0GenericAffine.mat’, ‘/scratch/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniInverseComposite.h5’, ‘/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat’]

190531-04:16:03,394 nipype.workflow INFO:
[Node] Setting-up “fmriprep_wf.single_subject_01_wf.func_preproc_task_facelocalizer_wf.sdc_wf.syn_sdc_wf.atlas_2_ref” in “/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/atlas_2_ref”.
190531-04:16:05,322 nipype.workflow ERROR:
Node atlas_2_ref failed to run on host 4505441b4a40.
190531-04:16:05,325 nipype.workflow ERROR:
Saving crash info to /out/fmriprep/sub-01/log/20190531-030818_44b90f91-da9c-4dbe-b3e9-06c1b4228399/crash-20190531-041605-root-atlas_2_ref-71e0490d-7312-47dc-86ff-c6e24e6fe71d.txt
Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 69, in run_node
result[‘result’] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 410, in run
cached, updated = self.is_cached()
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 296, in is_cached
hashed_inputs, hashvalue = self._get_hashval()
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 493, in _get_hashval
self._get_inputs()
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 540, in _get_inputs
self.set_input(key, deepcopy(output_value))
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 278, in set_input
setattr(self.inputs, parameter, deepcopy(val))
File “/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py”, line 172, in error
value )
traits.trait_errors.TraitError: The ‘transforms’ trait of an ApplyTransformsInputSpec instance must be a list of items which are an existing file name or ‘identity’, but a value of [’/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/ref_2_t1/transform0GenericAffine.mat’, ‘/scratch/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniInverseComposite.h5’, ‘/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat’] <class ‘list’> was specified.

Error setting node input:
Node: atlas_2_ref
input: transforms
results_file: /scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/transform_list/result_transform_list.pklz
value: [’/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/ref_2_t1/transform0GenericAffine.mat’, ‘/scratch/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniInverseComposite.h5’, ‘/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat’]

190531-04:16:07,320 nipype.workflow ERROR:
could not run node: fmriprep_wf.single_subject_01_wf.func_preproc_task_facelocalizer_wf.sdc_wf.syn_sdc_wf.atlas_2_ref
fMRIPrep failed: Workflow did not execute cleanly. Check log for details
Preprocessing did not finish successfully. Errors occurred while processing data from participants: 01 (1). Check the HTML reports for details.
Sentry is attempting to send 3 pending error messages
Waiting up to 2.0 seconds
Press Ctrl-C to quit

In the crash-.txt in log directory,

Node: fmriprep_wf.single_subject_01_wf.func_preproc_task_facelocalizer_wf.sdc_wf.syn_sdc_wf.atlas_2_ref
Working directory: /scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/atlas_2_ref

Node inputs:

args =
default_value = 0.0
dimension =
environ = {‘NSLOTS’: ‘5’}
float = False
input_image = /usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas.nii.gz
input_image_type =
interpolation = Linear
interpolation_parameters =
invert_transform_flags = [True, False, False]
num_threads = 5
out_postfix = _trans
output_image =
print_out_composite_warp_file =
reference_image =
transforms =

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 69, in run_node
result[‘result’] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 410, in run
cached, updated = self.is_cached()
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 296, in is_cached
hashed_inputs, hashvalue = self._get_hashval()
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 493, in _get_hashval
self._get_inputs()
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 540, in _get_inputs
self.set_input(key, deepcopy(output_value))
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 278, in set_input
setattr(self.inputs, parameter, deepcopy(val))
File “/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py”, line 172, in error
value )
traits.trait_errors.TraitError: The ‘transforms’ trait of an ApplyTransformsInputSpec instance must be a list of items which are an existing file name or ‘identity’, but a value of [’/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/ref_2_t1/transform0GenericAffine.mat’, ‘/scratch/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniInverseComposite.h5’, ‘/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat’] <class ‘list’> was specified.

Error setting node input:
Node: atlas_2_ref
input: transforms
results_file: /scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/transform_list/result_transform_list.pklz
value: [’/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_facelocalizer_wf/sdc_wf/syn_sdc_wf/ref_2_t1/transform0GenericAffine.mat’, ‘/scratch/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniInverseComposite.h5’, ‘/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat’]

I tried the new version (1.4.1rc1) but the same error was printed.
Also, I changed “/scratch” to “/tmp”,shown below, but the same error was occurred.

docker run --rm -it -e DOCKER_VERSION_8395080871=18.09.6 -v /home/jshino/license.txt:/opt/freesurfer/license.txt:ro -v /home/jshino/BIDS:/data:ro -v /home/jshino/results:/out -v /home/jshino/work:/tmp poldracklab/fmriprep:1.4.0 /data /out participant --output-spaces MNI152NLin6Asym:res-2 anat --participant-label 01 -t facelocalizer --use-aroma --use-syn-sdc --fs-no-reconall -w /tmp

However, the below script, fmriprep worked completely

fmriprep-docker /home/jshino/BIDS /home/jshino/results participant -w /home/jshino/work --output-spaces MNI152NLin6Asym:res-2 anat --participant-label 01 -t facelocalizer --fs-license-file /home/jshino/license.txt --use-aroma

Therefore, I cannot use SyN distortion correction in fmriprep 1.4.0.
Really appreciate your help!

#2

Hi, thanks for reporting this. It appears that /usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/fmap_atlas_2_MNI152NLin6Asym_affine.mat does not exist (the error saying “expected a file, but got a string” is the closest the type checking system can come to telling us a file doesn’t exist), so we’ll need to be sure to create an affine registration between all templates and the fieldmap atlas.

I’ve created an issue on GitHub, where you can track progress on this issue. Please follow-up there.

In the short term, if it’s acceptable to you to use MNI152NLin2009cAsym, SyN-SDC should work with that.

#3

Hi, thank you for the reply. Using

MNI152NLin2009cAsym

as output spaces, SyN-SDC (fmriprep1.4.0) worked completely.

Thank you!