fmriprep icon indicating copy to clipboard operation
fmriprep copied to clipboard

Ensure non-cached templates are fetched on workflow start

Open mgxd opened this issue 1 year ago • 3 comments

What happened?

Running fmriprep with --derivatives anat=... on data processed with a template not already cached in the Docker image results in a few failures.

  • /scratch/fmriprep_0_0_wf/sub_01/ds_std_volumes_wf/_in_tuple_MNIPediatricAsymcohort-3.cohort3.resnative/gen_ref
  • /scratch/fmriprep_0_0_wf/sub_01_wf/anat_fit_wf/anat_reports_wf/_in_tuple_MNIPediatricAsymcohort-- 3.cohort3.resnative/mask_std
  • /scratch/fmriprep_0_0_wf/sub_01_wf/anat_fit_wf/anat_reports_wf/_in_tuple_MNIPediatricAsymcohort-3.cohort3.resnative/t1w_std
  • /scratch/fmriprep_0_0_wf/sub_01_wf/bold_ses_1_task_emosent_run_01_wf/bold_std_wf/_in_tuple_MNIPediatricAsymcohort-3.cohort3.resnative/gen_ref

All of these are failing due to

nibabel.filebasedimages.ImageFileError: Empty file: '/home/fmriprep/.cache/templateflow/tpl-MNIPediatricAsym/cohort-3/tpl-MNIPediatricAsym_cohort-3_res-1_T1w.nii.gz'

And likely stem from not calling templateflow.get soon enough.

What command did you use?

nipreps/fmriprep:23.2.x /data /out participant --ignore slicetiming --mem_mb 15G --nthreads 4 -vv --notrack --skip-bids-validation --sloppy --fs-subjects-dir /opt/subjects --derivatives /deriv/anat -w /scratch --output-spaces MNIPediatricAsym:cohort-3

What version of fMRIPrep are you running?

Latest

How are you running fMRIPrep?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

FreeSurfer, Anatomical derivatives, Work directory

Please copy and paste any relevant log output.

No response

Additional information / screenshots

No response

mgxd avatar Feb 29 '24 18:02 mgxd

Is this something that can be resolved in a bugfix or push off to 24.0?

effigies avatar Feb 29 '24 19:02 effigies

I think it's as simple as adding a templateflow.get() call for all template T1ws, which we can include in a bug fix

mgxd avatar Feb 29 '24 20:02 mgxd

templateflow.get() is being called in the TemplateFlowSelect interface, which should be upstream of all these nodes. Are you able to see the template_iterator_wf/_in_tuple_MNIPediatricAsymcohort-3.cohort3.resnative/select_tpl node?

effigies avatar Mar 05 '24 15:03 effigies