tfmri.linalg.LinearOperatorNUFFT

class LinearOperatorNUFFT(domain_shape, trajectory, density=None, norm='ortho', name='LinearOperatorNUFFT')[source]

Bases: tensorflow_mri.python.util.linalg_imaging.LinearOperator

Linear operator acting like a nonuniform DFT matrix.

Parameters
  • domain_shape – A 1D integer tf.Tensor. The domain shape of this operator. This is usually the shape of the image but may include additional dimensions.

  • trajectory

    A tf.Tensor of type float32 or float64. Contains the sampling locations or k-space trajectory. Must have shape [..., M, N], where N is the rank (number of dimensions), M is the number of samples and ... is the batch shape, which can have any number of dimensions.

  • density

    A tf.Tensor of type float32 or float64. Contains the sampling density at each point in trajectory. Must have shape [..., M], where M is the number of samples and ... is the batch shape, which can have any number of dimensions. Defaults to None, in which case the density is assumed to be 1.0 in all locations.

  • norm

    A str. The FFT normalization mode. Must be None (no normalization) or 'ortho'.

  • name

    An optional str. The name of this operator.

Notes

In MRI, sampling density compensation is typically performed during the adjoint transform. However, in order to maintain the validity of the linear operator, this operator applies the compensation orthogonally, i.e., it scales the data by the square root of density in both forward and adjoint transforms. If you are using this operator to compute the adjoint and wish to apply the full compensation, you can do so via the precompensate method.

>>> import tensorflow as tf
>>> import tensorflow_mri as tfmri
>>> # Create some data.
>>> image_shape = (128, 128)
>>> image = image_ops.phantom(shape=image_shape, dtype=tf.complex64)
>>> trajectory = tfmri.sampling.radial_trajectory(
>>>     128, 128, flatten_encoding_dims=True)
>>> density = tfmri.sampling.radial_density(
>>>     128, 128, flatten_encoding_dims=True)
>>> # Create a NUFFT operator.
>>> linop = tfmri.linalg.LinearOperatorNUFFT(
>>>     image_shape, trajectory=trajectory, density=density)
>>> # Create k-space.
>>> kspace = tfmri.signal.nufft(image, trajectory)
>>> # This reconstructs the image applying only partial compensation
>>> # (square root of weights).
>>> image = linop.transform(kspace, adjoint=True)
>>> # This reconstructs the image with full compensation.
>>> image = linop.transform(linop.precompensate(kspace), adjoint=True)

Initialize the LinearOperator. (deprecated arguments)

Deprecated: SOME ARGUMENTS ARE DEPRECATED: (graph_parents). They will be removed in a future version. Instructions for updating: Do not pass graph_parents. They will no longer be used.

This is a private method for subclass use. Subclasses should copy-paste this ``__init__`` documentation.

Parameters
  • dtype – The type of the this LinearOperator. Arguments to matmul and solve will have to be this type.

  • graph_parents – (Deprecated) Python list of graph prerequisites of this LinearOperator Typically tensors that are passed during initialization

  • is_non_singular – Expect that this operator is non-singular.

  • is_self_adjoint – Expect that this operator is equal to its hermitian transpose. If dtype is real, this is equivalent to being symmetric.

  • is_positive_definite – Expect that this operator is positive definite, meaning the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive-definite. See: https://en.wikipedia.org/wiki/Positive-definite_matrix#Extension_for_non-symmetric_matrices

  • is_square – Expect that this operator acts like square [batch] matrices.

  • name – A name for this LinearOperator.

  • parameters – Python dict of parameters used to instantiate this LinearOperator.

Raises
  • ValueError

    If any member of graph_parents is None or not a Tensor.

  • ValueError – If hints are set incorrectly.