RDP#
- class deepinv.optim.RDP(gamma=2.0, *args, **kwargs)[source]#
Bases:
PriorRelative Difference Prior (RDP).
This prior was proposed for emission tomography by Nuyts et al.[1]. It favors sharp transitions in non-negative images and is particularly useful when the signal has a large amplitude. It penalizes relative rather than absolute differences between neighboring voxels:
\[\reg{x} = \sum_{\{j,k\} \in \mathcal{N}} \frac{(x_j-x_k)^2}{x_j+x_k+\gamma |x_j-x_k|},\]where \(\mathcal{N}\) contains each axis-adjacent spatial pair once. The batch and channel axes are not included in the neighborhood.
Warning
Negative values in the image can make the denominator cancel. This implementation is only valid for non-negative images.
- Parameters:
gamma (float) – edge-preservation parameter \(\gamma\). Larger values reduce the penalty on large relative differences. Default:
2.0.
- References:
- fn(x, *args, **kwargs)[source]#
Compute the Relative Difference Prior at \(x\).
- Parameters:
x (torch.Tensor) – non-negative image or volume.
- Returns:
prior value for each element of the batch.
- Return type:
- grad(x, *args, **kwargs)[source]#
Compute the gradient of the Relative Difference Prior at \(x\).
The zero gradient is selected for pairs in which both voxels are zero.
- Parameters:
x (torch.Tensor) – non-negative image or volume.
- Returns:
gradient with the same shape as \(x\).
- Return type:
Examples using RDP:#
OSEM, BSREM and gradient descent for 2D BrainWeb PET