vamtoolbox.optimizer.BCLP#
Module Contents#
Classes#
This class provide loss function and gradient methods to external optimizer. |
Functions#
|
Band constraint Lp norm minimization. |
- class vamtoolbox.optimizer.BCLP.LogPerf(options)#
- save(filename)#
- startTiming()#
- recordIterTime()#
- show(normalation_flags=(True, True, True, True))#
- class vamtoolbox.optimizer.BCLP.BCLPNorm(target_geo, proj_geo, options)#
This class provide loss function and gradient methods to external optimizer. It also temporarily stores the state of the variables (including error) implicitly during the optimization.
Naming convention: Ax=b in algebraic reconstruction corresponds to Pf=g in this code and in the paper.
Developement notes: This optimization method is written to be as propagator-agnostic as possible. (1) Sinogram ndarray returned by propagator is not limited to be in a particular shape.
The original shape is denoted ‘cylindrical’ in code. The array is flattened for some operations.
Dose unit is controlled jointly by propagator and the material response model. This code only assumes the propagtor generates output that can be directly feeds to the response model in order to predict response. The areal dose or volumetric dose in real space computed by propagator is simply denoted as dose in code. The material response is denoted as mapped dose.
- updateVariables(g_iter)#
This function checks if the state variables are up-to-date, and update them if not. The function ensures the variables are (1) computed in a specified order (to avoid accessing old copy), and (2) computed only once. Therefore regardless of when external function query loss or loss gradient, there is no ambiguity of when each variable is updated. In the following code, any particular line can safely assume the variables above it are up-to-date.
- computeLoss()#
Computation of the loss function
- computeLossGradient()#
Computation of the loss gradient. Output gradient as a flattened array.
- getLoss(g_iter)#
- getLossGrad(g_iter)#
- evaluateNormMetrics()#
- callback(g_iter)#
- gradientDescent()#
- imposeSinogramConstraints(g)#
- checkSinogramShape(g, desired_shape='flattened')#
- checkConvergence()#
- vamtoolbox.optimizer.BCLP.minimizeBCLP(target_geo, proj_geo, options, output='packaged')#
Band constraint Lp norm minimization.
- Parameters:
target_geo (geometry.TargetGeometry object) –
proj_geo (geometry.ProjectionGeometry object) –
options (Options object) –
- Returns:
geometry.Sinogram – optimized sinogram
geometry.Reconstruction – reconstruction from non-filtered backprojection of the optimized reconstructions
References