The MRIQC dwi report produces:
bdiffs_max
bdiffs_mean
bdiffs_median
bdiffs_min
The Read-the-Docs page describes a noise_b0 IQM: IQMs for diffusion images — mriqc 24.1.0.dev17+g207356d documentation
Are the bdiff values the same as the described noise_b0 IQM?
Thank you.
jsein
February 12, 2026, 9:37pm
2
Hi, I have the same question!
Steven
February 12, 2026, 9:43pm
3
Hi @jsein and @Dianne_Patterson ,
According to the source code (https://github.com/nipreps/mriqc/blob/c030ac1919de55afd8702f875e84c23b8778a255/mriqc/interfaces/diffusion.py ), it appears that bdiffs summary statistics describe the differences in gradient orientation after head motion correction.
diffs[nonzero] = np.arccos(
np.clip(np.einsum('ij, ij->i', ijk[nonzero], ijk_rotated[nonzero]), -1.0, 1.0)
)
then later:
# rotated b-vecs deviations
diffs = np.array(self.inputs.in_bvec_diff)
self._results['bdiffs'] = {
'mean': round(float(diffs[diffs > 1e-4].mean()), 4),
'median': round(float(np.median(diffs[diffs > 1e-4])), 4),
'max': round(float(diffs[diffs > 1e-4].max()), 4),
'min': round(float(diffs[diffs > 1e-4].min()), 4),
}
It appears to be in units of radians.
Small values → minimal rotation needed
Larger values → more substantial head motion effects on gradient directions
Best,
Steven
1 Like
jsein
February 12, 2026, 9:45pm
4
Here is the code:
diffs = np.array(self.inputs.in_bvec_diff)
self._results['bdiffs'] = {
'mean': round(float(diffs[diffs > 1e-4].mean()), 4),
'median': round(float(np.median(diffs[diffs > 1e-4])), 4),
'max': round(float(diffs[diffs > 1e-4].max()), 4),
'min': round(float(diffs[diffs > 1e-4].min()), 4),
}
and
diffs = np.zeros_like(ijk[:, 0])
diffs[nonzero] = np.arccos(
np.clip(np.einsum('ij, ij->i', ijk[nonzero], ijk_rotated[nonzero]), -1.0, 1.0)
)
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# We support and encourage derived works from this project, please read
# about our expectations at
#
This file has been truncated. show original
From what I understand, it is the bvec deviation after application of the rotations calculated from the head motion correction algorithm. In that case, my guess is “lower values are better” .
1 Like
jsein
February 12, 2026, 9:46pm
5
Thank you @Steven ! Great and fast answer!
1 Like