From 7605557865cbe5aaf4f138c491ae9cda1dd10cb0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 30 Dec 2024 22:02:38 +1100 Subject: [PATCH] dwi2tensor: Fix weights recalculation - Previously, if -iter 1 was specified, the weights were not recomputed, and so results were identical to that with -iter 0. - Do not unnecessarily recompute weights at completion of the final iteration. --- cmd/dwi2tensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dwi2tensor.cpp b/cmd/dwi2tensor.cpp index c814732552..8028a40b5b 100644 --- a/cmd/dwi2tensor.cpp +++ b/cmd/dwi2tensor.cpp @@ -149,7 +149,7 @@ class Processor { MEMALIGN(Processor) work.setZero(); work.selfadjointView().rankUpdate (b.transpose()*w.asDiagonal()); p = llt.compute (work.selfadjointView()).solve(b.transpose()*w.asDiagonal()*w.asDiagonal()*dwi); - if (maxit > 1) + if (it < maxit) w = (b*p).array().exp(); }