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?

@mattcieslak

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”]

Best,
Steven

2 Likes

@Steven

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']
print(sform)
print(sform_code)

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

# zero_out the sform
dmn_img.header.set_sform(sform, int(sform_code))
dmn_img.header.set_qform(qform, int(1))
dmn_img.to_filename('/mnt/workdir/DCM/Docs/Mask/DMN/DMN_atlas/DMN_atlas_lps_zero-sform.nii.gz')

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.

Thanks,
Steven

1 Like