Set pe_dir_fsl? undefined for gre sdc. unwarp in wrong direction?

Is there a way to force a pe_dir_fsl value for a run of fmriprep?

I think I’ve correctly added IntendedFor (and EchoTime2) to the *_phasediff json and the GRE fieldmap is picked up and used for unwarping by fmriprep. But the correction looks like its in the wrong direction.

bad_sdc_fmriprep

Best I can tell, pe_dir_fsl is set using PhaseEncodingDirection by sdcflows.interfaces.epi. I think this would set y-. But in a legacy pipeline on the same data, it looks like we used prelude with an unwarp direction value of y. Either way, it’s value is <undefined> in rotime’s report.html


 grep -r "pe_dir" work/fmriprep_wf/single_subject_10195_wf/func_preproc_ses_20190321_task_rest_run_1_wf

unwarp_wf/rotime/_report/report.rst 
* pe_dir_fsl : <undefined>
* pe_direction : j-

simplified (paths to ....) call to fmriprep is

 docker run -it -v ...:.... -v .../license.txt:/license.txt:ro nipreps/fmriprep:21.0.0 --fs-license-file /license.txt .../fmriprep participant -w .../fmriprep/work --bids-filter-file .../10195_20190321-bidsfilter.json --fs-subjects-dir .../FS/ses/20190321/ --longitudinal --skip-bids-validation --bids-database-dir ..../pybids --participant-label sub-10195 --output-spaces MNI152NLin2009cAsym --nprocs 16


j- is the phase encode direction on the funcs and
i for the phasediff

grep -r PhaseEncodingDirection\": sub-10195/ses-20190321/func/sub-10195_ses-20190321_task-rest_run-1_bold.json
 "PhaseEncodingDirection": "j-",

sqlite3 pybids/layout_index.sqlite  "select _value from tags where entity_name like 'PhaseEncodingDirection' and file_path like '%sub-10195_ses-20190321_task-rest_run-1_bold.nii.gz';" 
 j-
grep Direction\": /V/sub-10195/ses-20190321/fmap/sub-10195_ses-20190321_acq-func_run-1_phasediff.json
 "PhaseEncodingDirection": "i",

sqlite3 pybids/layout_index.sqlite  "select _value from tags where entity_name like 'PhaseEncodingDirection' and file_path like '%sub-10195_ses-20190321_%func%run-1_phasediff.nii.gz';" 
 i

maybe related to sdflows’ issue “Unexplained flip of the PE direction under some unknown circumstances”

What version of fMRIPrep are you using? And would it be possible to get a copy of a subject where this happens?