Dwipreproc: Averaging of b=0 volumes

preprocessing

#1

Hi Daan and Rob

I had a query somewhat relating to this. I can see that averaging the b0’s for input into dwipreproc is commonplace and included in the BATMAN tutorial. But your comment implies you no longer do this. Is this just regarding cases of large head motion that you reference? Or is it due to other things as well, like scanner drift?

In my acquisition, the PA scan is run after the AP scan (about 10 mins later). In which case, would you suggest that it’s ok to select the first b0 from each image to feed in to dwipreproc? I’m also not exactly sure how to do this (i.e. extract single b0 volume), as it doesn’t seem possible using dwiextract - please could you advise?

Many thanks

Paul


Dwipreproc -rpe_pair: Why equal number of up/down b0 encodings?
#2

I can see that averaging the b0’s for input into dwipreproc is commonplace and included in the BATMAN tutorial.

I am not personally aware of such a process being commonplace, and only recently spotted it in the BATMAN tutorial (but forgot to follow up on it). Personally I would advise against this: while it’s certainly appealing from a computational perspective because of how long topup takes to run, there is always scope for subject motion between such volumes, even if only because reversing the phase encoding direction typically involves the scanner pausing and recalibrating between protocols, which subjects may take as an appropriate moment to relieve discomfort. The long time period in your case makes this even more likely (and indeed for reasonable rotations the inhomogeneity field itself can change).

In my acquisition, the PA scan is run after the AP scan (about 10 mins later). In which case, would you suggest that it’s ok to select the first b0 from each image to feed in to dwipreproc?

I don’t think it’s necessary to manually select b=0 volumes for inhomogeneity field estimation: while this would be necessary if you were running topup directly, dwipreproc should be able to handle this for you. E.g. If the PA scan is b=0 volumes only, whereas the AP scan has both b=0 and diffusion-weighted volumes, then you can provide the PA scan via the -se_epi option, and as long as you are operating in -rpe_header mode, the script will detect that there is no phase encoding contrast in the SE-EPI series, and automatically add the b=0 volumes from the DWIs into the input to topup in order to enable susceptibility field estimation. This is not a well-documented “feature”, but is among the various tricks in place to permit automated processing of data of a wide range of various acquisition strategies.

Nevertheless:

I’m also not exactly sure how to do this (i.e. extract single b0 volume), as it doesn’t seem possible using dwiextract - please could you advise?

dwiextract is specifically for extracting volumes based on the DWI gradient table; if you want to extract one or more specific volumes of interest, mrconvert is the one you need:

mrconvert DWI.mif -coord 3 0 -axes 0,1,2 firstb0.mif


#3

Thanks for that Rob. I was actually averaging the AP and PA b0’s separately and providing them to dwipreproc as -rpe_pair previously, but I’d imagine even still, you wouldn’t recommend this practice.

I tried to use the -rpe_header and -se_epi option as you suggested, but got an error saying no phase-encoding contrast present in SE-EPI images which is not what you suggested would happen.

I’m using 3.0_RC3 and python 2.7. I started with using mrconvert on the DICOMS. The acquisition is A > P. Then, because my reverse phase encoded image contains 7 b0’s and 1 b2000, I used dwiextract to keep only the b0’s in that image.I have but the details of the images below if that’s of any use.

Any ideas as to why I’m getting this error with -rpe_header? I have included the error code and headers for both the DWI and the reverse phase encoded image below if that’s of use.

Thanks so much

Paul

dwipreproc dwi_raw.mif dwi_preproc_header.mif -rpe_header -se_epi PA_b0_only.mif -eddy_options " --slm=linear " -eddy_options " --data_is_shelled " 

