diff --git a/src/fourier_filtering.jl b/src/fourier_filtering.jl index 291a3a4..f41dc16 100644 --- a/src/fourier_filtering.jl +++ b/src/fourier_filtering.jl @@ -193,7 +193,9 @@ function fourier_filter_by_1D_RFT!(arr::TA, fct=window_gaussian; dims=(1:ndims(a end end arr_ft .*= win - fourier_filter_by_1D_FT!(arr_ft, fct; dims=dims[2:end], transform_win=transform_win, kwargs...) + + # hand over to the fft-based routines for all other dimensions + fourier_filter_by_1D_FT!(arr_ft, fct; dims=dims[2:end], transform_win=transform_win, keep_integral=keep_integral, kwargs...) # go back to real space now and return because shift_by_1D_FT processed # the other dimensions already mul!(arr, inv(p), arr_ft) diff --git a/test/fourier_filtering.jl b/test/fourier_filtering.jl index 19fc583..db7c0ee 100644 --- a/test/fourier_filtering.jl +++ b/test/fourier_filtering.jl @@ -22,14 +22,14 @@ Random.seed!(42) @testset "Gaussian filter real" begin sz = (21, 22) x = randn(Float32, sz) - sigma = (1.1,2.2) + sigma = (1.1, 2.2) gf = filter_gaussian(x, sigma, real_space_kernel=true) # Note that this is not the same, since one kernel is generated in real space and one in Fourier space! # with sizes around 10, the difference is huge! k = gaussian(sz, sigma=sigma) k = k./sum(k) # different than "normal". gf2 = conv_psf(x, k) - @test ≈(gf,gf2, rtol=1e-2) # it is realatively inaccurate due to the kernel being generated in different places + @test ≈(gf, gf2, rtol=1e-2) # it is realatively inaccurate due to the kernel being generated in different places gf2 = filter_gaussian(zeros(sz), sigma, real_space_kernel=true) @test ≈(gf2, zeros(sz)) # it can be debated how to best normalize a Gaussian filter end