Python Sparse data Analysis Package external MRI plugin.
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.
-
class
mri.operators.linear.dictionary.DictionaryLearning(img_shape, dictionary_r, dictionary_i=None)[source]¶ This class defines the sparse encoder in a learnt dictionary (using MiniBatchDictionaryLearning from sklearn) and its back projection.
-
adj_op(coeffs, dtype='array')[source]¶ Adjoint operator.
This method returns the reconsructed image from the sparse coefficients.
Remark: This method only works for squared patches
- Parameters
coeffs : ndarray of floats,
2d matrix dim nb_patches*nb_components, the sparse coefficients.
dtype : str, default ‘array’
if ‘array’ return the data as a ndarray, otherwise return a pysap.Image.
- Returns
ndarray, the reconstructed data.
-
l2norm(data_shape)[source]¶ Compute the L2 norm.
- Parameters
data_shape : uplet
the data shape.
- Returns
norm : float
the L2 norm.
-
op(image)[source]¶ Operator.
This method returns the representation of the input data in the learnt dictionary, that is to say the sparse coefficients.
Remark: This method only works for squared patches
- Parameters
image : ndarray
Input data array, a 2D image.
- Returns
coeffs : ndarray of complex if is_complex, default(float)
2d matrix dim nb_patches*nb_components, the sparse coefficients.
-
Follow us