mri.operators.linear.wavelet#

Provide linears operators classes adapted to MRI reconstruction algorithms.

class WaveletN(wavelet_name, nb_scale=4, verbose=0, dim=2, n_coils=1, n_jobs=1, backend='threading', **kwargs)[source]#

Bases: mri.operators.base.OperatorBase

2D and 3D wavelet transform class.

Initialize the ‘WaveletN’ class.

Parameters
  • wavelet_name (str) – the wavelet name to be used during the decomposition.

  • nb_scales (int, default 4) – the number of scales in the decomposition.

  • n_coils (int, default 1) – the number of coils for multichannel reconstruction

  • n_jobs (int, default 1) – the number of cores to use for multichannel.

  • backend (str, default "threading") – the backend to use for parallel multichannel linear operation.

  • verbose (int, default 0) – the verbosity level.

nb_scale#

number of scale decomposed in wavelet space.

Type

int

n_jobs#

number of jobs for parallel computation

Type

int

n_coils#

number of coils use f

Type

int

backend#

Backend use for parallel computation

Type

str

verbose#

Verbosity level

Type

int

_op(data)[source]#
op(data)[source]#

Define the wavelet operator.

This method returns the input data convolved with the wavelet filter.

Parameters

data (numpy.ndarray or Image) – input 2D data array.

Returns

coeffs – the wavelet coefficients.

Return type

numpy.ndarray

_adj_op(coeffs, coeffs_shape, dtype='array')[source]#

Define the wavelet adjoint operator.

This method returns the reconstructed image.

Parameters
  • coeffs (numpy.ndarray) – the wavelet coefficients.

  • dtype (str, default 'array') – if ‘array’ return the data as a ndarray, otherwise return a pysap.Image.

Returns

data – the reconstructed data.

Return type

numpy.ndarray

adj_op(coeffs)[source]#

Define the wavelet adjoint operator.

This method returns the reconstructed image.

Parameters

coeffs (numpy.ndarray) – the wavelet coefficients.

Returns

data – the reconstructed data.

Return type

numpy.ndarray

l2norm(shape)[source]#

Compute the L2 norm.

Parameters

shape (tuple) – The data shape.

Returns

norm – The L2 norm.

Return type

float

class WaveletUD2(wavelet_id=24, nb_scale=4, n_jobs=1, backend='threading', n_coils=1, verbose=0)[source]#

Bases: mri.operators.base.OperatorBase

Wavelet undecimated operator using pysap wrapper.

Parameters
  • wavelet_id (int, default 24 = undecimated (bi-) orthogonal transform) – ID of wavelet being used

  • nb_scale (int, default 4) – the number of scales in the decomposition.

  • multichannel (bool, default False) – Boolean value to indicate if the incoming data is from multiple-channels

  • n_jobs (int, default 0) – Number of CPUs to run on. Only applicable if multichannel=True.

  • backend ('threading' | 'multiprocessing', default 'threading') – Denotes the backend to use for parallel execution across multiple channels.

  • verbose (int, default 0) – The verbosity level for Parallel operation from joblib

_has_run#

Checks if the get_mr_filters was called already

Type

bool

_get_filters(shape)[source]#

Get the Wavelet coefficients of Delta[0][0].

This function is called only once and later the wavelet coefficients are obtained by convolving these coefficients with input Data

Parameters

shape (tuple or array) – Shape of data on which the filter will be applied.

_op(data)[source]#

Define the wavelet operator for single channel.

Returns wavelet coefficients for a single channel

Parameters

data (numpy.ndarray or Image) – input 2D data array.

Returns

coeffs – the wavelet coefficients.

Return type

numpy.ndarray

op(data)[source]#

Define the wavelet operator.

This method returns the input data convolved with the wavelet filter.

Parameters

data (numpy.ndarray or Image) – input 2D data array.

Returns

coeffs – the wavelet coefficients.

Return type

numpy.ndarray

_adj_op(coeffs, coeffs_shape)[source]#

Define the wavelet adjoint operator.

This method returns the reconstructed image for single channel.

Parameters
  • coeffs (numpy.ndarray) – the wavelet coefficients.

  • coeffs_shape (numpy.ndarray) – The shape of coefficients to unflatten before adjoint operation

Returns

data – the reconstructed data.

Return type

numpy.ndarray

adj_op(coeffs)[source]#

Define the wavelet adjoint operator.

This method returns the reconstructed image.

Parameters

coeffs (numpy.ndarray) – the wavelet coefficients.

Returns

data – the reconstructed data.

Return type

numpy.ndarray

l2norm(shape)[source]#

Compute the L2 norm.

Parameters

shape (uplet) – the data shape.

Returns

norm – the L2 norm.

Return type

float