QSIPrep: How to trigger the SDC using the reverse phase encoding direction scan?

"When we collected the data, we scanned in both the PA and AP directions. The plan is to use the b0 from the AP direction as the reverse phase encoding direction for correction.

I saw the QSIprep documentation that the qsiprep automatically merges the files in the DWI directory. However, I did not see any mention of using the AP direction in the output report.

So, I am not sure how to trigger correction with the reverse b0 correction. Do you have any experience with this?


Excuse me, would you mind offering me some assistance, please?

  1. change the AP_sbref to AP_dwi?
  2. add --distortion-group-merge concat?
  3. move the AP b0 images to the fmap and add intendFor into json?

Hi @YukunQu,

You should do the following (basically your third option):

  1. Move your sbref to fmap folder and give it the epi.nii.gz suffix.
  2. In the associated json file, make sure the PhaseEncosingDirection is opposite of that of the main DWI json.
  3. Also in the fmap json file, add an IntendedFor field that points to the DWI image, e.g.,
“IntendedFor”: [“dwi/sub-249_dir-PA_dwi.nii.gz”]




Again, thank you very much for your help!!! :smiley: :smiley: :partying_face:

I still have a question about qsiprep. May I ask if you have any experience in this? I am trying to use a custom atlas to calculate connectivity. I have already resampled my atlas to the LPS+ and same FOV as described in the documentation. However, I don’t understand why and how to zero-out the sform. Is it necessary, and how do I do it? (I have checked the Neurostar and github.)

Now, I am trying to replicate the qform and sform of the QSIPrep atlas template using below code. However, I am still not sure if it is correct.

The QSIPrep atals:
filename aal116MNI_lps_mni.nii.gz

My code:

import nibabel as nib
qsi_atlas = '/mnt/workdir/DCM/Docs/Reference/qsirecon_atlases/aal116MNI_lps_mni.nii.gz'
qsi_atlas_img = nib.load(qsi_atlas)
sform = qsi_atlas_img.header.get_sform()
sform_code = qsi_atlas_img.header._structarr['sform_code']

my_atlas = r'/mnt/workdir/DCM/Docs/Mask/DMN/DMN_atlas/DMN_atlas_lps.nii.gz'
dmn_img = nib.load(my_atlas)
qform = dmn_img.header.get_qform()

# zero_out the sform
dmn_img.header.set_sform(sform, int(sform_code))
dmn_img.header.set_qform(qform, int(1))

After this, I got the sform and qform in my atlas as below:

Hi @YukunQu,

Please open a new post for this, as it is unrelated to the original question.


1 Like