What is bdiffs in MRIQC DWI IQMs?

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.

Hi, I have the same question!

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

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

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

Thank you @Steven ! Great and fast answer!

1 Like