CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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-2018 all CASToR contributors listed below:
18 
19  --> current contributors: Thibaut MERLIN, Simon STUTE, Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Mael MILLARDET
20  --> past contributors: Valentin VIELZEUF
21 
22 This is CASToR version 2.0.
23 */
24 
31 #ifndef OOPTIMIZERMANAGER_HH
32 #define OOPTIMIZERMANAGER_HH 1
33 
34 #include "gVariables.hh"
35 #include "vOptimizer.hh"
36 #include "vPenalty.hh"
37 #include "oImageSpace.hh"
38 #include "vDataFile.hh"
39 
52 {
53  // -------------------------------------------------------------------
54  // Constructor & Destructor
55  public:
70 
71 
72  // -------------------------------------------------------------------
73  // Public member functions
74  public:
82  int CheckParameters();
92  int Initialize();
102  int PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int* ap_nbSubsets);
112  int PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int* ap_nbSubsets);
130  int DataUpdateStep( oProjectionLine* ap_Line, vEvent* ap_Event,
131  int a_bed, int a_timeFrame, int a_respGate, int a_cardGate,
132  int a_iteration, int a_thread );
142  int ImageUpdateStep( int a_iteration, int a_nbSubsets );
143 
144 
145  // -------------------------------------------------------------------
146  // Private member functions
147  private:
161 
162 
163  // -------------------------------------------------------------------
164  // Public Get & Set functions
165  public:
171  inline void SetVerbose(int a_verboseLevel)
172  {m_verbose = a_verboseLevel;}
178  inline void SetOptionsOptimizer(const string& a_optionsOptimizer)
179  {m_optionsOptimizer = a_optionsOptimizer;}
185  inline void SetOptionsPenalty(const string& a_optionsPenalty)
186  {m_optionsPenalty = a_optionsPenalty;}
192  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
193  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
199  inline void SetImageSpace(oImageSpace* ap_ImageSpace)
200  {mp_ImageSpace = ap_ImageSpace;}
206  inline void SetNbTOFBins(int a_nbTOFBins)
207  {m_nbTOFBins = a_nbTOFBins;}
213  inline void SetDataMode(int a_dataMode)
214  {m_dataMode = a_dataMode;}
220  inline void SetDataType(int a_dataType)
221  {m_dataType = a_dataType;}
227  inline void SetDataSpec(int a_dataSpec)
228  {m_dataSpec = a_dataSpec;}
234  inline void SetOptimizerFOMFlag(bool a_optimizerFOMFlag)
235  {m_optimizerFOMFlag = a_optimizerFOMFlag;}
241  inline void SetOptimizerImageStatFlag(bool a_optimizerImageStatFlag)
242  {m_optimizerImageStatFlag = a_optimizerImageStatFlag;}
247  inline int GetNbBackwardImages()
248  {return mp_Optimizer->GetNbBackwardImages();}
254  {return mp_Optimizer->GetInitialValue();}
255 
256 
257  // -------------------------------------------------------------------
258  // Data members
259  private:
273  int m_verbose;
274 };
275 
276 #endif
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
This header file is mainly used to declare some macro definitions and all includes needed from the st...
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...
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 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 PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
A function that simply calls the eponym function from the vOptimizer.
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)
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.
vOptimizer * mp_Optimizer
Declaration of class vOptimizer.
void SetOptionsPenalty(const string &a_optionsPenalty)
Set the penalty projection options contained in the provided string.
Declaration of class vPenalty.
This class is designed to generically described any penalty applied to MAP algorithms.
Definition: vPenalty.hh:46
FLTNB GetInitialValue()
Get the initial image value (for initialization)
Definition: vOptimizer.hh:558
int CheckParameters()
A function used to check the parameters settings.
int ImageUpdateStep(int a_iteration, int a_nbSubsets)
A function dedicated to the update step in the image space (performed after the loop on events) ...
int DataUpdateStep(oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_iteration, int a_thread)
A function dedicated to the update step in the data space (for each event inside the loop) ...
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.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:61
Mother class for the Event objects.
Definition: vEvent.hh:43
This class is designed to manage all dimensions and quantification related stuff. ...
int PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
A function that simply calls the eponym function from the vOptimizer.
oOptimizerManager()
The constructor of oOptimizerManager.
int GetNbBackwardImages()
Get the number of backward images used by the specific optimizer.
Definition: vOptimizer.hh:551
void SetOptimizerFOMFlag(bool a_optimizerFOMFlag)
Set the optimizer FOM flag that specifies if some figures-of-merit (FOM) will be computed in the data...