DWI phase encoding

Hello all,

I am relatively new to DWI data, but am familiar with T1/2 anatomical data using slicer, spm, and fsl. I have just converted animal (pig) DWI DICOMs into NifTI format using dcm2niix, which also produced a bval, bvec, and JSON files for me. I am wanting to preprocess this DWI data to correct for distortions where possible before I brain mask the data.

My question is this - is there a way to tell just by looking at the DWI dataset (DICOM or NifTI) if the data was acquired as a single-direction encoding dataset or multi-direction? There are 186 DICOM images per DWI dataset, and 46 images per ADC, FA, COLFA, and TRACE datasets. There is 1 image in a TENSOR folder. The images were acquired on a Siemens 3T Trio machine. In one of the animals there are two datasets, but I believe one is axial and one is sagittal slices.

My sense is that since there is no obvious paired dataset, I only have a single-direction encoding dataset. Can you tell the direction of encoding just by looking at the image on fsleyes? For me the distortion appears to be in the ap direction, so I am thinking of running dwifslpreproc input.nii output.nii -rpe_none -pe_dir ap -fslgrad bvec bval.

Any input would be much appreciated!


I’m pretty sure that’ll be a yes, but the specifics depend on exactly what you mean by ‘single-direction encoding’. You could be talking about the direction of the diffusion-encoding gradients, the phase-encoding direction, or the slice encoding direction. I’m guessing you’re talking about the phase-encoding direction…?

On a Siemens system, that should be recorded, and you should be able to see the information in the JSON file. Looking at the images, if you can’t tell much difference between the two datasets, then they’ll most likely have been acquired with the same phase-encoding direction. If the brains (and more specifically the distortions) look broadly symmetrical, then the phase-encoding direction is probably AP (or PA – for the purposes of eddy/dwifslpreproc either of these will produce the same result).

But more to the point: if you’re going to use the -rpe_none option, I’m pretty sure you don’t need to know that information – though I note the docs strongly suggest you do (@rsmith might be able to shed some light on this). I have a feeling the -pe_dir option is optional in that case.

Welcome @jxc!

Unless you’re using an exotic Siemens DWI WIP, if there’s a single DICOM folder containing DWIs, there’s a single phase encoding direction. Modification of the phase encoding direction during a single sequence execution isn’t possible with the commonly used sequences.

You should also be able to tell based on simply the number of files generated by dcm2niix. Each JSON file can only encode one phase encoding direction (currently), so if all of the DWI data are stored in a single NIfTI 4D series, then you have only one phase encoding direction.

Do however check the raw data in case there is an additional DWI or spin-echo EPI sequence where only b=0 volumes were acquired for the purpose of susceptibility field estimation. Depending on the sequence used, these may not be reported as DWIs, even if they’re intended to be utilised alongside the DWIs.

… if you’re going to use the -rpe_none option, I’m pretty sure you don’t need to know that information …

No, it’s still compulsory for dwifslpreproc even for -rpe_none. From memory the eddy current correction can be off if your phase encoding axis is wrong.

Alternatively you can do an mrconvert -json_import to convert to .mif, then run dwifslpreproc with -rpe_header, and it will figure out what to do.


Thank you for the replies @rsmith and @jdtournier,

It helped to understand that each folder contains one phase encoding direction. It also helped to understand that the bvec gradient directions is something different, because that is what was confusing me originally. I thought I had to extract different gradient direction images from the DWI stack to use this function. There was actually a second folder of 186 DICOMs phase encoded in a different direction from the first, but not in the anti-parallel direction. With a bit of trial and error I was able to deduce these directions from the JSON files and use the -rpe_header option. Thanks again for pointing me in the right direction! Next time, I will know exactly what to ask the technician to run for the image acquisition, since I think the blip up and blip down would be better for distortion correction.