Large variation of b-values --can we replace b-values by median b-value (eddy error : Inconsistent b-values detected), can we

Dear Community,
in some rare cases (about 1 in 200 animals) our MRtrix pipeline is processing one animal for days without progress. When debugging we see an issue with the preprocessing, specifically with “dwifslpreproc”. Here FSL-“EDDY” complains: "Inconsistent b-values detected". This issue is somehow related to a recent post in the forum (Dwifslpreproc error for multishell dwi image).
I know, this is an issue which is rather FSL-related, since Eddy seems produces this error. Unfortunately, I can’t estimate a clear threshold where the b-value variation is to large to produce the variation. For the below b-table the last b-value (3338.2596) produces the error. The issue is solved when this value is closer to the median of all b-values (3342 and above works, but 3341 and below produced the “Inconsistent b-values detected” message).

Based on the information in following links:
https://community.mrtrix.org/t/question-about-processing-different-bvalues-in-hcp-data-with-mrconvert-and-noddi-fitting/3457
and
https://mrtrix.readthedocs.io/en/latest/concepts/dw_scheme.html

I wonder whether it is allowed to replace all b-values within the same b-table with one identical b-value, for instance with the median value across b-values of the same table (without the b0-value,i.e. the 1st row).
for example we have the following (shortened) b-table. Note that the last b-value (3338.2596) produces the error “Inconsistent b-values detected”

0                 0              0                 0
0.62178863    -0.58580086     0.51982329      3441.06
-0.76091859     -0.2869693     0.58193774     3445.6046
0.20494908     0.74581469     0.63384251      3449.4022
0.18394519     0.94571822    -0.26792017      3410.0393
0.71774023    -0.53980463    -0.43984081      3370.8468
0.84957532     0.23188409     0.47376318      3437.6901
0.028991217     0.04198728    -0.99869744    **3338.2596** (bold value produces the error)

Can we replace the b-values of the table by the median b-value (without using the 1st row):

0                 0              0              0
0.62178863    -0.58580086     0.51982329      3438
-0.76091859     -0.2869693     0.58193774     3438
0.20494908     0.74581469     0.63384251      3438
0.18394519     0.94571822    -0.26792017      3438
0.71774023    -0.53980463    -0.43984081      3438
0.84957532     0.23188409     0.47376318      3438
0.028991217     0.04198728    -0.99869744    3438

What do you think? Are there any crucial points after the preprocessing where the (true) variation of the b-values is used and mandatory, or can we simply replace the b-values by the median across b-values (within the same b-table)?
Thank you very much,
Paul

maybe of interest:

  1. we use an multishell-approach, accordingly we would replace the b-values for each b-table separately

  2. shellscript-command to run ““Inconsistent b-values detected”
    for_each * : dwifslpreproc IN/mrtrix/dwi_den_unr_vox.mif IN/mrtrix/dwi_den_unr_pre_vox.mif -rpe_none -pe_dir AP -eddy_options " --slm=linear --data_is_shelled --verbose” -scratch IN/mrtrix/scratch

  3. error when using debug-mode
    EDDY::: EddyUtils::get_groups: Inconsistent b-values detected
    this error message is similar to: Dwifslpreproc error for multishell dwi image

Hi @paul,

I think if you know these volumes all belong to the same shell, and should have the same b-value, it makes sense to fix the gradient table accordingly.

I would be inclined to really drill down into where this variability is coming from though. Is it really the case that the b-value for that volume is that different? If so, the validity of the analysis is going to be questionable… If not, I’d like to know what’s going on. How were these data produced, and where does that gradient table come from? If MRtrix was used for the conversion, I’d like to know that there isn’t a bug somewhere…

Cheers,
Donald

Hi Donald,
thank you very much.
You wrote “it makes sense to fix the gradient table accordingly”. … what would you recommend here, replacing the b-values of the same shell using the median or use the theoretical value?

The tables are directly extracted from the Bruker raw-data from one animal.
Presumably larger imaging gradients (and shorter TE’s) lead to larger variations of the b-values . For example, in a recent study we use 4 shells (b100, b900, b1600, b2500) and it seems that the variation increases with increasing b-value:
min mean max max deviation
b100 : 107 112 119 7
b900 : 880 910 941 31
b1600: 1565 1612 1642 30
b2500: 2454 2501 2555 54
(see tables below)

Best, Paul

