Linear operators
Abstraction of linear operators as matrices \(y = A*x\). The implementation follow the SigPy and LinearmapAA.
Common operators, including +, -, *, are overloaded. One may freely compose operators as long as the size matches.
New linear operators require to implement _apply (forward, \(A\)) and _adjoint (conjugate adjoint, \(A'\)) functions, as well as size. Recommendation for efficient backpropagation (but you do not have to do this if the AD is efficient enough):
class forward(torch.autograd.Function):
@staticmethod
def forward(ctx, data_in):
return forward_func(data_in)
@staticmethod
def backward(ctx, grad_data_in):
return adjoint_func(grad_data_in)
forward_op = forward.apply
class adjoint(torch.autograd.Function):
@staticmethod
def forward(ctx, data_in):
return forward_func(data_in)
@staticmethod
def backward(ctx, grad_data_in):
return adjoint_func(grad_data_in)
adjoint_op = adjoint.apply
- mirtorch.linear.LinearMap.size_in
the size of the input of the linear map (a list)
- mirtorch.linear.LinearMap.size_out
the size of the output of the linear map (a list)
Attributes of LinearMap
Addition of linear operators. |
|
Scaling linear operators. |
|
Matrix multiplication of linear operators. |
|
Hermitian transpose of linear operators. |
|
Create a LinearMap corresponding to the Kronecker product of a linear map with the identity matrix, i.e., kron(I_n, A), where A is a LinearMap. |
|
Create a block-diagonal linear map from a list of linear maps. |
Basic image processing operations
A multidimensional finite difference operator, with the periodic boundary condition. |
|
A little more efficient way to implement the gram operator for the Gram (A'A) of finite difference. |
|
A little more efficient way to implement the gram operator for the Gram of finite difference, with the reflexive boundary condition. |
|
Expand an input vector into a diagonal matrix. |
|
Identity mapping. |
|
1D cross-correlation linear map. |
|
2D cross-correlation linear map. |
|
3D cross-correlation linear map. |
|
Patch operator to decompose image into blocks |
|
Patch operator to decompose 3D image into patches. |
|
A very preliminary implementation of 2D DWT. |
MRI system models
FFT operators with FFTshift and iFFTshift for multidimensional data. |
|
Non-Cartesian sense operator: "SENSE: Sensitivity encoding for fast MRI" The implementation calls Matthew Muckley's Torchkbnufft toolbox: https://github.com/mmuckley/torchkbnufft The input/ourput size depends on the sensitivity maps. |
|
Cartesian sense operator, following "SENSE: Sensitivity encoding for fast MRI". |
|
Gram operator (A'A) of the Non-Cartesian sense operator: "SENSE: Sensitivity encoding for fast MRI" The implementation calls Matthew Muckley's Torchkbnufft toolbox: https://github.com/mmuckley/torchkbnufft The input/ourput size depends on the sensitivity maps. |
|
B0-informed mri reconstruction, the name follows MIRT. |
SPECT system models
Forward and back-projection methods for SPECT image reconstruction. |
CT system models
Forward and back-projection methods for CT image reconstruction. |