CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
oOptimizerManager.hh
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
30 #ifndef OOPTIMIZERMANAGER_HH
31 #define OOPTIMIZERMANAGER_HH 1
32 
33 #include "gVariables.hh"
34 #include "vOptimizer.hh"
35 #include "vPenalty.hh"
36 #include "oImageSpace.hh"
37 #include "vDataFile.hh"
38 
51 {
52  // -------------------------------------------------------------------
53  // Constructor & Destructor
54  public:
69 
70 
71  // -------------------------------------------------------------------
72  // Public member functions
73  public:
81  int CheckParameters();
91  int Initialize();
97  int PreDataUpdateStep();
103  int PreImageUpdateStep();
121  int DataUpdateStep( oProjectionLine* ap_Line, vEvent* ap_Event,
122  int a_bed, int a_timeFrame, int a_respGate, int a_cardGate,
123  int a_thread );
131  int ImageUpdateStep();
132 
133 
134  // -------------------------------------------------------------------
135  // Private member functions
136  private:
150 
151 
152  // -------------------------------------------------------------------
153  // Public Get & Set functions
154  public:
160  inline void SetVerbose(int a_verboseLevel)
161  {m_verbose = a_verboseLevel;}
167  inline void SetOptionsOptimizer(const string& a_optionsOptimizer)
168  {m_optionsOptimizer = a_optionsOptimizer;}
175  inline void SetNumbersOfIterationsAndSubsets(int a_nbIterations, int* ap_nbSubsets)
176  {mp_Optimizer->SetNumbersOfIterationsAndSubsets(a_nbIterations,ap_nbSubsets);}
182  inline void SetCurrentIteration(int a_currentIteration)
183  {mp_Optimizer->SetCurrentIteration(a_currentIteration);}
189  inline void SetCurrentSubset(int a_currentSubset)
190  {mp_Optimizer->SetCurrentSubset(a_currentSubset);}
197  inline void SetOptionsPenalty(const string& a_optionsPenalty, FLTNB a_penaltyStrength)
198  {m_optionsPenalty = a_optionsPenalty; m_penaltyStrength = a_penaltyStrength;}
204  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
205  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
211  inline void SetImageSpace(oImageSpace* ap_ImageSpace)
212  {mp_ImageSpace = ap_ImageSpace;}
218  inline void SetNbTOFBins(int a_nbTOFBins)
219  {m_nbTOFBins = a_nbTOFBins;}
225  inline void SetDataMode(int a_dataMode)
226  {m_dataMode = a_dataMode;}
232  inline void SetDataType(int a_dataType)
233  {m_dataType = a_dataType;}
239  inline void SetDataSpec(int a_dataSpec)
240  {m_dataSpec = a_dataSpec;}
246  inline void SetOptimizerFOMFlag(bool a_optimizerFOMFlag)
247  {m_optimizerFOMFlag = a_optimizerFOMFlag;}
253  inline void SetOptimizerImageStatFlag(bool a_optimizerImageStatFlag)
254  {m_optimizerImageStatFlag = a_optimizerImageStatFlag;}
259  inline int GetNbBackwardImages()
260  {return mp_Optimizer->GetNbBackwardImages();}
266  {return mp_Optimizer->GetInitialValue();}
274 
280 
281  // -------------------------------------------------------------------
282  // Data members
283  private:
298  int m_verbose;
299 };
300 
301 #endif
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
This header file is mainly used to declare some macro definitions and all includes needed from the st...
bool GetNeedGlobalSensitivity()
Get the boolean saying if the sensitivity has to be computed globally for all data channels and not p...
Definition: vOptimizer.hh:606
FLTNB GetInitialValue()
Return the initial image value used by the optimizer, explaining why the eponym function of vOptimize...
#define FLTNB
Definition: gVariables.hh:81
void SetOptimizerImageStatFlag(bool a_optimizerImageStatFlag)
Set the optimizer image stat flag that specifies if some basic statistics about image update is compu...
int PreImageUpdateStep()
A function that simply calls the eponym function from the vOptimizer.
void SetVerbose(int a_verboseLevel)
Set the verbose level.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the image dimensions in use.
This class is designed to manage the optimization part of an iterative reconstruction.
void SetCurrentIteration(int a_currentIteration)
Set the current iteration.
Definition: vOptimizer.hh:541
void SetCurrentSubset(int a_currentSubset)
Set the current subset to the vOptimizer.
void SetNumbersOfIterationsAndSubsets(int a_nbIterations, int *ap_nbSubsets)
Set these numbers of iterations and subsets to the vOptimizer.
void SetOptionsPenalty(const string &a_optionsPenalty, FLTNB a_penaltyStrength)
Set the penalty projection options contained in the provided string.
void SetDataSpec(int a_dataSpec)
Set the specificity of the data: EMISSION or TRANSMISSION.
oImageSpace * mp_ImageSpace
int Initialize()
A function used to initialize the manager and the optimizer it manages.
int DataUpdateStep(oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
A function dedicated to the update step in the data space (for each event inside the loop) ...
void SetImageSpace(oImageSpace *ap_ImageSpace)
Set the image space in use.
void SetDataMode(int a_dataMode)
Set the mode of the data (histogram, list-mode)
int ParseOptionsAndInitializeOptimizerAndPenalty()
void SetDataType(int a_dataType)
Set the type of the data (pet, spect, etc)
void SetNumbersOfIterationsAndSubsets(int a_nbIterations, int *ap_nbSubsets)
Set these numbers of iterations and subsets.
Definition: vOptimizer.hh:534
int GetNbBackwardImages()
Return the number of backward images used by the optimizer, explaining why the eponym function of vOp...
void SetOptionsOptimizer(const string &a_optionsOptimizer)
Set the optimizer projection options contained in the provided string.
Declaration of class vDataFile.
int PreDataUpdateStep()
A function that simply calls the eponym function from the vOptimizer.
vOptimizer * mp_Optimizer
Declaration of class vOptimizer.
Declaration of class vPenalty.
This class is designed to generically described any penalty applied to MAP algorithms.
Definition: vPenalty.hh:48
FLTNB GetInitialValue()
Get the initial image value (for initialization)
Definition: vOptimizer.hh:562
bool GetNeedGlobalSensitivity()
Get the boolean saying if the sensitivity has to be computed globally.
int CheckParameters()
A function used to check the parameters settings.
void SetNbTOFBins(int a_nbTOFBins)
Set the number of TOF bins in use.
This class is designed to generically described any iterative optimizer.
Definition: vOptimizer.hh:59
This class is designed to manage and store system matrix elements associated to a vEvent...
~oOptimizerManager()
The destructor of oOptimizerManager.
Declaration of class oImageSpace.
void SetCurrentSubset(int a_currentSubset)
Set the current subset.
Definition: vOptimizer.hh:548
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:60
Mother class for the Event objects.
Definition: vEvent.hh:42
int ImageUpdateStep()
A function dedicated to the update step in the image space (performed after the loop on events) ...
vOptimizer * GetOptimizer()
Return the optimizer object.
This class is designed to manage all dimensions and quantification related stuff. ...
oOptimizerManager()
The constructor of oOptimizerManager.
int GetNbBackwardImages()
Get the number of backward images used by the specific optimizer.
Definition: vOptimizer.hh:555
void SetCurrentIteration(int a_currentIteration)
Set the current iteration to the vOptimizer.
void SetOptimizerFOMFlag(bool a_optimizerFOMFlag)
Set the optimizer FOM flag that specifies if some figures-of-merit (FOM) will be computed in the data...