[b100]_______
0 0 0 0
-0.2981257 0.1356677 0.9448361 119.3476
0.6181802 -0.3260961 0.7152025 111.8333
0.4842106 0.6994313 0.5256767 107.3557
-0.9794403 -0.09506603 0.1779304 115.8084
-0.2864058 -0.817122 0.5002833 110.253
0.5031732 -0.8422152 -0.1936242 109.7323
[b900]_______
0 0 0 0
0.188069 -0.9613529 -0.2010738 941.1045
0.05100344 -0.192013 0.9800662 936.8267
0.9751024 0.2210232 0.01800189 911.4805
-0.6844814 0.2932062 0.6674694 922.5761
0.5359523 0.5609501 0.6309438 921.4467
0.3420852 0.787196 -0.5131278 888.8006
0.7547415 -0.513824 0.4078603 914.5489
0.07902759 -0.5501921 -0.8312902 880.0469
0.2548447 -0.7625354 0.5946377 920.3241
0.7689304 0.3959642 -0.5019546 891.6008
-0.7179856 -0.0099998 -0.6959861 885.3501
-0.7616646 0.6207266 0.1859181 907.6863
-0.4959036 -0.8628322 -0.09798094 907.9541
[b1600]_______
0 0 0 0
0.62178863 -0.58580086 0.51982329 1623.3686
-0.76091859 -0.2869693 0.58193774 1625.9294
0.20494908 0.74581469 0.63384251 1628.0693
0.18394519 0.94571822 -0.26792017 1621.6472
0.71774023 -0.53980463 -0.43984081 1583.804
0.84957532 0.23188409 0.47376318 1621.4696
0.028991217 0.04198728 -0.99869744 1570.0304
-0.78296124 -0.62096926 0.036998169 1611.1599
0.40726358 -0.91158999 -0.056036267 1609.2566
-0.026009313 -0.58821062 0.80828942 1640.0958
-0.98023283 0.18504395 -0.070016631 1608.2368
-0.26197472 0.46995465 0.84291866 1636.689
0.51690981 0.01799686 0.85585067 1642.1405
-0.37327464 -0.90266415 -0.21415757 1632.2496
0.58830011 -0.060030623 -0.80641137 1572.4686
0.24583964 -0.85444266 0.45770145 1620.8075
0.96753086 0.16092197 -0.19490549 1635.3569
0.23487203 -0.85153604 -0.4687446 1582.6124
-0.47009215 -0.65812901 0.58811528 1626.1841
-0.5089285 -0.43993819 -0.73989605 1571.4335
-0.80231738 0.59323467 -0.066026118 1608.5474
0.37293251 -0.37693178 0.84784655 1636.8922
-0.69085977 -0.62987215 -0.35492796 1598.4817
-0.87071663 0.17694241 0.45885067 1620.8548
0.34214647 0.30613105 -0.88838031 1565.3119

[b2500]_______
0 0 0 0
0.39592557 -0.33793647 -0.85383949 2457.9355
0.68498288 0.7279818 0.028999275 2511.1785
-0.44587027 0.64481239 -0.62081937 2469.944
-0.97453185 0.21989437 0.043978873 2510.5491
-0.46090852 -0.32993451 -0.82383648 2459.4817
-0.12303575 0.99128801 0.047013659 2510.3796
-0.43477702 -0.475756 0.76460786 2541.3411
-0.62691537 0.70990417 0.32095667 2518.4779
-0.84606176 0.0070005111 -0.53303891 2479.4046
-0.86181731 -0.26594363 0.43190845 2524.1957
-0.18393508 -0.82470893 -0.53481124 2474.3764
0.13198515 -0.27996851 0.95089303 2550.9412
0.16704803 0.88025311 -0.44412771 2479.0497
-0.73797343 0.64197689 -0.20799251 2523.3892
-0.80330773 -0.46417781 -0.37314294 2482.7079
-0.75494489 0.16398803 0.63495365 2534.6595
-0.03200613 -0.25204827 -0.96718523 2456.6313
-0.31911187 -0.9473321 -0.027009468 2510.4853
-0.26500517 0.75001463 0.60601182 2533.168
-0.57482442 0.24492519 -0.78076151 2461.7015
-0.62895786 -0.65295625 0.42197173 2523.6836
0.35110517 -0.89026667 0.29008689 2516.887
0.98362924 0.16293858 0.076970987 2507.9499
0.33291312 0.10797182 -0.93675554 2453.6625
0.023006512 -0.66418799 0.74721149 2545.2359
-0.50094966 -0.65993368 -0.55994373 2473.0812
0.84503803 -0.4110185 -0.34201539 2484.312
-0.8568248 0.34193008 -0.38592109 2482.0494
-0.043984322 -0.58379192 -0.81071103 2464.1641
0.8780922 0.4590482 -0.13501418 2538.9937
0.40289788 -0.8967727 -0.18295363 2529.6629
0.35079414 -0.001998827 0.93645046 2555.0987
0.65418123 0.16904683 -0.73720423 2463.9462
-0.4160724 -0.87015142 0.26404595 2515.545
-0.57693394 0.51994047 0.62992788 2534.4005
-0.72114244 -0.26005137 -0.64212683 2468.846
-0.14694028 0.8476555 -0.50979281 2475.6657

