pylops.medical.MRI2D

class pylops.medical.MRI2D(dims, mask, nlines=None, perc_center=0.1, engine='numpy', fft_engine='numpy', dtype='complex128', name='M', **kwargs_fft)[source]

2D Magnetic Resonance Imaging

Apply 2D Magnetic Resonance Imaging operator to obtain a k-space data (i.e., undersampled Fourier representation of the model).

Parameters:
dimslist or int

Number of samples for each dimension. Must be 2-dimensional and of size \(n_y \times n_x\)

maskstr or numpy.ndarray

Mask to be applied in the Fourier domain:

  • numpy.ndarray: a 2-dimensional array of size \(n_y \times n_x\) with 1 in the selected locations;

  • vertical-reg: mask with vertical lines (regularly sampled around the second dimension);

  • vertical-uni: mask with vertical lines (irregularly sampled around the second dimension, with lines drawn from a uniform distribution);

  • radial-reg: mask with radial lines (regularly sampled around the \(-\pi/\pi\) angles);

  • radial-uni: mask with radial lines (irregularly sampled around the \(-\pi/\pi\) angles, with angles drawn from a uniform distribution);

nlinesint, optional

Number of lines in the k-space. Not required if mask is passed as array.

perc_centerfloat, optional

Percentage of total lines to retain in the center. Not required if mask is passed as array.

enginestr, optional

Engine used for computation (numpy or jax).

fft_enginestr, optional

Engine used for fft computation (numpy or scipy or mkl_fft).

dtypestr, optional

Type of elements in input array.

namestr, optional

Name of operator (to be used by pylops.utils.describe.describe)

**kwargs_fft

Arbitrary keyword arguments to be passed to the selected fft method

Attributes:
masknumpy.ndarray

Mask applied in the Fourier domain.

ROppylops.Restriction or pylops.Diagonal or pylops.signalprocessing.Bilinear

Operator that applies the mask in the Fourier domain.

dimstuple

Shape of the array after the adjoint, but before flattening.

For example, x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).

dimsdtuple

Shape of the array after the forward, but before flattening.

For example, y_reshaped = (Op * x.ravel()).reshape(Op.dimsd).

shapetuple

Operator shape

explicitbool

Operator contains a matrix that can be solved explicitly (True) or not (False)

Raises:
ValueError

If mask is not one of the accepted strings or a numpy array.

ValueError

If fft_engine is neither numpy, fftw, nor scipy.

ValueError

If nlines or perc_center are not specified when providing mask as string.

ValueError

If perc_center is greater than 0 when using vertical-reg mask.

Notes

The MRI2D operator applies 2-dimensional Fourier transform to the model, followed by a subsampling with a given mask:

\[\mathbf{d} = \mathbf{R} \mathbf{F}_{k} \mathbf{m}\]

where \(\mathbf{F}_{k}\) is the 2-dimensional Fourier transform and \(\mathbf{R}\) is the mask.

Methods

__init__(dims, mask[, nlines, perc_center, ...])

adjoint()

apply_columns(cols)

Apply subset of columns of operator

cond([uselobpcg])

Condition number of linear operator.

conj()

Complex conjugate operator

div(y[, niter, densesolver])

Solve the linear problem \(\mathbf{y}=\mathbf{A}\mathbf{x}\).

dot(x)

Matrix-matrix or matrix-vector multiplication.

eigs([neigs, symmetric, niter, uselobpcg])

Most significant eigenvalues of linear operator.

matmat(X)

Matrix-matrix multiplication.

matvec(x)

Matrix-vector multiplication.

reset_count()

Reset counters

rmatmat(X)

Matrix-matrix multiplication.

rmatvec(x)

Adjoint matrix-vector multiplication.

todense([backend])

Return dense matrix.

toimag([forw, adj])

Imag operator

toreal([forw, adj])

Real operator

tosparse()

Return sparse matrix.

trace([neval, method, backend])

Trace of linear operator.

transpose()

Examples using pylops.medical.MRI2D

MRI modelling

MRI modelling