-
Notifications
You must be signed in to change notification settings - Fork 191
Description
OK, prompted by Chris Rorden, based on this discussion, I've had a look into our handling of the bvalue scaling, and it's fair to say that it's a bit messy at the moment...
To start off with, following #60, the DICOM import code and any subsequent conversion will leave the DW scheme unmodified: no normalisation of bvecs, no bvalue scaling. All those modifications happens in the app processing the data.
Where this is problematic is for 3rd party apps that rely on mrconvert for the DICOM to NIfTI conversion: if they expect the information to be usable as-is, they might come unstuck on e.g. multi-shell data acquired on a Siemens.
The other situation where this is annoying is when you have data where the bvalue scaling shouldn't happen: you then need to remember to pass the -bvalue_scaling false option every time you use a command that uses the DW encoding. There's no simple way to store the information as you expect it to be used, rather than as the scanner reported it.
So that argues for at least providing options to control that within mrconvert. We may also need control over normalisation of the bvecs without bvalue scaling (for instance, I just came across some Bruker data with non-unit vectors, but correct bvalues). At least that would provide users with some control over the interpretation of the DW table that they can apply once at DICOM import and then not have to worry about it, in those cases where it would otherwise be annoying.
But equally pressing is to sort out the glaring inconsistencies in how we handle these things currently. This is what I've observed from a multi-shell dataset that needs bvalue scaling:
mrinfo DICOM/ -dwgrad
shows the correct encoding (scaled by b-value), as it should.
mrconvert DICOM/ dwi.nii -export_grad_fsl bvecs bvals
mrconvert DICOM/ dwi.nii -export_grad_mrtrix enc.b
results in bvecs/bvals or an enc.b with no scaling by b-value, no unit normalisation of gradient vectors.
mrinfo DICOM/ -export_grad_fsl bvecs bvals
mrinfo DICOM/ -export_grad_mrtrix enc.b
results in bvecs/bvals or an enc.b with scaling by b-value, and unit normalised vectors.
mrinfo dwi.nii -fslgrad bvecs bvals -dwgrad
mrinfo dwi.nii -grad enc.b -dwgrad
both report whatever was stored in the corresponding bvecs/bvals or enc.b: no bvalue scaling, no unit normalisation. Yet this is supposed to report the DW encoding as it would be interpreted in our apps - which it gets right if run on the DICOM directly (see the first call above). I'm not even sure how that's possible, there must be some weird code path in there...
I'm not sure how to deal with this properly, but open to suggestions. I think at the very least, we need to ensure consistency in how the -export_grad_* options work, and in how the gradient table is interpreted, regardless of where it came from (DICOM headers or provided by -grad or -fslgrad). I also reckon we should add options to control the bvalue scaling and bvecs normalisation separately. What I'm not sure about is whether these should be provided as part of the generic DW gradient table import (or export?) option group, and whether they should be performed by default (which I'm a little reluctant to do, there was a reason we went along with #60). Thoughts welcome.