Skip to content

Commit

Permalink
Merge pull request #118 from MagneticResonanceImaging/ESPIRIT_MKL_com…
Browse files Browse the repository at this point in the history
…patibility

reshape hack so that ESPIRIT is compatible with the MKL backend of FFTW
  • Loading branch information
tknopp authored Oct 8, 2022
2 parents 8d19c14 + e1c28e7 commit 4e2095a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Tools/CoilSensitivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ function kernelEig(kernel::Array{T}, imsize::Tuple, nmaps=1; use_poweriterations
end
end
end
fft!(kern2_, 3:ndims(kern2_))
# resize is neccessary for compatibility with MKL
reshape(fft!(reshape(kern2_, nc^2, sizePadded...), 2:ndims(kern2_)-1), nc, nc, sizePadded...)

kern2 = zeros(T, nc, nc, imsize...)
idx_center = CartesianIndices(sizePadded) .- CartesianIndex(sizePadded 2) .+ CartesianIndex(imsize 2)
@views ifftshift!(kern2[:,:,idx_center], kern2_, 3:ndims(kern2_))

ifft!(kern2, 3:ndims(kern2))
reshape(ifft!(reshape(kern2, nc^2, imsize...), 2:ndims(kern2)-1), nc, nc, imsize...)
kern2 .*= prod(imsize) / prod(sizePadded) / prod(ksize)


Expand Down

0 comments on commit 4e2095a

Please sign in to comment.