BIDS, FMRIPREP: specify phase encoding direction with respect to qform orientation in nifti header?

Hi,
I want to use fieldmap correction in fmriprep but I am unsure how to correctly specify phase encoding direction in the .json files for fMRI data according to BIDS. We are working on a Philipps Scanner and according to our MR-physicist the phase encoding direction for our sequence is Anterior-Posterior. When I check the nifti-file header (using fslhd), the second axis is indicated as “qform_yorient: Posterior-to-Anterior” (same for sform_yorient). Does this mean that I have to indicate the phase encoding direction as “j-” ?

Thanks for your help.
Best,
Josua

Official BIDS specification for phase encoding direction: “Possible values: "i", "j", "k", "i-", "j-", "k-". The letters i, j, k correspond to the first, second and third axis of the data in the NIFTI file. The polarity of the phase encoding is assumed to go from zero index to maximum index unless - sign is present (then the order is reversed - starting from the highest index instead of zero)”

1 Like

First you need to check the qform and sform codes. If qform is non-zero and sform is zero, then yes, going by qform_yorient should work, and "j-" would be correct. If sform is non-zero, then it takes precedence over the qform, and you need to verify which axis is A/P, what polarity it is, and adjust accordingly.

Do you have the original DICOMs? Because dcm2niix should do all of this for you, and you can use heudiconv to name your files as you convert.

Thanks for clarification. In my case, qform and sform code are both set to 1 and sform_yorient is also Posterior-Anterior. So “j-” is correct.
I do not have access to the DICOMs, only the parrec files. Therfore I have to specify phase encoding direction manually.

This is a limitation of Philips images (both DICOM and proprietary PAR/REC formats). The BIDS JSON sidecars created by dcm2niix are impoverished for Philips data due to missing information. This reflects a limitation of the source images, not the conversion software. I urge Philips users to lobby their Philips Research Collaboration Managers to provide richer meta-data.

Due to this limitation, at best dcm2niix will create a sidecar field named PhaseEncodingAxis for Philips images:

"PhaseEncodingAxis": "j",

This suggests that the PhaseEncodingDirection is either j or j-, but the polarity is not specified. Since spin-echo EPI undistortion sequences leverage two series with reversed polarity, you can simply guess, and label one as having a PhaseEncodingDirection of j and the other as j-, and TOPUP will find out how to unwrap them (if you applytopup to other scans, use the corresponding PhaseEncodingDirection).

If dcm2niix does not populate the PhaseEncodingAxis or PhaseEncodingDirection fields and the data was acquired as Axial slices, the i (column) direction corresponds to Left/Right and the j (rows) to Anterior/Posterior.

In contrast, if you have DICOM data from a GE or Siemens scanner, dcm2niix will be able to determine the PhaseEncodingDirection :

	"PhaseEncodingDirection": "j-"
1 Like

Hello, I’m using fMRIPREP and my scanner is Philips, Do you know how can I active TOPUP in fMRIPREP?

First you need to be sure to use fmriprep version 21.X.X.
For this version, the susceptibility correction methods used by fmrirprep are coming from SDCflow:

Please note that all routines for susceptibility-derived distortion correction have been excised off of fMRIPrep for utilization on other projects (e.g., dMRIPrep). For more detailed documentation onSDC routines, check on the SDCFlows component.

Then you need to provide two _epi files with opposed phase encoding direction in the fmap folder with the ÌntendedFor and/or B0FieldIdentifier fields: Methods and implementation - sdcflows 2.0.13.dev2+g56a02bfa documentation

Thanks, I used your advise, but I’ve got this error “Insufficient sources to estimate a fieldmap”.
, do you know how can I fix that?

just to be clear, my tree is like this:
sub-01
----------------func
----------------------------sub-01_task-rest_bold.json
----------------------------sub-01_task-rest_bold.nii.gz
----------------fmap
----------------------------sub-01_task-rest_epi.json
----------------------------sub-01_task-rest_epi.nii.json
sub-01_task-rest_epi.json and sub-01_task-rest_bold.json indicates opposit PhaseEncoding. also, for B0FieldIdentifier I used patient name to be unique.

From this page:
https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#case-4-multiple-phase-encoded-directions-pepolar

It looks like you MUST specify the phase encoding direction in the name of the files in the fmap folder. You are in a special case of the pepolar SDC correction (usually pepolar refers to the acquisitions of two additional SE-EPI images with opposite phase encoding direction), I saw some discussion about cases like yours, I never tried myself, others may have better advice.

You may look at this discussion also:

Thanks, I decleared the PhaseEncodingDirections and it worked.

1 Like