dwipreproc: 
dwipreproc: Generated temporary directory: 
Command:  mrconvert /home/trackhd/Desktop/TrackStorage/Paul//raw_subjects/XXX/PA_b0_only.mif /home/trackhd/Desktop/TrackStorage/Paul/yas/raw_subjects/XXX/dwipreproc-tmp-OQ8CN9/se_epi.mif
dwipreproc: Changing to temporary directory (/home/trackhd/Desktop/TrackStorage/Paul/yas/raw_subjects/XXXX/dwipreproc-tmp-OQ8CN9/)
Command:  dirstat dwi.mif -output asym
dwipreproc: [WARNING] sampling of b=50 shell is strongly asymmetric; distortion correction may benefit from use of: -eddy_options " ... --slm=linear ... "
dwipreproc: [WARNING] sampling of b=299 shell is moderately asymmetric; distortion correction may benefit from use of: -eddy_options " ... --slm=linear ... "
dwipreproc: [WARNING] sampling of b=1001 shell is moderately asymmetric; distortion correction may benefit from use of: -eddy_options " ... --slm=linear ... "
dwipreproc: [ERROR] No phase-encoding contrast present in SE-EPI images; cannot perform inhomogeneity field estimation
************************************************
Image:               "dwi_raw.mif"
************************************************
  Dimensions:        110 x 110 x 72 x 153
  Voxel size:        2 x 2 x 2 x ?
  Data strides:      [ -1 -2 3 4 ]
  Format:            MRtrix
  Data type:         unsigned 16 bit integer (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1           0          -0        -108
                                0           1          -0      -93.52
                               -0          -0           1      -53.14
  EchoTime:          0.058
  FlipAngle:         88
  MultibandAccelerationFactor: 2
  PhaseEncodingDirection: j-
  RepetitionTime:    3.26
  SliceEncodingDirection: k
  SliceTiming:       0,1.52750003,3.05749989,1.34749997,2.87750006,1.16750002,2.69749999,0.987500012,2.51749992,0.807500005,2.3375001,0.627499998,2.15750003,0.44749999,1.97749996,0.267500013,1.79750001,0.0874999985,1.61749995,3.14750004,1.4375,2.96749997,1.25750005,2.7874999,1.07749999,2.60750008,0.897499979,2.42750001,0.717499971,2.24749994,0.537500024,2.06750011,0.357499987,1.88750005,0.177499995,1.70749998,0,1.52750003,3.05749989,1.34749997,2.87750006,1.16750002,2.69749999,0.987500012,2.51749992,0.807500005,2.3375001,0.627499998,2.15750003,0.44749999,1.97749996,0.267500013,1.79750001,0.0874999985,1.61749995,3.14750004,1.4375,2.96749997,1.25750005,2.7874999,1.07749999,2.60750008,0.897499979,2.42750001,0.717499971,2.24749994,0.537500024,2.06750011,0.357499987,1.88750005,0.177499995,1.70749998
  TotalReadoutTime:  0.0313
  command_history:   mrconvert "MQ04320_YAS011981469.S7/" "dwi_raw.mif" "-force"  (version=3.0_RC3-51-g52a2540d)
  comments:          YAS011-981-469 MQ04320 (MQ04320) [MR] umnMB2p2_2mm_72sl_152+1dir_WS58-3260_4s_R016
                     study:  [ ORIGINAL PRIMARY DIFFUSION NONE MB ND MOSAIC ]
                     
  dw_scheme:         0.57735026,-0.57735038000000005,0.57735031999999997,5
  [153 entries]      0.57735026,-0.57735038000000005,0.57735031999999997,5
                     ...
                     0.89165722999999997,-0.30288783000000002,-0.33646142000000001,1000
                     -0.02383971,-0.94302337999999997,0.33187091000000002,2005
  mrtrix_version:    3.0_RC3-51-g52a2540d

And for the PA image.

************************************************
Image:               "PA_b0_only.mif"
************************************************
  Dimensions:        110 x 110 x 72 x 7
  Voxel size:        2 x 2 x 2 x ?
  Data strides:      [ -1 -2 3 4 ]
  Format:            MRtrix
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1           0          -0        -108
                                0           1          -0      -93.52
                               -0          -0           1      -53.14
  EchoTime:          0.058
  FlipAngle:         88
  MultibandAccelerationFactor: 2
  PhaseEncodingDirection: j
  RepetitionTime:    3.26
  SliceEncodingDirection: k
  SliceTiming:       0,1.52999997,3.05999994,1.35000002,2.88000011,1.16999996,2.70000005,0.99000001,2.51999998,0.810000002,2.33999991,0.629999995,2.16000009,0.449999988,1.98000002,0.270000011,1.79999995,0.0900000036,1.62,3.1500001,1.44000006,2.97000003,1.25999999,2.78999996,1.08000004,2.6099999,0.899999976,2.43000007,0.720000029,2.25,0.540000021,2.06999993,0.360000014,1.88999999,0.180000007,1.71000004,0,1.52999997,3.05999994,1.35000002,2.88000011,1.16999996,2.70000005,0.99000001,2.51999998,0.810000002,2.33999991,0.629999995,2.16000009,0.449999988,1.98000002,0.270000011,1.79999995,0.0900000036,1.62,3.1500001,1.44000006,2.97000003,1.25999999,2.78999996,1.08000004,2.6099999,0.899999976,2.43000007,0.720000029,2.25,0.540000021,2.06999993,0.360000014,1.88999999,0.180000007,1.71000004
  TotalReadoutTime:  0.0313
  command_history:   mrconvert "MQ04320_YAS011981469.S9/" "PA_b0.mif" "-force"  (version=3.0_RC3-51-g52a2540d)
                     dwiextract "011-981-469_PA_b0.mif" "-bzero" "011-981-469_PA_b0_only.mif" "-force"  (version=3.0_RC3-51-g52a2540d)
  comments:          YAS011-981-469 MQ04320 (MQ04320) [MR] umnMB2p2_2mm_72sl_7+1dir_WS58-3260_b2k_BLIPREV_R016
                     study:  [ ORIGINAL PRIMARY DIFFUSION NONE MB ND MOSAIC ]
                     DOS: 
  dw_scheme:         0.57735026,-0.57735038,0.57735032,5
  [7 entries]        0.57735026,-0.57735038,0.57735032,5
                     ...
                     0.57735026,-0.57735038,0.57735032,5
                     0.57735026,-0.57735038,0.57735032,5
  mrtrix_version:    3.0_RC3-51-g52a2540d