![]() |
SuPReMo
0.1.1
|
#include <ConjugateGradientOptimiser.h>


Public Member Functions | |
| ConjugateGradientOptimiser () | |
| ~ConjugateGradientOptimiser () | |
| void | Optimise (PrecisionType *startingPoint) |
| virtual void | Initialise () |
| void | SetContinueOptimisation (bool continueOptimisationIn) |
Public Member Functions inherited from Optimiser | |
| Optimiser () | |
| virtual | ~Optimiser () |
| void | SetObjectiveFunction (std::shared_ptr< ObjectiveFunction > &objectiveFunctionIn) |
| virtual void | Optimise (PrecisionType *startingPoint)=0 |
| virtual void | Initialise ()=0 |
| PrecisionType | GetBestObjectiveFunctionValue () |
| PrecisionType | GetInitialObjectiveFunctionValue () |
| PrecisionType * | GetBestPoint () |
| void | ResetCurrentIterationNumber () |
| void | SetMaxIterations (unsigned int maxIterations) |
| void | SetPreviouslyEvaluatedObjectiveFunctionValue (PrecisionType objectiveFunctionValue) |
| void | SetOutputIntermediateGradientFolder (const std::string &outputFolderIn, const std::string &outPrefix) |
Private Member Functions | |
| void | CalculateGradientUpdate () |
| void | SaveIntermediateGradientImage () |
Private Attributes | |
| PrecisionType * | array1 |
| The array g in numerical recipes. More... | |
| PrecisionType * | array2 |
| The array h in numerical recipes. More... | |
| bool | continuationOfOptimisationPossible |
| Indicating if array1 and array2 were initialised properly and can be used to continue with the optimisation. More... | |
| bool | continueOptimisation |
| Indicates if the sequence of gradients should be continued. Reg-resp implemented this to be set to true, but it may be beneficial to set this to false and start with a fresh gradient sequence if the motion-compensated image and thus the objective function changed with each switch iteration. More... | |
Additional Inherited Members | |
Public Types inherited from Optimiser | |
| typedef float | PrecisionType |
Protected Member Functions inherited from Optimiser | |
| void | MoveCurrentPointAlongGradient (PrecisionType stepSize) |
| void | PerformLineSearch (PrecisionType maxLength, PrecisionType smallLength, PrecisionType &startLength) |
Protected Attributes inherited from Optimiser | |
| PrecisionType | currentObjectiveFunctionValue |
| The current objective function value corresponding to the current iteration. More... | |
| PrecisionType | bestObjectiveFunctionValue |
| The best objective function value achieved. More... | |
| PrecisionType | initialObjectiveFunctionValue |
| The objective function value at the starting point of the optimisation. More... | |
| unsigned int | currentIterationNumber |
| Tracker of the current iteration number. More... | |
| unsigned int | maxNumberOfIterations |
| The maximum number of allowed iterations. More... | |
| const unsigned int | maxNumberOfLineIterations |
| The maximum number of iterations used for the line-serach along the gradient. More... | |
| PrecisionType | maxLineSearchStepSize |
| The maximum step size used for the line-search. Has to be initialised in derived class. More... | |
| PrecisionType | minLineSearchStepSize |
| The minimum step size used for the line-search. Has to be initialised in derived class. More... | |
| unsigned int | numberOfIterationsPerformed |
| The total number of iterations performed. More... | |
| unsigned int | numberOfDOFs |
| The number of degrees of freedom. More... | |
| std::shared_ptr< ObjectiveFunction > | objectiveFunction |
| Shared pointer to the objective function. More... | |
| PrecisionType * | gradient |
| The array xi in numerical recipes. More... | |
| PrecisionType * | currentPoint |
| The current point, p in numerical recipes. More... | |
| PrecisionType * | bestPoint |
| The best point achieved, p in numerical recipes. More... | |
| PrecisionType | preEvaluatedObjectiveFunctionValue |
| A pre-calculated objective function value that will be used during the optimisation if usePreEvaluatedEvaluatedObjectiveFunctionValue is set to true. More... | |
| bool | usePreEvaluatedEvaluatedObjectiveFunctionValue |
| Indicator if the first objective function value calculation can be skipped. More... | |
| std::string | outputIntermediateGradientFolder |
| Folder to which the intermediated objective function gradients will be saved. More... | |
| std::string | outputIntermediateGradientPrefix |
| String holding additional information to differentiate the output from different levels. More... | |
Class implementing the conjugate gradient optimiser according to nifty-reg-resp and Numerical Recipes in C++.
| ConjugateGradientOptimiser::ConjugateGradientOptimiser | ( | ) |
Constructor
| ConjugateGradientOptimiser::~ConjugateGradientOptimiser | ( | ) |
Destructor
|
private |
Calculate the conjugate gradient update
|
virtual |
|
virtual |
Initiate the optimisation. The iteration numbers as well as the stored objective function values will be reset.
| startingPoint | Point where to start the optimisation from. Can be null-pointer to start form zero. |
Implements Optimiser.
|
private |
Function that save the current gradient to nifti images if the output file name is not empty.
|
inline |
Set if the gradient sequence should be continued even if the objective function changed. Reg-resp implemented this to be set to true, but it may be beneficial to set this to false and start with a fresh gradient sequence if the motion-compensated image and thus the objective function changed with each switch iteration.
| continueOptimisationIn | Define the continuation of gradient calculation. Set to false for a fresh start. |
|
private |
The array g in numerical recipes.
|
private |
The array h in numerical recipes.
|
private |
Indicating if array1 and array2 were initialised properly and can be used to continue with the optimisation.
|
private |
Indicates if the sequence of gradients should be continued. Reg-resp implemented this to be set to true, but it may be beneficial to set this to false and start with a fresh gradient sequence if the motion-compensated image and thus the objective function changed with each switch iteration.