From e18b1d2687a031be395a9dc27c0e2d5e1808aa00 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Wed, 17 Jan 2024 18:31:55 -0500 Subject: [PATCH] COMP: Avoid type conversion errors on Mac with new ITK --- Tensor/TensorFunctions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tensor/TensorFunctions.h b/Tensor/TensorFunctions.h index 0477e671e..167b771d0 100644 --- a/Tensor/TensorFunctions.h +++ b/Tensor/TensorFunctions.h @@ -438,7 +438,7 @@ GetMetricTensorCost(TVectorType dpath, TTensorType dtv, unsigned int matrixpower vec(0, 0) = dpath[0]; vec(1, 0) = dpath[1]; vec(2, 0) = dpath[2]; - MatrixType inv = vnl_matrix_inverse(DT); + MatrixType inv = vnl_matrix_inverse(DT).inverse(); for (unsigned int lo = 1; lo < matrixpower; lo++) { inv = inv * inv; @@ -837,7 +837,7 @@ GetMetricTensorCost(itk::Vector dpath, TTensorType dtv) vec(0, 0) = dpath[0]; vec(1, 0) = dpath[1]; vec(2, 0) = dpath[2]; - MatrixType inv = vnl_matrix_inverse(DT); + MatrixType inv = vnl_matrix_inverse(DT).inverse(); MatrixType sol = vec.transpose() * inv * vec; float cost = sol(0, 0) / etot;