mri.reconstructors.base#

class ReconstructorBase(fourier_op, linear_op, regularizer_op, gradient_formulation, grad_class, init_gradient_op=True, verbose=0, **extra_grad_args)[source]#

Bases: object

Base reconstructor class for reconstruction.

This class holds some parameters that are common for all MR Image reconstructors.

Notes

For the Analysis case, finds the solution for x of: ..math:: (1/2) * ||F x - y||^2_2 + mu * H (W x)

For the Synthesis case, finds the solution of: ..math:: (1/2) * ||F Wt alpha - y||^2_2 + mu * H(alpha) with ..math:: alpha = W x and x = Wt alpha

Parameters
  • fourier_op (instance of FourierOperatorBase) – Defines the fourier operator \(F\) in the above equation

  • linear_op (object) – Defines the linear sparsifying operator denoted \(W\) in the above equation. This must operate on x and have 2 functions, op(x) and adj_op(coeff) which implements the operator and adjoint operator. For wavelets, this can be object of class WaveletN or WaveletUD2 from mri.operators.linear

  • regularizer_op (operator, (optional default None)) – Defines the regularization operator for the regularization function H. If None, the regularization chosen is Identity and the optimization turns to gradient descent. Defines \(H\) in the above equation.

  • gradient_formulation (str between 'analysis' or 'synthesis',) – default ‘synthesis’ defines the formulation of the image model which defines the gradient.

  • grad_class (Gradient class from mri.operators.gradient.) – Points to the gradient class based on the MR Image model and gradient_formulation.

  • init_gradient_op (bool, default True) – This parameter controls whether the gradient operator must be initialized right now. If set to false, the user needs to call initialize_gradient_op to initialize the gradient at right time before reconstruction

  • verbose (int, optional default 0) –

    Verbosity levels

    1 => Print basic debug information 5 => Print all initialization information 20 => Calculate cost at the end of each iteration. 30 => Print the debug information of operators if defined by class NOTE - High verbosity (>20) levels are computationally intensive.

  • extra_grad_args (Extra Keyword arguments for gradient initialization) – This holds the initialization parameters used for gradient initialization which is obtained from ‘grad_class’. Please refer to mri.operators.gradient.base for reference. In case of synthesis formulation, the ‘linear_op’ is also passed as an extra arg

initialize_gradient_op(**extra_args)[source]#
reconstruct(kspace_data, optimization_alg='pogm', x_init=None, num_iterations=100, cost_op_kwargs=None, **kwargs)[source]#

Perform the base reconstruction.

Parameters
  • kspace_data (numpy.ndarray or KspaceGeneratorBase) – the acquired value in the Fourier domain. this is y in above equation.

  • optimization_alg (str (optional, default 'pogm')) – Type of optimization algorithm to use, ‘pogm’ | ‘fista’ | ‘condatvu’

  • x_init (numpy.ndarray (optional, default None)) – input initial guess image for reconstruction. If None, the initialization will be an ndarray of zeros

  • num_iterations (int (optional, default 100)) – number of iterations of algorithm

  • cost_op_kwargs (dict (optional, default None)) – specifies the extra keyword arguments for cost operations. please refer to modopt.opt.cost.costObj for details.

  • kwargs (extra keyword arguments for modopt algorithm) – Please refer to corresponding ModOpt algorithm class for details. https://github.com/CEA-COSMIC/ModOpt/blob/master/ modopt/opt/algorithms.py