etomo.operators.fourier.fourier#

These operators are not necessary as the reconstruction is faster and more direct with Radon operator, but they can be used to compare CS with ML approaches as it is easier to find an implementation of fourier transform in tensorflow than an implementation of the Radon transform gpuNUFFT is taken directly from pysap-mri

class FourierBase[source]#

Bases: object

Base Fourier transform operator class

op(img)[source]#

This method calculates a Fourier transform

adj_op(x)[source]#

This method calculates the adjoint Fourier transform of a real or complex sequence

class NUFFT2(samples, shape, normalized=True)[source]#

Bases: etomo.operators.fourier.fourier.FourierBase

Standard 2D non catesian Fast Fourrier Transform class

samples#

samples coordinates in the Fourier domain.

Type

numpy.ndarray((m’ * n, 2))

shape#

shape of the final reconstructed image (m, n) (not necessarily a square matrix).

Type

tuple(int)

normalized#

tells if operator is normalized or not.

Type

bool, default False

op(img)[source]#

This method calculates the masked non-cartesian Fourier transform of a 2-D image.

Parameters

img (numpy.ndarray((m, n))) – input 2D array with the same shape as the mask.

Returns

x – masked Fourier transform of the input image.

Return type

numpy.ndarray((m * n))

adj_op(x)[source]#

This method calculates the adjoint non-cartesian Fourier transform of a 2-D coefficients array.

Parameters

x (numpy.ndarray((m' * n'))) – masked non-cartesian Fourier transform 2D data.

Returns

img – adjoint 2D discrete Fourier transform of the input coefficients.

Return type

numpy.ndarray((m, n))

class gpuNUFFT(samples, shape, density_comp=None, n_coils=1, kernel_width=3, sector_width=8, osf=2, balance_workload=True, smaps=None)[source]#

Bases: etomo.operators.fourier.fourier.FourierBase

GPU implementation of N-D non uniform Fast Fourrier Transform class. .. attribute:: samples

the normalized kspace location values in the Fourier domain.

type

numpy.ndarray

shape#

shape of the image

Type

tuple(int)

operator#

to carry out operation

Type

NUFFTOp object

n_coils#

Number of coils used to acquire the signal in case of multiarray receiver coils acquisition. If n_coils > 1, please organize data as n_coils X data_per_coil

Type

int, default 1

op(image, interpolate_data=False)[source]#

This method calculates the masked non-cartesian Fourier transform of a 2D / 3D image. :param image: input array with the same shape as shape. :type image: numpy.ndarray :param interpolate_data: if set to True, the image is just apodized and interpolated to

kspace locations. This is used for density estimation.

Returns

Non Uniform Fourier transform of the input image.

Return type

numpy.ndarray

adj_op(coeff, grid_data=False)[source]#

This method calculates adjoint of non-uniform Fourier transform of a 1-D coefficients array. :param coeff: masked non-uniform Fourier transform 1D data. :type coeff: numpy.ndarray :param grid_data: if True, the kspace data is gridded and returned,

this is used for density compensation

Returns

adjoint operator of Non Uniform Fourier transform of the input coefficients.

Return type

numpy.ndarray