Dwipreproc inputs

Dear MRtrix experts
I have some difficulties regarding the inputs to dwipreproc. I have:

mrinfo 102d_DICOM
  Dimensions:       96 x 96 x 50 x 102
  Voxel size:        2.5 x 2.5 x 2.5 x ?
  Data strides:      [ -1 -2 3 4 ]
  Format:            DICOM
  Data type:         unsigned 16 bit integer (little endian)
  Intensity scaling: offset = 0, multiplier = 6.1238095238095198
  Transform:           0.9971     0.03798     0.06592      -115.3
                         -0.02085      0.9697     -0.2433      -97.47
                         -0.07317      0.2412      0.9677      -53.24
  dw_scheme:         [ 102 entries ]

mrinfo revphase_DICOM
  Dimensions:       96 x 96 x 50 x 3
  Voxel size:        2.5 x 2.5 x 2.5 x ?
  Data strides:      [ -1 -2 3 4 ]
  Format:            DICOM
  Data type:         unsigned 16 bit integer (little endian)
  Intensity scaling: offset = 0, multiplier = 2.2459096459096402
  Transform:           0.9971     0.03798     0.06592      -115.3
                         -0.02085      0.9697     -0.2433      -97.47
                         -0.07317      0.2412      0.9677      -53.24
    dw_scheme:  -0.70710676908493042,-0.70710676908493042,-4.8796962026642632e-09,0.5
    -0.70710676908493042,-0.70710676908493042,-4.8796962026642632e-09,700
      4.898682848253344e-11,-0.7071068286895752,0.70710676908493042,0.5

And I have converted the DICOMs to .mif using:

mrconvert -stride 1:4 102d_DICOM dwi.mif
mrconvert -stride 1:4 revphase_DICOM dwi_rev.mif

Now I am wondering how I should import these files to dwipreproc given the AP encoding direction.

Cheers,
H

Hi Hamed,

The information regarding phase encode direction isn’t actually shown in the results of mrinfo, so it’s difficult to know for sure exactly how your acquisition protocol is designed. It does however look like you’ve got unusual diffusion encoding in that second image series: a b=0 volume, a b=700 volume, and another b=0 volume. I would advise checking the appearance of the images themselves to confirm whether or not this is actually the case.

Assuming that this is the case, and assuming that the AP encoding direction applies to the first image series (and the second series was acquired with PA direction), you would want to do the following:

dwiextract dwi.mif b0_AP.mif -bzero
dwiextract dwi_rev.mif b0_PA.mif -bzero
dwipreproc AP dwi.mif -rpe_pair b0_AP.mif b0_PA.mif corrected.mif

The dwipreproc script is ‘hard-wired’ to deal with ‘typical’ acquisitions, to make pre-processing more convenient in those cases, partly by removing the necessity to manually define the configuration and index files for topup / eddy; but some understanding of what the script is doing, and what topup / eddy are doing, is still required, particularly in cases like this where your acquisition doesn’t perfectly conform to the expected use case.

In the particular case of the -rpe_pair option, a pair of b=0 image volumes (or image series) are provided in order to estimate the inhomogeneity field using topup; and this is used in correcting the distortions of the input DWI series, which must have the same phase-encode direction as the first of the two images in the reversed phase-encode pair, with eddy.

Cheers
Rob

Thanks Rob for your time.
Did you mean this info?

