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:
- dims
listorint Number of samples for each dimension. Must be 2-dimensional and of size \(n_y \times n_x\)
- mask
strornumpy.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);
- nlines
int, optional Number of lines in the k-space. Not required if
maskis passed as array.- perc_center
float, optional Percentage of total lines to retain in the center. Not required if
maskis passed as array.- engine
str, optional Engine used for computation (
numpyorjax).- fft_engine
str, optional Engine used for fft computation (
numpyorscipyormkl_fft).- dtype
str, optional Type of elements in input array.
- name
str, 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
- dims
- Attributes:
- mask
numpy.ndarray Mask applied in the Fourier domain.
- ROp
pylops.Restrictionorpylops.Diagonalorpylops.signalprocessing.Bilinear Operator that applies the mask in the Fourier domain.
- dims
tuple Shape of the array after the adjoint, but before flattening.
For example,
x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).- dimsd
tuple Shape of the array after the forward, but before flattening.
For example,
y_reshaped = (Op * x.ravel()).reshape(Op.dimsd).- shape
tuple Operator shape
- explicit
bool Operator contains a matrix that can be solved explicitly (
True) or not (False)
- mask
- Raises:
- ValueError
If
maskis not one of the accepted strings or a numpy array.- ValueError
If
fft_engineis neithernumpy,fftw, norscipy.- ValueError
If
nlinesorperc_centerare not specified when providingmaskas string.- ValueError
If
perc_centeris greater than 0 when usingvertical-regmask.
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()