tools.deblur#
- bartorch.tools.deblur()#
Remove off-resonance blur from a reconstructed spiral image.
The result is \(\sum_m a_m(f(r))\, (h_m * x)(r)\), with \(h_m\) the image-domain kernel of term \(m\) of
transferand the weights linearly interpolated at each voxel’s frequency \(f(r)\). \(|k| / k_{max}\) is the k-space coordinate normalized to one at the Nyquist edge of each axis: the armtransferwas fitted to is taken to reach the edge of the image’s grid.- Parameters:
image (torch.Tensor) – Complex image
(..., *spatial), 2D or 3D, with the spatial axes those offield_map.field_map (torch.Tensor) – Off-resonance frequency at each voxel, in Hz,
(*spatial).transfer (SpiralTransfer) – Factorization from
fit_transfer().backend ({"auto", "fft", "conv"}, default='auto') –
"fft"applies each term as a k-space multiply;"conv", for a separabletransferand a CUDA image with Triton installed, as a separable circular convolution truncated to the taps holding all but 1e-5 of the kernel’s energy per axis;"auto"chooses"conv"where it applies and Triton is importable, and"fft"otherwise.
- Returns:
The deblurred image, of the shape and dtype of
image.- Return type:
torch.Tensor
- Raises:
ValueError – If
imageis not complex, its spatial shape is not that offield_map, orbackend="conv"is asked of an MFItransfer.
Notes
Peak memory is one accumulator and one working volume, and for MFI one real volume of readout times, independent of the number of terms.