You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
If you turn on the QuadFit feature of SliceChecker (which to accomplish currently requires setting SliceChecker->SetQuadFit(1) in IntensityMotionCheck.cxx and then re-compiling), the values computed for 'normalizedMetric' are completely wrong. They are intended to be the residuals after fitting the original SliceCheck correlations to a quadratic according to the b-value, but they are far from that.
I tracked the problem down to this bit of code in itkDWIQCSliceChecker.hxx:
Note that the variable 'coefficients' is typed to a 3x1 matrix, but then used in an intermediate step to (temporarily) store the output of an inv(X' * X) operation. However, inv(X' * X) is a 3x3 matrix, and the result of the type mismatch is that the full set of 3x3 values is not stored properly. The end result is that the final values for 'coefficients' are wrong, and thus the 'normalizedMetric' values end up being wrong as well.
The fix I implemented was to just create an explicit XtXinv variable, typed to a 3x3 matrix, to store the output of the inv(X' * X) operation:
Hi Mike
Sounds great, thanks for finding and correcting this bug. Can you push the corrected code to the repository? Alternatively just send the modified files to me or Juan via email and we can do so.
Thanks
Martin
Hi,
If you turn on the QuadFit feature of SliceChecker (which to accomplish currently requires setting SliceChecker->SetQuadFit(1) in IntensityMotionCheck.cxx and then re-compiling), the values computed for 'normalizedMetric' are completely wrong. They are intended to be the residuals after fitting the original SliceCheck correlations to a quadratic according to the b-value, but they are far from that.
I tracked the problem down to this bit of code in itkDWIQCSliceChecker.hxx:
Note that the variable 'coefficients' is typed to a 3x1 matrix, but then used in an intermediate step to (temporarily) store the output of an inv(X' * X) operation. However, inv(X' * X) is a 3x3 matrix, and the result of the type mismatch is that the full set of 3x3 values is not stored properly. The end result is that the final values for 'coefficients' are wrong, and thus the 'normalizedMetric' values end up being wrong as well.
The fix I implemented was to just create an explicit XtXinv variable, typed to a 3x3 matrix, to store the output of the inv(X' * X) operation:
cheers,
-Mike Harms
The text was updated successfully, but these errors were encountered: