apps.pics#
- bartorch.apps.pics()#
Parallel-imaging compressed-sensing reconstruction, BART’s
pics -S.The steps of the command: the sampling pattern applied to the k-space, on a grid the modulation into BART’s uncentred convention, division by the data scaling, the solve with an encoding from
bartorch.linopand an iteration frombartorch.optim, and multiplication of the image by the scaling. Regularization weights are therefore relative to the scaled data, and the image is in the units ofkspace. On a grid the result equals the command’s to the bit.- Parameters:
kspace (torch.Tensor) – k-space, C order:
(coils, z, y, x)on a grid,(coils, *encoding, shots, samples)along a trajectory.sensitivities (torch.Tensor) – Coil sensitivities
(coils, [1,] z, y, x), asecalib()returns them.regularizers (Regularizer or iterable of Regularizer, default=None) – Terms from
bartorch.priors; their axes index the image.l2 (float, default=None) – Tikhonov weight (
-r).solver ({'cg', 'ist', 'fista', 'admm', 'pridu', 'niht'}, default=None) – Iteration.
Nonechooses as the command does: ADMM whenadmm_rhois given, otherwise from the terms.maxiter (int, default=None) – Iterations (
-i);Noneis BART’s 30.step (float, default=None) – Step size of the gradient iterations (
-s).admm_rho (float, default=None) – ADMM penalty (
-u).cg_maxiter (int, default=None) – Conjugate-gradient iterations inside each ADMM step (
-C).traj (torch.Tensor, default=None) – Trajectory
(..., samples, 3)in grid units; selects the non-Cartesian encoding.pattern (torch.Tensor, default=None) – Sampling pattern (
-p). On a grid,Nonetakes the support ofkspace. Along a trajectory it weights the data term,||W (A x - y)||^2, and is typically the square root ofestimate_density().basis (torch.Tensor, default=None) – Subspace basis (
-B), along a trajectory only.initial (torch.Tensor, default=None) – Starting image (
-W), in the units of the result: ofkspacewithrescale, of the scaled data without.toeplitz (bool, default=None) – Along a trajectory,
Falseapplies the NUFFT and its adjoint instead of the normal operator’s Toeplitz convolution (--no-toeplitz);Nonekeeps the convolution. Ignored on a grid.eigen_step (bool, default=False) – Step size from the largest eigenvalue of the normal operator, by 30 power iterations (
-e). The start vector comes from BART’s process-global generator, so repeated runs in one process differ.scaling (float, default=None) – Data scaling (
-w);Noneor zero estimates it withbartorch.optim.data_scaling(), and an estimate of zero is replaced by one.rescale (bool, default=True) – Multiply the image by the scaling (
-S).Falsereturns the image of the scaled data, aspicswithout-S.
- Returns:
Image of the shape
image_shape()gives.- Return type:
torch.Tensor
- Raises:
ValueError – If
solveris unknown; ifbasisis given on a grid; if'cg'gets more than one L2 term, or bothl2and an L2 term; ifeigen_stepis set with'cg'; if'ist'or'fista'gets a first term over a transform other than the identity, such asFourierL1, which the command would threshold on the image itself ('admm'and'pridu'take it).
Notes
Without
solver, the command’s rule (italgo_choose) applies: no term or an L2 term alone gives CG;WaveletNIHTandImageNIHTgive normalized iterative hard thresholding; total variation, the other termsitalgo_chooseassigns to ADMM, and any second term give ADMM; any other first term gives FISTA.Examples
>>> image = pics(kspace, maps, l2=0.01, maxiter=50) >>> image = pics(kspace, maps, regularizers=priors.Wavelet((-1, -2), 0.005))