Json phase encoding, Gradient table

Hi,

the json extraction worked with:
“mrconvert C.mif C.nii -json_export C_Header.json”
Then I do the SPM scaling and import the json again, while converting back to mif.

But I have 3 Warnings:

[WARNING] User-defined phase-encoding direction design does not match what is stored in DWI image header; proceeding with user specification

dwifslpreproc: [WARNING] User-defined phase-encoding direction design does not match what is stored in SE EPI image header; proceeding with user specification
–> In the *.mif its “j-” after mrconvert (nothing else) its only “j” could be a bug or is it intention

[WARNING] DW gradients not correctly reoriented
–> I did not change anything with the DW Gradients or any orientation

[WARNING] filtering has reached quantisation error but desired termination criterion has not been met;
tcksift: [WARNING] disabling cost function quantisation check

(1) For number one I noticed, that if I export json and import the json… it switches between j and -j ! Is there a reason? How can I fix it?

The other ones are not clear to me. I looke dinto the nii header and the transformation matrix does not change a bit with SPM.

Any ideas?

Hello,

I switched the Phase Encoding manually in the json file at the AP and PA to j and -j and it worked so far.
The Warning is gone and its like in the original scanned data von the MRI.
The DWI gradient warning still exists. I will check it and try to find a manual solution.

Yours,

Ralf

Hi there,
a little update here:

I siwtched from Matlab SPM to MRTrix… that means from 7th b spline interpolation to the MRTrix sinc interpolation.
It works so far and I cant say if the results better or even or something. Maybe later.

The problem is that it still brings me the Warning with “the DW Gradients not correctly reoriented”!
Can I do something? Why does it say something like it?. I mean the orientation of the directions and the data didnt change!?

Any hints here?

Thanks,

Ralf

That particular warning is issued within mrtransform, at this point in the code. I’m not sure what might trigger this, but maybe @maxpietsch will have a better idea. But it would definitely help if you told us exactly what command gave rise to this, including the full command-line, and ideally all of its output when run with the -debug option.

Hi,

sorry it took me a while. I’ll made a more detailed Logfile to find out and let the process run again.
I think the problem solved itself now.

It comes with:

flirt -in Anatomie_01.mif -ref Mean_b0.mif -interp nearestneighbour -dof 6 -omat struct2diff_fsl.mat
transformconvert struct2diff_fsl.mat Anatomie_01.mif Mean_b0.mif flirt_import struct2diff_mrtrix.txt 
mrtransform Anatomie_01.mif -linear struct2diff_mrtrix.txt Anatomie_02.mif
*mrtransform: [WARNING] DW gradients not correctly reoriented*

I guess it doesnt find the Gradients, because its only Anatomie data. And I noticed the warning now, because it comes with a new update of MRTrix, right?

Or… is there a better way to register the Anatomie on the DWI data? Its old and I have it in my pipe for years.

Thanks,

Ralf

flirt -in Anatomie_01.mif -ref Mean_b0.mif can’t work as flirt does not support .mif files.

mrtransform Anatomie_01.mif issues the warning DW gradients not correctly reoriented if the gradient parsing, rotation or setting to the output image header failed. From the filename, I suspect Anatomie_01.mif is not supposed to have an associated gradient table? If so, remove it with
mrconvert Anatomie_01.mif -clear_property dw_scheme - | mrtransform -linear struct2diff_mrtrix.txt Anatomie_02.mif. If not, what is the output of mrinfo Anatomie_01.mif -all?

[WARNING] User-defined phase-encoding direction design does not match what is stored in DWI image header; proceeding with user specification

If the sign of the phase encoding direction is going to be crucial for your processing, and you’re encountering ambiguity between what you think the phase encoding direction is and what the data says it is, you need to read this page. There is a LOT of scope for confusion here. However for certain pipelines the sign doesn’t actually matter pragmatically, as long as you nominate the correct axis.

tcksift: [WARNING] filtering has reached quantisation error but desired termination criterion has not been met;
tcksift: [WARNING] disabling cost function quantisation check

This warning is wholly unrelated to JSON or phase encoding information handling. Exactly what is referred to as the “quantisation check” is described in the relevant manuscript.