From ec9ccd2591f9bef23c57bb6b2d78c00adc63f5be Mon Sep 17 00:00:00 2001 From: Jakob Asslaender Date: Tue, 9 Jan 2024 19:15:23 -0500 Subject: [PATCH] bugfix --- MRICoilSensitivities/src/espirit.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MRICoilSensitivities/src/espirit.jl b/MRICoilSensitivities/src/espirit.jl index cd566236..f5960bf8 100644 --- a/MRICoilSensitivities/src/espirit.jl +++ b/MRICoilSensitivities/src/espirit.jl @@ -180,13 +180,14 @@ function kernelEig(kernel::Array{T}, imsize::Tuple, nmaps=1; use_poweriterations kern2 = [Matrix{T}(undef, nc, nc) for _ = 1:Threads.nthreads()] @floop for n ∈ CartesianIndices(imsize) + kernel_dft!(kern2[Threads.threadid()], kern2_, n, imsize, sizePadded) + if use_poweriterations && nmaps == 1 - kernel_dft!(kern2[Threads.threadid()], kern2_, n, imsize, sizePadded) S, U = power_iterations!(kern2[Threads.threadid()], b=b[Threads.threadid()], bᵒˡᵈ=bᵒˡᵈ[Threads.threadid()]) U .*= transpose(exp.(-1im .* angle.(U[1]))) @views eigenVals[n, 1, :] .= real.(S) else - S, U = eigen!(view(kern2, :, :, n); sortby = (λ) -> -abs(λ)) + S, U = eigen!(kern2[Threads.threadid()]; sortby = (λ) -> -abs(λ)) U = @view U[:,1:nmaps] U .*= transpose(exp.(-1im .* angle.(@view U[1, :]))) @views eigenVals[n, 1, :] .= real.(S[1:nmaps])