mrinfo dwi.mif -dwgrad
   -0.707107    -0.707107  -4.8797e-09          0.5
 4.89868e-11    -0.707107     0.707107          0.5
    0.692425     0.658773    -0.294221          700
   -0.067346    -0.977835    -0.198251         2800
    0.777793    -0.500094    -0.380715         1200
   -0.838028     0.211096    -0.503137         2800
    0.438642     0.071386     0.895822         1200
    0.557154      0.28315    -0.780644         2800
    0.185804     0.347334      0.91915         2800
   -0.648208    -0.745292     0.156097         1200
   -0.281652    -0.381862    -0.880258          700
   -0.731458     0.459944      0.50341         2800
   -0.037736     0.726978    -0.685623         2800
   -0.110359     0.816669    -0.566457         1200
    0.932439     0.349826     0.090443         2800
   -0.908841     0.405422    -0.098188          700
   -0.018502    -0.778654    -0.627181         1200
     0.47665    -0.876188     0.071409         2800
   -0.567681    -0.793586     0.218997         2800
   -0.968419    -0.055335    -0.243111         1200
    0.307196    -0.258246     0.915936         2800
   -0.407882     0.911563    -0.051823          700
   -0.578205    -0.674435    -0.459147         2800
    -0.46405    -0.268962     0.843989         1200
    0.917926    -0.152182    -0.366405         2800
    0.573761    -0.670216     0.470754         1200
 2.28746e-10  8.56212e-10            1          0.5
   -0.138969     0.580892      0.80203         2800
   -0.456447    -0.363871     0.811945          700
    0.670236    -0.556069     0.491499         2800
    0.010913     0.980055     0.198427         1200
   -0.229185    -0.198216     0.952987         2800
    0.739452     0.112039     0.663821         2800
    0.345881    -0.172756    -0.922237         1200
    0.752856   0.00861099     0.658129          700
    0.232782     0.960188    -0.154437         2800
   -0.776855    -0.555195    -0.297079         1200
    0.434972    -0.704557    -0.560712         2800
   -0.808813    -0.240992     0.536418         2800
    0.777745     0.354129    -0.519331         1200
    0.995992    -0.089446  0.000263002         2800
   -0.060923     0.822552     0.565417          700
   -0.402919     0.810258    -0.425602         2800
   -0.670716     0.741608    -0.012548         1200
    0.175303    -0.251443    -0.951864         2800
   -0.382166     0.415638    -0.825345         1200
    0.275056     0.849255     0.450677         2800
    0.871492      -0.0036    -0.490396          700
   -0.306895    -0.811028     0.498045         2800
     0.06924     0.400898     0.913502         1200
   -0.878428     0.452622     0.153288         2800
           1 -1.81318e-09  2.78232e-09          0.5
    0.057713     0.810342    -0.583108          700
   -0.532167    -0.424085    -0.732769         2800
   -0.965787     0.083386     0.245565         1200
    0.816806     0.525012    -0.239145         2800
   -0.222534    -0.948775     0.224288         1200
   -0.310588     0.911943     0.268132         2800
   -0.019264     0.443916    -0.895861         2800
    0.753446     0.221925     0.618926         1200
    0.619104      0.66632     0.415607          700
   -0.466966     0.057716      0.88239         2800
   -0.742919    -0.659212    -0.116232         2800
   -0.417462     0.560606     0.715154         1200
   -0.732223      0.66533    -0.145553         2800
   -0.155493     0.241643    -0.957826          700
   -0.078015      -0.5262     0.846775         1200
   -0.606891     0.261405    -0.750567         2800
   -0.944238    -0.072878    -0.321096         2800
    0.910573    -0.388727     0.140528         1200
    0.050868    -0.913985     0.402546         2800
    0.653514    -0.605178    -0.454619          700
    0.079872    -0.834124    -0.545764         2800
     0.43256     0.858581     0.275193         1200
    0.610581     0.579107    -0.540209         2800
    0.404463     -0.84351    -0.353413         1200
 1.11334e-09            1   6.7383e-10          0.5
    0.450242     0.086356     0.888721         2800
   -0.226623    -0.973895    -0.013055          700
    0.738206    -0.103628    -0.666568         2800
     0.42597      0.69834    -0.575214         1200
    0.643367    -0.726658    -0.240931         2800
     0.45368     0.881508     0.130835         2800
   -0.764745     0.251015    -0.593428         1200
    0.545484    -0.594059     0.591219          700
    0.374249    -0.582358     0.721663         2800
   -0.738896     0.118197     0.663371         1200
    -0.07483     0.004337    -0.997187         2800
     0.80358     0.402195     0.438746         2800
   -0.447165    -0.577664    -0.682896         1200
   -0.956852    -0.184133     0.224789         2800
   -0.967645    -0.232725    -0.097478          700
    0.484683    -0.409451    -0.772938         2800
   -0.023418     0.098436    -0.994868         1200
   -0.309027    -0.558043     0.770124         2800
    0.925538     0.365415    -0.099253         1200
   -0.229649    -0.643482      -0.7302         2800
    -0.34745       0.2614     0.900527          700
   -0.149286     0.985597    -0.079452         2800
    0.281391    -0.946127     0.160194         1200
     0.90826    -0.365002      0.20454         2800
-2.28746e-10 -8.56212e-10           -1          0.5

mrinfo rev.mif -dwgrad
  -0.707107   -0.707107 -4.8797e-09         0.5
  -0.707107   -0.707107 -4.8797e-09         700
4.89868e-11   -0.707107    0.707107         0.5

Can I use your previous commands with this new info?
Cheers,
H

Hamed,

Those are the diffusion gradient directions for your two image series; the phase encode direction(s) is a completely separate piece of information. When I say it’s 'not shown in the results of mrinfo', what I actually mean is that the phase encode direction information is not currently extracted from the DICOM header, and is therefore not present in the header of any subsequent images. So it’s necessary to manually ensure that image pre-processing is correctly informed of this phase encoding information.

Normally this would not be too difficult as the acquisition protocol would be designed from the outset to perform pre-processing in a particular way; but given the unusual nature of the diffusion gradient table in your second image series, I would recommend checking the raw data, and/or confirming this information with whoever is responsible for design / acquisition of this particular protocol.

Cheers
Rob