direct.algorithms package#

Submodules#

direct.algorithms.mri_algorithms module#

This module contains mathematical optimization techniques specific to MRI.

class direct.algorithms.mri_algorithms.EspiritCalibration(backward_operator, threshold=0.05, kernel_size=6, crop=0.95, max_iter=100, kspace_key=KspaceKey.MASKED_KSPACE)[source]#

Bases: DirectModule

Estimates sensitivity maps estimated with the ESPIRIT calibration method as described in [1].

We adapted code for ESPIRIT method adapted from [2].

References:

__init__(backward_operator, threshold=0.05, kernel_size=6, crop=0.95, max_iter=100, kspace_key=KspaceKey.MASKED_KSPACE)[source]#

Inits EspiritCalibration.

Parameters:
  • backward_operator (Callable) – The backward operator, e.g. some form of inverse FFT (centered or uncentered).

  • threshold (float) – Threshold for the calibration matrix. Default: 0.05.

  • kernel_size (int) – Kernel size for the calibration matrix. Default: 6.

  • crop (float) – Output eigenvalue cropping threshold. Default: 0.95.

  • max_iter (int) – Power method iterations. Default: 100.

  • kspace_key (KspaceKey) – K-space key. Default: KspaceKey.MASKED_KSPACE.

calculate_sensitivity_map(acs_mask, kspace)[source]#

Calculates sensitivity map given as input the acs_mask and the kspace.

Parameters:
  • acs_mask (Tensor) – Autocalibration mask.

  • kspace (Tensor) – K-space.

Return type:

Tensor

Returns:

Sensitivity map.

forward(sample)[source]#

Forward method of EspiritCalibration.

Parameters:

sample (Dict[str, Any]) – Contains key kspace_key.

Return type:

Tensor

Returns:

Sensitivity map tensor.

direct.algorithms.optimization module#

General mathematical optimization techniques.

class direct.algorithms.optimization.Algorithm(max_iter=30)[source]#

Bases: ABC

Base class for implementing mathematical optimization algorithms.

__init__(max_iter=30)[source]#
update()[source]#

Update the algorithm’s parameters and increment the iteration count.

Return type:

None

done()[source]#

Check if the algorithm has converged.

Return type:

bool

Returns:

Whether the algorithm has converged or not.

fit(*args, **kwargs)[source]#

Fit the algorithm.

Parameters:
  • *args – Tuple of arguments for _fit method.

  • **kwargs – Keyword arguments for _fit method.

Return type:

None

class direct.algorithms.optimization.MaximumEigenvaluePowerMethod(forward_operator, norm_func=None, max_iter=30)[source]#

Bases: Algorithm

A class for solving the maximum eigenvalue problem using the Power Method.

__init__(forward_operator, norm_func=None, max_iter=30)[source]#

Inits MaximumEigenvaluePowerMethod.

Parameters:
  • forward_operator (Callable) – The forward operator for the problem.

  • norm_func (Optional[Callable]) – An optional function for normalizing the eigenvector. Default: None.

  • max_iter (int) – Maximum number of iterations to run the algorithm. Default: 30.

Module contents#

Direct module for traditional mathematical optimization techniques, general or mri-specific.