TOPUP in QSIprep

Hi,

I’m running qsiprep with the following command line:

sudo singularity run --nv -C -B /EBC:/EBC /EBC/home/mblesa/qsiprep-0.14.2.sif /EBC/home/mblesa/BIDS/QSIprep_tentative /EBC/home/mblesa/BIDS/QSIprep_tentative/OUTPUT participant --participant-label sub-003 -w /EBC/home/mblesa/BIDS/ --unringing-method mrdegibbs --nthreads 16 --omp-nthreads 16 --fs-license-file /EBC/local/infantFS/freesurfer/license.txt --stop-on-first-crash --output-resolution 2 --eddy-config /EBC/home/mblesa/BIDS/eddy_params.json > ../log_qsi_2.txt

Everything works perfectly. However, TOPUP is not executed.

I have a file in the fmap/ folder that are some b0s with the reverse phase encoding direction called sub-003_epi.nii.gz, and in its .json file appears the following at the end:

"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.20210317",
"Dcm2bidsVersion": "2.1.6",
"IntendedFor": "dwi/sub-003_dwi.nii.gz"

Should I prepare the file in a different way for topup to be executed? Thanks in advance.

Best regards,

Manuel

There is probably a BIDS issue if it’s not picking up on the fieldmap. Can you verify that

  1. There is no ses-* directory above dwi
  2. That there is a PhaseEncodingDirection defined in both the _epi file and the _dwi file and that they’re opposite each other

Also, I believe that the _dir-<label> tag might have to be in your fmap files (see Magnetic Resonance Imaging - Brain Imaging Data Structure v1.6.0)

Hi,

Now it is working. One related question, how is it executed? it seems to take a long time…

Best regards,

Manuel

Looks like it uses AFNI 3dQwarp API — qsiprep version documentation

Hi,

I saw that, but in the logs it says that it uses topup:

topup --config=/usr/local/miniconda/lib/python3.7/site-packages/qsiprep/data/b02b0_1.cnf --datain=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/gather_inputs/topup_datain.txt --imain=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/gather_inputs/topup_imain.nii.gz --out=topup_imain_base --iout=topup_imain_corrected.nii.gz --fout=fieldmap_HZ.nii.gz --jacout=jac --logout=topup_imain_topup.log --rbmout=xfm --dfout=warpfield --scale=1

Maybe the documentation is from a previous version?

Best regards,

Manuel

TOPUP is only used when FSL’s eddy is used for motion/eddy current correction. There is another option for motion correction (SHORELine) for exotic schemes like (CS) DSI or any multi-b-value scheme that will use afni’s 3dQWarp for distortion correction. This mimics fmriprep’s implementation but I’d like to switch this workflow to use topup as well. topup does take forever to complete, but it’s super robust and has great results.

Thanks! you are right it does take forever but the results are great.

One follow up question, some of the options I passed into eddy (–mporder or --estimate_move_by_susceptibility) in the eddy_config file:

"args": "--estimate_move_by_susceptibility --json=/EBC/home/mblesa/BIDS/QSIprep_tentative/sub-003/dwi/sub-003_dwi.json --fwhm=10,6,4,2,0,0,0,0 --ol_type=both --mporder=8 --s2v_niter=8 --very_verbose"

Are not reported in the boilerplate. I assume this is a bug in the boilerplate and the options were actually used, as I can see in the log file that the command was the following:

eddy_cuda9.1 --estimate_move_by_susceptibility --json=/EBC/home/mblesa/BIDS/QSIprep_tentative/sub-003/dwi/sub-003_dwi.json --fwhm=10,6,4,2,0,0,0,0 --ol_type=both --mporder=8 --s2v_niter=8 --cnr_maps --field=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/topup/fieldmap_HZ --field_mat=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/topup_to_eddy_reg/topup_reg_image_flirt.mat --flm=linear --ff=10.0 --acqp=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/gather_inputs/eddy_acqp.txt --bvals=/EBC/home/mblesa/BIDS/QSIprep_tentative/sub-003/dwi/sub-003_dwi.bval --bvecs=/EBC/home/mblesa/BIDS/QSIprep_tentative/sub-003/dwi/sub-003_dwi.bvec --imain=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_denoise_dwi_wf/biascorr/sub-003_dwi_denoised_patch2self_mrdegibbs_N4.nii.gz --index=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/gather_inputs/eddy_index.txt --mask=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/pre_eddy_b0_ref_wf/enhance_and_mask_b0/topup_imain_corrected_avg_mask.nii.gz --interp=spline --data_is_shelled --resamp=jac --niter=8 --nvoxhp=1000 --out=/EBC/home/mblesa/BIDS/qsiprep_wf/single_subject_003_wf/dwi_preproc_wf/hmc_sdc_wf/eddy/eddy_corrected --repol --slm=linear

Am I right with this?

Best regards,

Manuel

We don’t report all the options in the boilerplate. The idea was to have something get written that could be copied into a methods section, and those aren’t typically reported. I’d welcome advice on what would be helpful here, though! Please feel free to open a PR that edits this function.