:py:mod:`vamtoolbox.optimizer.BCLP` =================================== .. py:module:: vamtoolbox.optimizer.BCLP Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: vamtoolbox.optimizer.BCLP.LogPerf vamtoolbox.optimizer.BCLP.BCLPNorm Functions ~~~~~~~~~ .. autoapisummary:: vamtoolbox.optimizer.BCLP.minimizeBCLP .. py:class:: LogPerf(options) .. py:method:: save(filename) .. py:method:: startTiming() .. py:method:: recordIterTime() .. py:method:: show(normalation_flags=(True, True, True, True)) .. py:class:: 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. (2) 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. .. py:method:: 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. .. py:method:: computeLoss() Computation of the loss function .. py:method:: computeLossGradient() Computation of the loss gradient. Output gradient as a flattened array. .. py:method:: getLoss(g_iter) .. py:method:: getLossGrad(g_iter) .. py:method:: evaluateNormMetrics() .. py:method:: callback(g_iter) .. py:method:: gradientDescent() .. py:method:: imposeSinogramConstraints(g) .. py:method:: checkSinogramShape(g, desired_shape='flattened') .. py:method:: checkConvergence() .. py:function:: minimizeBCLP(target_geo, proj_geo, options, output='packaged') Band constraint Lp norm minimization. :param target_geo: :type target_geo: geometry.TargetGeometry object :param proj_geo: :type proj_geo: geometry.ProjectionGeometry object :param options: :type options: Options object :returns: * *geometry.Sinogram* -- optimized sinogram * *geometry.Reconstruction* -- reconstruction from non-filtered backprojection of the optimized reconstructions .. rubric:: References