Skip to content

Commit

Permalink
implement reshape hack so that ESPIRIT is compatible with the MKL bac…
Browse files Browse the repository at this point in the history
…kend of FFTW.
  • Loading branch information
JakobAsslaender committed Oct 8, 2022
1 parent 8d19c14 commit e1c28e7
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 e1c28e7

Please sign in to comment.