<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
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.
<div class=""><br class="">
</div>
<div class="">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:</div>
<div class=""><br class="">
</div>
<div class=""> fslmaths b0.nii.gz -thr 0 b0NonNegative.nii.gz</div>
<div class=""><br class="">
</div>
<div class=""> fslmaths b0.nii.gz -sub b0NonNegative.nii.gz b0Diff.nii.gz</div>
<div class=""><br class="">
</div>
<div class="">If this is the cause of the error messages, it will only affect those voxels (which are hopefully few).</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jan 18, 2018, at 12:33 PM, Marie Amelie <<a href="mailto:mariamelie.sque@gmail.com" class="">mariamelie.sque@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">Dear Philip,<br class="">
<br class="">
</div>
Thank you very much for your reply.<br class="">
<br class="">
</div>
I actually do have 10 b0 volumes, all at the beginning of the sequence. In the other (60) volumes, b=1500 s / mm^2.</div>
<div class=""><br class="">
</div>
Below I report the content of a subject schemefile.</div>
<div class="">Any help in understanding these warnings is welcome.<br class="">
Thank you in advance.</div>
<div class=""><br class="">
</div>
<div class=""># Scheme file created by fsl2scheme<br class="">
VERSION: BVECTOR<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.000000 0.000000 0.000000 0.000E00<br class="">
0.999991 -0.002709 -0.003328 1.500E03<br class="">
0.588135 -0.376556 0.715753 1.500E03<br class="">
0.892734 0.019598 -0.450158 1.500E03<br class="">
0.726299 -0.414097 -0.548647 1.500E03<br class="">
-0.151352 0.964975 0.214280 1.500E03<br class="">
0.121489 0.774265 0.621091 1.500E03<br class="">
-0.406026 -0.412028 0.815706 1.500E03<br class="">
0.210309 0.751788 -0.624968 1.500E03<br class="">
0.091726 -0.970107 -0.224676 1.500E03<br class="">
-0.132289 -0.030859 0.990731 1.500E03<br class="">
-0.142083 -0.748737 0.647460 1.500E03<br class="">
-0.634146 0.748399 0.194312 1.500E03<br class="">
0.082006 0.970910 -0.224963 1.500E03<br class="">
0.103423 -0.023671 -0.994356 1.500E03<br class="">
0.296816 0.384548 -0.874084 1.500E03<br class="">
-0.211531 -0.804065 -0.555638 1.500E03<br class="">
0.334280 -0.038782 0.941676 1.500E03<br class="">
-0.806717 -0.587107 0.067183 1.500E03<br class="">
0.337078 -0.749386 0.569912 1.500E03<br class="">
0.589137 -0.763698 -0.263976 1.500E03<br class="">
-0.093194 -0.467293 -0.879177 1.500E03<br class="">
-0.531563 -0.431045 -0.729137 1.500E03<br class="">
-0.371728 -0.926260 -0.062133 1.500E03<br class="">
0.314806 0.926206 0.207460 1.500E03<br class="">
-0.681450 0.442704 0.582785 1.500E03<br class="">
-0.031949 -0.966060 0.256335 1.500E03<br class="">
-0.333768 0.746743 0.575303 1.500E03<br class="">
-0.572075 0.028252 0.819715 1.500E03<br class="">
0.267140 -0.749790 -0.605352 1.500E03<br class="">
-0.935653 0.187361 -0.299080 1.500E03<br class="">
0.891010 0.308050 0.333477 1.500E03<br class="">
-0.882715 0.037017 0.468448 1.500E03<br class="">
0.548703 0.586259 0.596008 1.500E03<br class="">
-0.353933 -0.017304 -0.935111 1.500E03<br class="">
0.413948 -0.901465 0.126523 1.500E03<br class="">
-0.734925 0.003790 -0.678137 1.500E03<br class="">
-0.738542 0.612670 -0.281410 1.500E03<br class="">
-0.252386 0.409535 0.876688 1.500E03<br class="">
-0.917477 0.375620 0.130940 1.500E03<br class="">
-0.257583 0.764310 -0.591169 1.500E03<br class="">
-0.591164 0.433719 -0.680010 1.500E03<br class="">
0.891935 -0.187383 0.411509 1.500E03<br class="">
0.681841 0.141939 0.717598 1.500E03<br class="">
-0.881847 -0.307877 -0.357152 1.500E03<br class="">
-0.624994 -0.695934 -0.353637 1.500E03<br class="">
0.895463 -0.433038 -0.103076 1.500E03<br class="">
-0.165112 0.416292 -0.894114 1.500E03<br class="">
-0.507833 -0.776310 0.373429 1.500E03<br class="">
0.108396 -0.444105 0.889394 1.500E03<br class="">
0.884028 0.432542 -0.177206 1.500E03<br class="">
0.595488 0.026520 -0.802927 1.500E03<br class="">
0.698417 0.696777 0.163451 1.500E03<br class="">
-0.391447 0.901331 -0.185395 1.500E03<br class="">
-0.760528 -0.399642 0.511745 1.500E03<br class="">
0.214359 0.397610 0.892164 1.500E03<br class="">
0.373301 -0.382391 -0.845236 1.500E03<br class="">
0.734139 -0.613391 0.291192 1.500E03<br class="">
-0.987401 -0.142973 0.067802 1.500E03<br class="">
0.531000 0.805078 -0.264362 1.500E03<br class="">
0.662204 0.469604 -0.583916 1.500E03<br class="">
<br class="">
</div>
<br class="">
</div>
<div class="">
<div class=""> <br class="">
<div class=""><br class="">
<br class="">
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">2018-01-18 16:57 GMT+01:00 Cook, Philip <span dir="ltr" class="">
<<a href="mailto:cookpa@pennmedicine.upenn.edu" target="_blank" class="">cookpa@pennmedicine.upenn.edu</a>></span>:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div class="h5">
<div class="">On Jan 18, 2018, at 10:29 AM, Marie Amelie <<a href="mailto:mariamelie.sque@gmail.com" target="_blank" class="">mariamelie.sque@gmail.com</a>> wrote:</div>
<br class="m_6153274617876216541Apple-interchange-newline">
</div>
</div>
<div class="">
<div class="">
<div class="h5">
<div dir="ltr" class="">
<div class="">
<div class="">Dear camino users,<br class="">
<br class="">
</div>
I am using camino to fit the tensor model (nonlinear optimization, constrained to be positive semi-definite) on dMRI data with the following command:<br class="">
<br class="">
modelfit -inputfile dwi.Bfloat -schemefile schemefile.scheme -inversion 2 -bgmask mask_Bfloat.nii.gz -maskdatatype float -outputfile dt.Bdouble<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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:</div>
<div class=""><br class="">
</div>
<div class="">Jan 17, 2018 10:50:35 AM imaging.DW_Scheme normalizeData<br class="">
WARNING: Can't use normalization constant NaN</div>
<div class=""><br class="">
</div>
<div class="">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.<br class="">
</div>
<div class="">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). <br class="">
</div>
<div class="">I am a new camino user, I apologize in advance if this is a basic question.<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">------------------------------<wbr class="">------------------------------<wbr class="">----------------<br class="">
</div>
<div class="">Here follows additional information.</div>
<div class=""><br class="">
</div>
<div class="">Before the tensor fit, I performed an eddy-current correction (MRtrix' dwipreproc) and then did with camino:</div>
<div class="">fsl2scheme -bvecfile bvec_rot.txt -bvalfile bval.txt > schemefile.scheme<br class="">
</div>
<div class="">image2voxel -4dimage dwi.nii.gz -outputfile dwi.Bfloat<br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">For completeness, I report here that I also get some instances of this error:</div>
<div class="">Jan 17, 2018 10:50:32 AM misc.LoggedException logException<br class="">
WARNING: Exception in thread "main" class optimizers.MarquardtMinimiserE<wbr class="">xception: Singular Matrix in gaussj - 2
<br class="">
at optimizers.MarquardtMinimiser.<wbr class="">gaussj(MarquardtMinimiser.java<wbr class="">:362)<br class="">
at optimizers.MarquardtMinimiser.<wbr class="">mrqmin(MarquardtMinimiser.java<wbr class="">:231)<br class="">
at optimizers.MarquardtMinimiser.<wbr class="">minimise(MarquardtMinimiser.ja<wbr class="">va:156)<br class="">
at inverters.NonLinearDT_Inversio<wbr class="">n.invert(NonLinearDT_Inversion<wbr class="">.java:135)<br class="">
at apps.ModelFit.execute(ModelFit<wbr class="">.java:156)<br class="">
at apps.EntryPoint.main(EntryPoin<wbr class="">t.java:290)<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">but from the camino FAQ webpage I think I understood their meaning.</div>
<div class=""><br class="">
</div>
<div class="">I am running it on a Ubuntu 16.04 machine. <br class="">
</div>
<div class="">The git log of my camino version is:<br class="">
</div>
<div class="">commit af55b0acd7895b7d1dafa040df60c4<wbr class="">94369b138a<br class="">
Author: Philip Cook <<a href="mailto:cookpa@mail.med.upenn.edu" target="_blank" class="">cookpa@mail.med.upenn.edu</a>><br class="">
Date: Fri Oct 6 12:00:17 2017 -0400<br class="">
<br class="">
ENH: Allow non-zero unweighted measurements for dtspd<br class="">
<br class="">
------------------------------<wbr class="">------------------------------<wbr class="">---------------<br class="">
</div>
<div class="">Any help on my question is highly appreciated.</div>
<div class="">Thank you in advance.</div>
<div class=""><br class="">
<br class="">
</div>
</div>
</div>
</div>
______________________________<wbr class="">_________________<br class="">
Camino-users mailing list<br class="">
<a href="mailto:Camino-users@www.nitrc.org" target="_blank" class="">Camino-users@www.nitrc.org</a><br class="">
<a href="https://www.nitrc.org/mailman/listinfo/camino-users" target="_blank" class="">https://www.nitrc.org/mailman/<wbr class="">listinfo/camino-users</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>