deepmr.fft.ifft

Contents

deepmr.fft.ifft#

deepmr.fft.ifft(input, axes=None, norm='ortho', centered=True)[source]#

Centered inverse Fast Fourier Transform.

Adapted from [1].

Parameters:
  • input (np.ndarray | torch.Tensor) – Input signal.

  • axes (Iterable[int]) – Axes over which to compute the iFFT. If not specified, apply iFFT over all the axes.

  • norm (str, optional) – FFT normalization. The default is ortho.

  • centered (bool, optional) – FFT centering. The default is True.

Returns:

output – Output signal.

Return type:

np.ndarray | torch.Tensor

Examples

>>> import torch
>>> import deepmr

First, create test image:

>>> kspace = torch.ones(32, 32, dtype=torch.complex64)

We now perform a 2D iFFT:

>>> image = deepmr.fft.ifft(kspace)

We can visualize the data:

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 2)
>>> ksp = ax[1].imshow(abs(kspace))
>>> ax[0].set_title("k-Space", color="orangered", fontweight="bold")
>>> ax[0].axis("off")
>>> ax[0].set_alpha(0.0)
>>> fig.colorbar(ksp, ax=ax[0], shrink=0.5)
>>> im = ax[0].imshow(abs(image))
>>> ax[1].set_title("Image", color="orangered", fontweight="bold")
>>> ax[1].axis("off")
>>> ax[1].set_alpha(0.0)
>>> fig.colorbar(im, ax=ax[1], shrink=0.5)
>>> plt.show()

References

[1] mikgroup/sigpy