OK, a few thoughts:

  • you will often get these variations because the vendor will include the imaging gradients in the b-value calculation, leading to deviations from the prescribed b-values/vectors – presumably because these prescriptions are used upfront to compute the intensities and directions of the DW PGSE gradient pulses without accounting for the imaging gradients.

  • the variations you’re showing are not enormous – though I can appreciate that they may sometimes cause failures in the shell clustering. You can control that using the BValueEpsilon config entry, which is explained in more detail in the diffusion gradient scheme handling page in the docs. See also this page for information on how to set config-file entries.

  • You will typically find these variations increase with b-value because they typically arise from the interaction between the imaging and diffusion gradients (so-called cross-terms). But they may also be worse on a preclinical system if the sequence isn’t geared towards minimising these terms (e.g. by applying the read-out dephaser before the PGSE pulses).

I don’t think there will be a great deal of difference between the theoretical and median values (at least, hopefully not…). What is important is that whichever value you use, you are satisfied that replacing the value shown is the right thing to do – e.g. it’s due to a glitch in the conversion or something. From what you’re showing me, that’s not the case. I don’t think replacing the values is the right course of action, or even required for the analysis – for MRtrix, you’d be better off tweaking the BValueEpsilon value to help the clustering algorithm get it right…

HI Donald,
I tried the “BValueEpsilon”-parameter (see bellow command) and tested the values 50.0; 100.0, 150.0. The error however remained (note that we have also the “eddy_cuda10.2 issue” due to missing libraries…). I think this issue is is rather FSL/eddy-related and there seems to be a hidden threshold evoking the “Inconsistent b-values detected”-error…at least I couldn’t find any parameter similar to MRtrix-BValueEpsilon for FSL-eddy (eddy/UsersGuide - FslWiki)
Thanks again,
Paul

command:
for_each * : dwifslpreproc IN/mrtrix/dwi_den_unr_vox.mif IN/mrtrix/dwi_den_unr_pre_vox.mif -rpe_none -pe_dir AP -eddy_options " --slm=linear --data_is_shelled --verbose" -scratch IN/mrtrix/scratch -nocleanup -config BValueEpsilon 250.0

** output **
dwifslpreproc: [ERROR] Information from failed command:
dwifslpreproc:
=============
eddy_cuda10.2
=============

                     ===========
                     eddy_openmp
                     ===========
                     Reading images
                     EDDY:::  EddyUtils::get_groups: Inconsistent b-values detected
                     EDDY:::  EddyUtils.cpp:::  static bool EDDY::EddyUtils::get_groups(const std::vector<EDDY::DiffPara>&, std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>&, std::vector<double>&):  Exception thrown
                     EDDY:::  EddyUtils.cpp:::  static bool EDDY::EddyUtils::GetGroups(const std::vector<EDDY::DiffPara>&, std::vector<std::vector<unsigned int> >&, std::vector<double>&):  Exception thrown
                     EDDY:::  ECScanClasses.cpp:::  std::vector<std::vector<unsigned int> > EDDY::ECScanManager::GetShellIndicies(std::vector<double>&) const:  Exception thrown
                     EDDY::: Eddy failed with message EDDY:::  ECScanClasses.cpp:::  EDDY::ECScanManager::ECScanManager(const string&, const string&, const string&, const string&, const string&, const string&, const string&, const string&, EDDY::ECModel, EDDY::ECModel, const std::vector<unsigned int>&, const EDDY::PolationPara&, EDDY::MultiBandGroups, bool):  Exception thrown

Doh! :man_facepalming:

Yes, of course you’re totally right… You still indeed need to modify the b-values to get eddy to accept these data. Whether median or expected value is up to you!

1 Like