Dwifslpreproc Inconsisitent b-values error

Hi all,

I’m new to MRtrix and have run into a problem with dwifslpreproc. I’ve run all the conversion and denoising processes successfully, but when I try to run the dwifslpreproc, I get this error:

           ===========
           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

I’ve searched around for the “inconsistent b-values error” and found a couple of people with the same issue, but none of them seemed resolved. One thing to note is that I used the -json_import and -fslgrad options in the mrconvert. They seemed to write OK and no errors, but I wanted to make sure that wasn’t part of the problem. When I run mrinfo on the denoised_unr.mif file this is what I get:


Image name: “sub-b097_ses-01_dir-AP_dwi_den_gibbs.mif”


Dimensions: 128 x 128 x 60 x 81
Voxel size: 2 x 2 x 2.5 x 2.4
Data strides: [ -1 2 3 4 ]
Format: MRtrix
Data type: 32 bit float (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 0.9837 0.07 0.1655 -138.4
-0.05271 0.9929 -0.1066 -132.6
-0.1718 0.09619 0.9804 -62.97
AcquisitionDuration: 216.222
AcquisitionMatrixPE: 128
AcquisitionNumber: 1
AcquisitionTime: 13:09:12.265000
BandwidthPerPixelPhaseEncode: 22.6450005
BaseResolution: 128
BodyPartExamined: BRAIN
CoilCombinationMethod: Adaptive Combine
CoilString: HeadNeck_64_CS
ConversionSoftware: dcm2niix
ConversionSoftwareVersion: v1.0.20220720
Dcm2bidsVersion: 2.1.7
DerivedVendorReportedEchoSpacing: 0.000689997978
DeviceSerialNumber: 175689
DiffusionScheme: Monopolar
DwellTime: 2.30000001e-06
EchoTime: 0.0869999975
EchoTrainLength: 47
EffectiveEchoSpacing: 0.000344998989
FlipAngle: 90
ImageOrientationPatientDICOM: 0.983729,-0.0527124,0.17175,0.0699969,0.992899,-0.096186
ImageType: ORIGINAL
PRIMARY
DIFFUSION
NONE
ImageTypeText: ORIGINAL
PRIMARY
DIFFUSION
NONE
ND
ImagingFrequency: 123.223999
InPlanePhaseEncodingDirectionDICOM: COL
InstitutionAddress: Trinity 1601B,Austin,Houston,US,78712
InstitutionName: UT Health Austin 3T
InstitutionalDepartmentName: Radiology
MRAcquisitionType: 2D
MTState: false
MagneticFieldStrength: 3
Manufacturer: Siemens
ManufacturersModelName: MAGNETOM Vida
Modality: MR
MultibandAccelerationFactor: 4
NonlinearGradientCorrection: false
ParallelAcquisitionTechnique: SMS
ParallelReductionFactorInPlane: 2
PartialFourier: 0.75
PartialFourierDirection: PHASE
PatientPosition: HFS
PercentPhaseFOV: 100
PercentSampling: 100
PhaseEncodingDirection: j-
PhaseResolution: 1
PixelBandwidth: 1698
ProtocolName: dwi_acq-80direc_dir-AP
PulseSequenceDetails: %SiemensSeq%\ep2d_diff
PulseSequenceName: *epse2d1_128
ReceiveCoilActiveElements: HC1-7;NC1
ReceiveCoilName: HeadNeck_64_CS
ReconMatrixPE: 128
RefLinesPE: 30
RepetitionTime: 2.4000001
ScanOptions: PFP\FS
ScanningSequence: EP
SequenceVariant: SK\SP
SeriesDescription: dwi_acq-80direc_dir-AP
SeriesNumber: 17
ShimSetting: -1766,-1902,9400,589,-215,217,283,-11
SliceThickness: 2.5
SliceTiming: 0,1.27,0.16,1.4275,0.3175,1.5875,0.4775,1.745,0.635,1.905,0.795,2.0625,0.9525,2.2225,1.1125,0,1.27,0.16,1.4275,0.3175,1.5875,0.4775,1.745,0.635,1.905,0.795,2.0625,0.9525,2.2225,1.1125,0,1.27,0.16,1.4275,0.3175,1.5875,0.4775,1.745,0.635,1.905,0.795,2.0625,0.9525,2.2225,1.1125,0,1.27,0.16,1.4275,0.3175,1.5875,0.4775,1.745,0.635,1.905,0.795,2.0625,0.9525,2.2225,1.1125
SoftwareVersions: syngo MR XA31
SpacingBetweenSlices: 2.5
StationName: AWP175689
TotalReadoutTime: 0.0438
TxRefAmp: 318.677002
command_history: /opt/mrtrix3/bin/mrconvert /scratch/06865/waw758/dwi_pipeline_testing/BIDS/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi.nii.gz /scratch/06865/waw758/dwi_pipeline_testing/derivatives/fmriprep-v23.1.3/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi.mif -json_import /scratch/06865/waw758/dwi_pipeline_testing/BIDS/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi.json -fslgrad /scratch/06865/waw758/dwi_pipeline_testing/BIDS/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi.bvec /scratch/06865/waw758/dwi_pipeline_testing/BIDS/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi.bval (version=3.0.4)
/opt/mrtrix3/bin/dwidenoise /scratch/06865/waw758/dwi_pipeline_testing/derivatives/fmriprep-v23.1.3/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi.mif /scratch/06865/waw758/dwi_pipeline_testing/derivatives/fmriprep-v23.1.3/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi_den.mif -noise /scratch/06865/waw758/dwi_pipeline_testing/derivatives/fmriprep-v23.1.3/sub-b097/ses-01/dwi/noise.mif (version=3.0.4)
/opt/mrtrix3/bin/mrdegibbs /scratch/06865/waw758/dwi_pipeline_testing/derivatives/fmriprep-v23.1.3/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi_den.mif /scratch/06865/waw758/dwi_pipeline_testing/derivatives/fmriprep-v23.1.3/sub-b097/ses-01/dwi/sub-b097_ses-01_dir-AP_dwi_den_gibbs.mif -axes ‘0,1’ (version=3.0.4)
comments: TE=87;Time=130912.265;mb=4
dw_scheme: 0,0,0,0
[81 entries] 0,0,0,0

0.4388540849,-0.8646261074,-0.2445992368,1200
0,0,0,0
mrtrix_version: 3.0.4

Has anyone resolved this issue or know what’s going on? Let me know if you need any more info on my data.
Thanks!
Wade

Hi,

Can you write the bvalues? and the full command you used with dwifslpreproc. It could be an issue of sensitivity or even that is not a shelled acquisition.

Best regards,

Manuel

Sure! Here are the b-values for the DWI:
0 0 1200 2400 1200 2400 2400 2400 150 500 2400 2400 1200 2400 1200 1200 2400 500 200 2400 1200 0 50 1200 1200 500 200 1200 150 2400 2400 1200 500 2400 1200 2400 500 500 2400 1200 100 0 500 1200 1200 2400 500 2400 1200 1200 1200 1200 2400 500 2400 1200 2400 2400 2400 100 2400 0 2400 2400 100 2400 500 2400 1200 2400 2400 1200 1200 2400 1200 1200 2400 50 100 1200 0

And then the opposite phase encoded epi is;
0 0 0 0

The command I used is:
dwifslpreproc sub-001_ses-01_dir-AP_dwi_den_gibbs.mif sub-001_ses-01_dir-AP_dwi_den_gibbs_preproc.mif -eddyqc_all eddy_qc -nocleanup -pe_dir AP -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear --data_is_shelled"

I’ve also done this with the option " --slm=none --data_is_shelled" because we have more that 60 directions. Both ended with the same result, though.

Just in case you wanted to know “upstream” a bit more, the b0_pair.mif was created using:
mrcat mean_b0_AP_dwi.mif mean_b0_PA_epi.mif -axis 3 b0_pair.mif

Thanks for the help! Let me know if you need any other info.
Wade

Hi,

This doesn’t look as a shell acquisition, maybe is a grid acquisition? I can have an idea looking at the bvecs. If the bvecs form a sphere, then you could try to remove the 50 and 100 bvals. I would say that the problem is that eddy doesn’t know to which shell assign it. I hope this helps.

Best regards,

Manuel

Hmm… interesting. I know the sequence was supposed to be designed as a shell pattern. The b-vectors are below. I had to transpose them so they would present better, but the first column is the first row, the 2nd col is the 2nd row, etc. I thought the 50 and 100 shells would be OK since the --data_is_shelled option was used. Why wouldn’t it just assume they were shells?
Thanks, again!

0 0 0
0 0 0
0.722354 0.686303 -0.0848113
0.276884 -0.875662 -0.395667
-0.192288 -0.978767 0.0710035
-0.070118 0.996852 0.037017
-0.18823 0.792294 -0.58038
-0.553389 0.728153 -0.404419
-0.154462 -0.956815 -0.246267
0.592124 0.736534 -0.326966
-0.385218 -0.0278651 -0.922405
0.942388 0.0734229 -0.326364
-0.0872805 0.444218 -0.891657
-0.0320554 -0.656904 -0.753293
0.1643 0.800234 -0.576742
0.37012 -0.264625 -0.890497
-0.904822 0.208181 -0.371426
0.826118 -0.455795 -0.33133
-0.447644 0.871153 -0.20176
-0.469139 -0.883016 0.0138791
0.00548247 -0.89236 -0.45129
0 0 0
-0.655187 0.340402 -0.67443
0.995426 -0.0749112 0.0592851
0.35015 -0.926896 -0.135124
-0.447327 0.872407 -0.196987
0.82557 -0.453069 -0.336396
0.90264 -0.194454 -0.383965
0.238634 -0.609145 -0.756305
-0.822376 0.545724 -0.160882
-0.352284 -0.422168 -0.835267
-0.495956 0.218121 -0.840507
-0.981011 -0.193952 -0.000136571
0.643748 -0.644229 -0.412985
0.868582 0.338473 -0.36194
-0.944831 -0.183273 -0.271489
-0.117829 -0.0191214 -0.99285
0.240137 -0.612266 -0.753303
0.478157 -0.471654 -0.740884
-0.77808 0.619898 0.101576
-0.0125726 0.656616 -0.754121
0 0 0
-0.0066751 0.663995 -0.747707
0.305498 0.195 -0.932012
-0.318255 -0.652552 -0.687669
0.0334697 0.21167 -0.976768
-0.551993 -0.507747 -0.661435
-0.882702 -0.469818 0.0104045
0.420954 -0.709535 -0.565118
0.544035 0.503418 -0.671265
-0.785678 0.453481 -0.420791
-0.20686 0.924145 -0.321192
0.482895 -0.00912296 -0.875631
-0.66347 0.345206 -0.663808
-0.629897 -0.659071 -0.41092
-0.817324 -0.471705 -0.330873
0.73428 0.314492 -0.601605
0.952734 -0.277877 -0.122805
0.756008 -0.193746 -0.625232
0.589613 0.733207 -0.338767
-0.708835 0.0762474 -0.701242
0 0 0
-0.738877 -0.314429 -0.595982
0.325211 0.452177 -0.830527
-0.120467 -0.0236258 -0.992436
-0.585763 0.809545 0.038967
-0.153788 -0.958938 -0.238302
0.427787 0.721264 -0.544772
-0.120914 -0.314006 -0.94169
-0.353646 0.454264 -0.817667
-0.264475 -0.839142 -0.475283
-0.557248 -0.242749 -0.79407
-0.862949 -0.0396395 -0.503734
0.106964 0.934303 -0.340054
0.696886 0.0641584 -0.714307
-0.418922 0.64947 -0.634581
0.120349 -0.184293 -0.975475
-0.982967 -0.182693 -0.0199872
-0.54781 -0.503097 -0.668429
-0.463733 -0.839214 -0.284026
0 0 0

Hi,

For the 50,100,150 and 200 shells,they are too low, to close one to each other and a very little number of shells (I think). And it looks that eddy is having the same problem picking them apart one from each other.

You can try to remove those values before running dwifslpreproc and see what happens:

dwiextract -shells 0,500,1200,2400 sub-b097_ses-01_dir-AP_dwi_den_gibbs.mif sub-b097_ses-01_dir-AP_dwi_den_gibbs_subset.mif

If this works, then definitively the issue is there. Maybe long term you can check the fsl options to edit the sensibility of the tools to bvalues variation. I hope this helps.

Best regards,

Manuel

OK, I’ll give that a try and see if it works. I’ll report back if this works so there’s at least a bit of closure on this topic.

Thanks for the advice and help!
Wade

Hey Manuel,

I finally got the DWI rerun only using the upper shells like you suggested, and it worked. No errors and the resulting “preproc” file looked good. Thank you very much for your help!

Wade