FourierOperatorBase#

class mrinufft.operators.base.FourierOperatorBase[source]#

Bases: ABC

Base Fourier Operator class.

Every (Linear) Fourier operator inherits from this class, to ensure that we have all the functions rightly implemented as required by ModOpt.

Methods

__init__

adj_op

Compute adjoint operator transform.

compute_density

Compute the density compensation weights and set it.

data_consistency

Compute the gradient data consistency.

get_lipschitz_cst

Return the Lipschitz constant of the operator.

op

Compute operator transform.

with_off_resonnance_correction

Return a new operator with Off Resonnance Correction.

Attributes

cpx_dtype

Return complex floating precision of the operator.

density

Density compensation of the operator.

dtype

Return floating precision of the operator.

interfaces

n_coils

Number of coils for the operator.

n_samples

Return the number of samples used by the operator.

ndim

Number of dimensions in image space of the operator.

norm_factor

Normalization factor of the operator.

samples

Return the samples used by the operator.

shape

Shape of the image space of the operator.

smaps

Sensitivity maps of the operator.

uses_density

Return True if the operator uses density compensation.

uses_sense

Return True if the operator uses sensitivity maps.

abstract op(data)[source]#

Compute operator transform.

Parameters:

data (np.ndarray) – input as array.

Returns:

result – operator transform of the input.

Return type:

np.ndarray

abstract adj_op(coeffs)[source]#

Compute adjoint operator transform.

Parameters:

x (np.ndarray) – input data array.

Returns:

results – adjoint operator transform.

Return type:

np.ndarray

data_consistency(image, obs_data)[source]#

Compute the gradient data consistency.

This is the naive implementation using adj_op(op(x)-y). Specific backend can (and should!) implement a more efficient version.

with_off_resonnance_correction(B, C, indices)[source]#

Return a new operator with Off Resonnance Correction.

compute_density(method=None)[source]#

Compute the density compensation weights and set it.

Parameters:

method (str or callable or array or dict) – The method to use to compute the density compensation. If a string, the method should be registered in the density registry. If a callable, it should take the samples and the shape as input. If a dict, it should have a key ‘name’, to determine which method to use. other items will be used as kwargs. If an array, it should be of shape (Nsamples,) and will be used as is.

get_lipschitz_cst(max_iter=10, **kwargs)[source]#

Return the Lipschitz constant of the operator.

Parameters:
  • max_iter (int) – number of iteration to compute the lipschitz constant.

  • **kwargs – Extra arguments givent

Returns:

Spectral Radius

Return type:

float

Notes

This uses the Iterative Power Method to compute the largest singular value of a minified version of the nufft operator. No coil or B0 compensation is used, but includes any computed density.

property uses_sense#

Return True if the operator uses sensitivity maps.

property uses_density#

Return True if the operator uses density compensation.

property ndim#

Number of dimensions in image space of the operator.

property shape#

Shape of the image space of the operator.

property n_coils#

Number of coils for the operator.

property smaps#

Sensitivity maps of the operator.

property density#

Density compensation of the operator.

property dtype#

Return floating precision of the operator.

property cpx_dtype#

Return complex floating precision of the operator.

property samples#

Return the samples used by the operator.

property n_samples#

Return the number of samples used by the operator.

property norm_factor#

Normalization factor of the operator.