[Camino-users] modelfit 'WARNING: Can't use normalization constant NaN'
Cook, Philip
cookpa at pennmedicine.upenn.edu
Thu Jan 18 11:41:53 PST 2018
Thanks. I can think of one other possibility - negative DWI measurements, either from corrupted data or introduced by nonlinear interpolation by eddy. This could cause the geometric mean of the b=0 measurements to become NaN. Because the b=0 volumes have the highest intensity, I would expect this to not happen very often within the brain, but it might happen at the edge of the brain or where there's distortion or other problems.
You can look at this more easily if you extract the b=0 data with Camino's selectshells or FSL's select_dwi_vols. Then this should identify any negative values:
fslmaths b0.nii.gz -thr 0 b0NonNegative.nii.gz
fslmaths b0.nii.gz -sub b0NonNegative.nii.gz b0Diff.nii.gz
If this is the cause of the error messages, it will only affect those voxels (which are hopefully few).
Related to this problem, eddy will sometimes fill in zeros when it has incomplete information at the edge of the FOV. For example, the top and bottom slices of the data can move out of the FOV under motion, eddy replace these slices with zeros. If the voxel is all zeros, then the normalization constant would also be zero. This would trigger the normalization warning, but it should report cannot use normalization constant 0.0, not NaN in that case. You can get around this by excluding voxels that are all zero from the brain mask after eddy.
You might also want to try the --repol option in eddy, which will replace outlier data points. I don't know if it will solve all the negative values but it might help. You might also try replacing the spline interpolation with linear using "--interp linear", in case the negative numbers are coming about that way.
On Jan 18, 2018, at 12:33 PM, Marie Amelie <mariamelie.sque at gmail.com<mailto:mariamelie.sque at gmail.com>> wrote:
Dear Philip,
Thank you very much for your reply.
I actually do have 10 b0 volumes, all at the beginning of the sequence. In the other (60) volumes, b=1500 s / mm^2.
Below I report the content of a subject schemefile.
Any help in understanding these warnings is welcome.
Thank you in advance.
# Scheme file created by fsl2scheme
VERSION: BVECTOR
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.000000 0.000000 0.000000 0.000E00
0.999991 -0.002709 -0.003328 1.500E03
0.588135 -0.376556 0.715753 1.500E03
0.892734 0.019598 -0.450158 1.500E03
0.726299 -0.414097 -0.548647 1.500E03
-0.151352 0.964975 0.214280 1.500E03
0.121489 0.774265 0.621091 1.500E03
-0.406026 -0.412028 0.815706 1.500E03
0.210309 0.751788 -0.624968 1.500E03
0.091726 -0.970107 -0.224676 1.500E03
-0.132289 -0.030859 0.990731 1.500E03
-0.142083 -0.748737 0.647460 1.500E03
-0.634146 0.748399 0.194312 1.500E03
0.082006 0.970910 -0.224963 1.500E03
0.103423 -0.023671 -0.994356 1.500E03
0.296816 0.384548 -0.874084 1.500E03
-0.211531 -0.804065 -0.555638 1.500E03
0.334280 -0.038782 0.941676 1.500E03
-0.806717 -0.587107 0.067183 1.500E03
0.337078 -0.749386 0.569912 1.500E03
0.589137 -0.763698 -0.263976 1.500E03
-0.093194 -0.467293 -0.879177 1.500E03
-0.531563 -0.431045 -0.729137 1.500E03
-0.371728 -0.926260 -0.062133 1.500E03
0.314806 0.926206 0.207460 1.500E03
-0.681450 0.442704 0.582785 1.500E03
-0.031949 -0.966060 0.256335 1.500E03
-0.333768 0.746743 0.575303 1.500E03
-0.572075 0.028252 0.819715 1.500E03
0.267140 -0.749790 -0.605352 1.500E03
-0.935653 0.187361 -0.299080 1.500E03
0.891010 0.308050 0.333477 1.500E03
-0.882715 0.037017 0.468448 1.500E03
0.548703 0.586259 0.596008 1.500E03
-0.353933 -0.017304 -0.935111 1.500E03
0.413948 -0.901465 0.126523 1.500E03
-0.734925 0.003790 -0.678137 1.500E03
-0.738542 0.612670 -0.281410 1.500E03
-0.252386 0.409535 0.876688 1.500E03
-0.917477 0.375620 0.130940 1.500E03
-0.257583 0.764310 -0.591169 1.500E03
-0.591164 0.433719 -0.680010 1.500E03
0.891935 -0.187383 0.411509 1.500E03
0.681841 0.141939 0.717598 1.500E03
-0.881847 -0.307877 -0.357152 1.500E03
-0.624994 -0.695934 -0.353637 1.500E03
0.895463 -0.433038 -0.103076 1.500E03
-0.165112 0.416292 -0.894114 1.500E03
-0.507833 -0.776310 0.373429 1.500E03
0.108396 -0.444105 0.889394 1.500E03
0.884028 0.432542 -0.177206 1.500E03
0.595488 0.026520 -0.802927 1.500E03
0.698417 0.696777 0.163451 1.500E03
-0.391447 0.901331 -0.185395 1.500E03
-0.760528 -0.399642 0.511745 1.500E03
0.214359 0.397610 0.892164 1.500E03
0.373301 -0.382391 -0.845236 1.500E03
0.734139 -0.613391 0.291192 1.500E03
-0.987401 -0.142973 0.067802 1.500E03
0.531000 0.805078 -0.264362 1.500E03
0.662204 0.469604 -0.583916 1.500E03
2018-01-18 16:57 GMT+01:00 Cook, Philip <cookpa at pennmedicine.upenn.edu<mailto:cookpa at pennmedicine.upenn.edu>>:
Do you have any b=0 measurements in your data? I think the problem is that it's trying to normalize the data by dividing each measurement by the mean b=0 measurement. The non-linear tensor fit only operates on the non-zero b-values. If there is no b=0, the results might look reasonable in terms of anisotropy, but the scale could be off.
If you have a very small minimum b-value (eg, 5 s / mm^2), you could try setting that to 0 in the scheme file. Then it would normalize by those measurements, and the estimated S_0 would be very close to correct.
On Jan 18, 2018, at 10:29 AM, Marie Amelie <mariamelie.sque at gmail.com<mailto:mariamelie.sque at gmail.com>> wrote:
Dear camino users,
I am using camino to fit the tensor model (nonlinear optimization, constrained to be positive semi-definite) on dMRI data with the following command:
modelfit -inputfile dwi.Bfloat -schemefile schemefile.scheme -inversion 2 -bgmask mask_Bfloat.nii.gz -maskdatatype float -outputfile dt.Bdouble
The process globally seems to work fine: the tensor fitting and then the derived scalar maps (produced as indicated in camino's DTI tutorial) are ok both at the visual inspection and by comparing their values to the ones computed by a previous tensor fitting with another tool. However in the terminal I am seeing many instances of these warnings:
Jan 17, 2018 10:50:35 AM imaging.DW_Scheme normalizeData
WARNING: Can't use normalization constant NaN
My question is: can you explain me why I am seeing these warnings? Can I trust my tensor fit despite these warnings? Again, scalar maps and their values look globally fine.
Could it be related to my brain/backgound mask? It is actually rather conservative (i.e. tends to exclude some voxels of the brain rather than include background voxels), but I can't exclude that in some instances it might also include some background (even if perhaps not that frequently).
I am a new camino user, I apologize in advance if this is a basic question.
----------------------------------------------------------------------------
Here follows additional information.
Before the tensor fit, I performed an eddy-current correction (MRtrix' dwipreproc) and then did with camino:
fsl2scheme -bvecfile bvec_rot.txt -bvalfile bval.txt > schemefile.scheme
image2voxel -4dimage dwi.nii.gz -outputfile dwi.Bfloat
For completeness, I report here that I also get some instances of this error:
Jan 17, 2018 10:50:32 AM misc.LoggedException logException
WARNING: Exception in thread "main" class optimizers.MarquardtMinimiserException: Singular Matrix in gaussj - 2
at optimizers.MarquardtMinimiser.gaussj(MarquardtMinimiser.java:362)
at optimizers.MarquardtMinimiser.mrqmin(MarquardtMinimiser.java:231)
at optimizers.MarquardtMinimiser.minimise(MarquardtMinimiser.java:156)
at inverters.NonLinearDT_Inversion.invert(NonLinearDT_Inversion.java:135)
at apps.ModelFit.execute(ModelFit.java:156)
at apps.EntryPoint.main(EntryPoint.java:290)
but from the camino FAQ webpage I think I understood their meaning.
I am running it on a Ubuntu 16.04 machine.
The git log of my camino version is:
commit af55b0acd7895b7d1dafa040df60c494369b138a
Author: Philip Cook <cookpa at mail.med.upenn.edu<mailto:cookpa at mail.med.upenn.edu>>
Date: Fri Oct 6 12:00:17 2017 -0400
ENH: Allow non-zero unweighted measurements for dtspd
---------------------------------------------------------------------------
Any help on my question is highly appreciated.
Thank you in advance.
_______________________________________________
Camino-users mailing list
Camino-users at www.nitrc.org<mailto:Camino-users at www.nitrc.org>
https://www.nitrc.org/mailman/listinfo/camino-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.nitrc.org/pipermail/camino-users/attachments/20180118/c21c1587/attachment-0001.html>
More information about the Camino-users
mailing list