QSIPrep not using all fieldmaps for specified DWI scan

Summary of what happened:

Hi all,
I’m using QSIPrep to preprocess some DWI scans and I just realized that QSIPrep has their own method for choosing b=0 volumes for SDC. For example, I have four EPI fieldmaps (AP, PA, AP, PA). For each of their JSON files, I specified an “IntendedFor” sidecar for a single DWI scan ¶:

“IntendedFor”:“ses-1/dwi/sub-SUBJ1_ses-1_acq-PA_run-001_dwi.nii.gz”

But when I checked the /hmc_sdc_wf/gather_inputs/b0_selection_info.tsv file, I noticed that only 3 volumes were selected for SDC. One volume from the DWI, and two other volumes from the AP fieldmaps.

I understand that QSIPrep is finding the most representative b=0 images, but is there a way to force it to use all the fieldmaps that I intended for it to use? One reason for this is because I have my own diffusion preprocessing pipeline that does this and I want to compare the results with QSIPrep.

Any help would be appreciated. Thank you! Also am new to Neurostars, apologies for any formatting issues.

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

PASTE CODE HERE

Version:

PUT VERSION HERE

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

PUT ENVIRONMENT HERE

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

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:


Hi @scchung, and welcome to neurostars!

As far as I know that is not an option.

Best,
Steven

Can confirm - there’s no way to change this behavior via options. The reason we limit it is because every additional volume given to topup exponentially increases the run time. Plus, including noisy b=0s actively downgrades the quality of the estimated field.

@Steven @mattcieslak Thank you both for the confirmation!

Sorry @Steven @mattcieslak I also just wanted more clarification on why only 3 volumes were picked, instead of an even number of volumes. Referring to my previous example, QSIPrep picked a b=0 volume from the DWI scan ¶ and 2 b=0 volumes from 2 fieldmaps- both AP. Why does it not just pick 2, or 4? Why an odd number? I think I still don’t fully understand how QSIPrep picks its b=0 volumes.

Thanks again,
Sofie

Hi @scchung,

It would be two / four if you had one / three reverse phase encoded EPIs, respectively (one from the DWI, one from each RPE EPI).

That is defined here qsiprep/qsiprep/interfaces/epi_fmap.py at 00dbf000f2a22b1b23118a8c0c7f01183d3b7fb3 · PennLINC/qsiprep · GitHub which uses this function qsiprep/qsiprep/interfaces/epi_fmap.py at 00dbf000f2a22b1b23118a8c0c7f01183d3b7fb3 · PennLINC/qsiprep · GitHub

In short,

Step Action Purpose
Load Read all b=0 images as float64 Consistent intensity space
Correlate Compute pairwise voxelwise correlations Measure similarity
Average Take mean correlation per image Derive QC score
Rank Keep top few Feed high-quality inputs to TOPUP

Best,
Steven