mri.operators.proximity
Contents
mri.operators.proximity#
- class AutoWeightedSparseThreshold(coeffs_shape, linear=<modopt.opt.linear.base.Identity object>, update_period=0, sigma_range='global', thresh_range='global', threshold_estimation='sure', threshold_scaler=1.0, **kwargs)[source]#
Bases:
modopt.opt.proximity.SparseThreshold
Automatic Weighting of sparse coefficients.
This proximty automatically determines the threshold for Sparse (e.g. Wavelet based) coefficients.
The weight are computed on first call, and updated on every
update_period
call. Note that the coarse/approximation scale will not be thresholded.- Parameters
coeffs_shape (list of tuple) – list of shape for the subbands.
linear (LinearOperator) – Required for cost estimation.
update_period (int) – Estimation of the weight update period.
threshold_estimation (str) – threshold estimation method. Available are “sure”, “hybrid-sure” and “universal”
thresh_range (str) – threshold range of estimation. Available are “global”, “scale” and “band”
sigma_range (str) – noise std range of estimation. Available are “global”, “scale” and “band”
thresh_type (str) – “hard” or “soft” thresholding.
- _auto_thresh(input_data)[source]#
Compute the best weights for the input_data.
- Parameters
input_data (numpy.ndarray) – Array of sparse coefficient.
See also
wavelet_threshold_estimate
- _op_method(input_data, extra_factor=1.0)[source]#
Operator.
This method returns the input data thresholded by the weights. The weights are computed using the universal threshold rule.
- Parameters
input_data (numpy.ndarray) – Input data array
extra_factor (float) – Additional multiplication factor (default is
1.0
)
- Returns
Thresholded data
- Return type
- class WeightedSparseThreshold(weights, coeffs_shape, weight_type='scale_based', zero_weight_coarse=True, linear=<modopt.opt.linear.base.Identity object>, **kwargs)[source]#
Bases:
modopt.opt.proximity.SparseThreshold
This is a weighted version of SparseThreshold in ModOpt. When chosen scale_based, it allows the users to specify an array of weights W[i] and each weight is assigen to respective scale i. Also, custom weights can be defined. Note that the weights on coarse scale is always set to 0
- Parameters
weights (numpy.ndarray) – Input array of weights or a tuple holding base weight W and power P
coeffs_shape (tuple) – The shape of linear coefficients
weight_type (string 'custom' | 'scale_based' | 'custom_scale',) – default ‘scale_based’ Mode of operation of proximity: custom -> custom array of weights scale_based -> custom weights applied per scale
zero_weight_coarse (bool, default True) –
linear (object, default Identity()) – Linear operator, to be used in cost function evaluation
See also
SparseThreshold
parent class
- property mu#
mu is the weights used for thresholding
- class OWL(alpha, beta, bands_shape, n_coils, mode='band_based', n_jobs=1)[source]#
Bases:
modopt.opt.proximity.ProximityParent
This class handles reshaping coefficients based on mode and feeding in right format the OWL operation to OrderedWeightedL1Norm
- Parameters
alpha (float) – value of alpha for parameterizing weights
beta (float) – value of beta for parameterizing weights
band_shape (list of tuples) – the shape of all bands, this corresponds to linear_op.coeffs_shape
n_coils (int) – number of channels
mode (string 'all' | 'band_based' | 'coeff_based' | 'scale_based',) – default ‘band_based’ Mode of operation of proximity: all -> on all coefficients in all channels band_based -> on all coefficients in each band coeff_based -> on all coefficients but across each channel scale_based -> on al coefficients in each scale
n_jobs (int, default 1) – number of cores to be used for operation
- static _oscar_weights(alpha, beta, size)[source]#
Here we parametrize weights based on alpha and beta
- _op_method(data, extra_factor=1.0)[source]#
Based on mode, reshape the coefficients and call OrderedWeightedL1Norm
- Parameters
data (numpy.ndarray) – Input array of data
- _cost_method(data)[source]#
Cost function Based on mode, reshape the incoming data and call cost in OrderedWeightedL1Norm This method calculate the cost function of the proximable part.
- Parameters
data (numpy.ndarray) – Input array of the sparse code.
- Returns
- Return type
The cost of this sparse code