CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
include/optimizer/oOptimizerManager.hh
Go to the documentation of this file.
1 
8 #ifndef OOPTIMIZERMANAGER_HH
9 #define OOPTIMIZERMANAGER_HH 1
10 
11 #include "gVariables.hh"
12 #include "vOptimizer.hh"
13 #include "vPenalty.hh"
14 #include "oImageSpace.hh"
15 #include "vDataFile.hh"
16 #include "oImageConvolverManager.hh"
17 
30 {
31  // -------------------------------------------------------------------
32  // Constructor & Destructor
33  public:
48 
49 
50  // -------------------------------------------------------------------
51  // Public member functions
52  public:
60  int CheckParameters();
70  int Initialize();
76  int PreDataUpdateStep();
82  int PreImageUpdateStep();
100  int DataUpdateStep( oProjectionLine* ap_Line, vEvent* ap_Event,
101  int a_bed, int a_timeFrame, int a_respGate, int a_cardGate,
102  int a_thread );
110  int ImageUpdateStep();
111 
112 
113  // -------------------------------------------------------------------
114  // Private member functions
115  private:
129 
130 
131  // -------------------------------------------------------------------
132  // Public Get & Set functions
133  public:
139  inline void SetVerbose(int a_verboseLevel)
140  {m_verbose = a_verboseLevel;}
146  inline void SetOptionsOptimizer(const string& a_optionsOptimizer)
147  {m_optionsOptimizer = a_optionsOptimizer;}
154  inline void SetNumbersOfIterationsAndSubsets(int a_nbIterations, int* ap_nbSubsets)
155  {mp_Optimizer->SetNumbersOfIterationsAndSubsets(a_nbIterations,ap_nbSubsets);}
161  inline void SetOutputIterations(bool* ap_outputIterations)
162  {mp_Optimizer->SetOutputIterations(ap_outputIterations);}
168  inline void SetCurrentIteration(int a_currentIteration)
169  {mp_Optimizer->SetCurrentIteration(a_currentIteration);}
174 //RMSUB inline void SetCurrentSubStep(int a_currentSubStep)
175 //RMSUB {mp_Optimizer->SetCurrentSubStep(a_currentSubStep);}
181  inline void SetCurrentSubset(int a_currentSubset)
182  {mp_Optimizer->SetCurrentSubset(a_currentSubset);}
189  inline void SetOptionsPenalty(const string& a_optionsPenalty, FLTNB a_penaltyStrength)
190  {m_optionsPenalty = a_optionsPenalty; m_penaltyStrength = a_penaltyStrength;}
196  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
197  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
203  inline void SetImageSpace(oImageSpace* ap_ImageSpace)
204  {mp_ImageSpace = ap_ImageSpace;}
210  inline void SetNbTOFBins(int a_nbTOFBins)
211  {m_nbTOFBins = a_nbTOFBins;}
217  inline void SetDataMode(int a_dataMode)
218  {m_dataMode = a_dataMode;}
224  inline void SetDataType(int a_dataType)
225  {m_dataType = a_dataType;}
231  inline void SetDataFile(vDataFile* ap_DataFile)
232  {mp_DataFile = ap_DataFile;}
238  inline void SetDataSpec(int a_dataSpec)
239  {m_dataSpec = a_dataSpec;}
245  inline void SetOptimizerFOMFlag(bool a_optimizerFOMFlag)
246  {m_optimizerFOMFlag = a_optimizerFOMFlag;}
252  inline void SetOptimizerImageStatFlag(bool a_optimizerImageStatFlag)
253  {m_optimizerImageStatFlag = a_optimizerImageStatFlag;}
259  inline void SetImageConvolverManager(oImageConvolverManager* ap_ImageConvolverManager)
260  {mp_Optimizer->SetImageConvolverManager(ap_ImageConvolverManager);}
265  inline int GetNbBackwardImages()
266  {return mp_Optimizer->GetNbBackwardImages();}
272  {return mp_Optimizer->GetInitialValue();}
292  inline bool NeedPreIteration()
293  {return mp_Optimizer->NeedPreIteration();}
298  inline void EnterPreIteration()
304  inline void ExitPreIteration()
311  inline bool NeedPostIteration()
312  {return mp_Optimizer->NeedPostIteration();}
317  inline void EnterPostIteration()
323  inline void ExitPostIteration()
325 
331 
332  // -------------------------------------------------------------------
333  // Data members
334  private:
340  int m_dataMode;
341  int m_dataType;
342  int m_dataSpec;
343  int m_nbTOFBins;
344  string m_optionsOptimizer;
345  string m_optionsPenalty;
347  bool m_optimizerFOMFlag;
351  int m_verbose;
352 };
353 
354 #endif
void SetOptionsPenalty(const string &a_optionsPenalty, FLTNB a_penaltyStrength)
This class is designed to be a mother virtual class for DataFile.
bool GetNeedGlobalSensitivity()
Get the boolean saying if the sensitivity has to be computed globally for all data channels and not p...
void ExitPostIteration()
Set post-process flag to false.
bool NeedPreIteration()
Say if the optimizer needs a pre-process loop before iterations are done.
void SetCurrentSubset(int a_currentSubset)
void EnterPostIteration()
Set post-process flag to true.
void ExitPreIteration()
Set pre-process flag to false.
int PreImageUpdateStep()
A function that simply calls the eponym function from the vOptimizer.
This class is designed to manage the optimization part of an iterative reconstruction.
void SetImageConvolverManager(oImageConvolverManager *ap_ImageConvolverManager)
Set the Image Convolver Manager Object.
void SetImageConvolverManager(oImageConvolverManager *ap_ImageConvolverManager)
Set the Image Convolver Manager Object.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
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)
void SetOptionsOptimizer(const string &a_optionsOptimizer)
void SetOptimizerFOMFlag(bool a_optimizerFOMFlag)
int PreDataUpdateStep()
A function that simply calls the eponym function from the vOptimizer.
void SetOutputIterations(bool *ap_outputIterations)
Set the selected output iterations.
int GetNbSubIterationsInOneIteration()
Get the number of sub iterations in one iteration.
Declaration of class vOptimizer.
This class is designed to manage the different image convolvers and to apply them.
This class is designed to generically described any penalty applied to MAP algorithms.
bool NeedPostIteration()
Say if the optimizer needs a post-process loop after iterations are done.
void SetCurrentIteration(int a_currentIteration)
int GetNbSubIterationsInOneIteration()
Get the number of sub iterations in one iteration.
FLTNB GetInitialValue()
Get the initial image value (for initialization)
void SetNumbersOfIterationsAndSubsets(int a_nbIterations, int *ap_nbSubsets)
int CheckParameters()
A function used to check the parameters settings.
oImageConvolverManager * mp_ImageConvolverManager
This class is designed to generically described any iterative optimizer.
void EnterPreIteration()
Set pre-process flag to true.
This class is designed to manage and store system matrix elements associated to a vEvent...
~oOptimizerManager()
The destructor of oOptimizerManager.
Declaration of class vPenalty.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
void SetNumbersOfIterationsAndSubsets(int a_nbIterations, int *ap_nbSubsets)
Mother class for the Event objects.
void EnterPostIteration()
Set post-process flag of the vOptimizer to true.
void EnterPreIteration()
Set pre-process flag of the vOptimizer to true.
void SetCurrentIteration(int a_currentIteration)
void SetCurrentSubset(int a_currentSubset)
void ExitPostIteration()
Set post-process flag of the vOptimizer to false.
int ImageUpdateStep()
A function dedicated to the update step in the image space (performed after the loop on events) ...
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.
void SetImageSpace(oImageSpace *ap_ImageSpace)
bool NeedPostIteration()
Say if the optimizer needs a post-process loop after iterations are done.
void ExitPreIteration()
Set pre-process flag of the vOptimizer to false.
void SetDataFile(vDataFile *ap_DataFile)
Set the data file in use.
bool NeedPreIteration()
Say if the optimizer needs a pre-process loop before iterations are done.
void SetOutputIterations(bool *ap_outputIterations)
Set the selected output iterations to the vOptimizer.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
void SetOptimizerImageStatFlag(bool a_optimizerImageStatFlag)