Skip to content

Commit

Permalink
fix fftshift use in PS widget
Browse files Browse the repository at this point in the history
  • Loading branch information
brisvag committed Feb 23, 2024
1 parent 00d41c9 commit 8d046c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/blik/widgets/power_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dask.array as da
import numpy as np
from magicgui import magic_factory
from scipy.fft import fftn, fftshift
from scipy.fft import fftn, fftshift, ifftshift

if TYPE_CHECKING:
import napari
Expand All @@ -24,7 +24,7 @@ def power_spectrum(
axes = (1, 2) if image.metadata["stack"] else None
raw = da.compute(image.data)[0]
power_spectrum = np.abs(
fftshift(fftn(fftshift(raw, axes=axes), axes=axes), axes=axes)
fftshift(fftn(ifftshift(raw, axes=axes), axes=axes), axes=axes)
)
return (
np.log(power_spectrum + 1),
Expand Down

0 comments on commit 8d046c3

Please sign in to comment.