CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
iRCPGSAlgorithm.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 
24 
34 #ifndef IRCPGSALGORITHM_HH
35 #define IRCPGSALGORITHM_HH 1
36 
37 
38 #include "vAlgorithm.hh"
39 #include <functional>
40 
41 
43 {
44  // Constructor & Destructor
45  public:
48 
49  int InitSpecificOptions(string a_specificOptions);
50  void ShowHelpSpecific();
51 
52  // Protected overriden virtual member functions
53  protected:
56  int StepBeforeSubsetLoop(int a_iteration);
57  int StepAfterSubsetLoop(int a_iteration);
58  int StepPreProcessInsideSubsetLoop(int a_iteration, int a_subset);
59  int StepInnerLoopInsideSubsetLoop(int a_iteration, int a_subset, int a_bed);
60  int StepPostProcessInsideSubsetLoop(int a_iteration, int a_subset);
61  int StepImageOutput(int a_iteration, int a_subset = -1);
62  int ReadConfigurationFile(const string& a_configurationFile);
63 
64  // Private member functions
65  private:
71  int SampleConditionalCompleteData(int a_iteration, int a_subset, int a_bed);
77  int SampleConditionalClustering(int a_iteration);
89  int UpdateVisitedVoxels();
96  int InitializeHelperVar();
102  int ProcessMultiModalInfo();
108  int GenerateCurrentImage();
114  int ComputeFellowVoxelsList(vector<INTNB>& a_fellow_voxels, int a_current_voxel);
120  int ComputeSumsPerClusters(int a_iteration);
126  int SaveIntermediaryData(int a_iteration);
127 
128 
129  // Private data members
130  private:
131  // algorithm parameters
132  int m_ddCRP;
154  vector<INTNB>* mpv_parentLinks;
155  vector<INTNB> mv_newClusters;
169 };
170 
171 #endif
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
int UpdateVisitedVoxels()
Check for voxels which do not contribute to recorded observed data.
int SampleConditionalClustering(int a_iteration)
Gibbs sampler : second conditional probability (ddCRP links)
HPFLTNB m_ddcrpAlphaIncrement
Declaration of class vAlgorithm.
int InitSpecificOptions(string a_specificOptions)
#define FLTNB
Definition: gVariables.hh:81
int ComputeFellowVoxelsList(vector< INTNB > &a_fellow_voxels, int a_current_voxel)
Fill the input list of fellow voxels for the current type of neighbourhood and the input voxel...
HPFLTNB ** mpp_clusterMultiModal
FLTNB * mp_permanentBackwardImage
int StepPreProcessInsideSubsetLoop(int a_iteration, int a_subset)
This function is called right after starting the data subset loop.
#define HPFLTNB
Definition: gVariables.hh:83
HPFLTNB m_currentMeanClusterVolume
int SaveIntermediaryData(int a_iteration)
Save potentially useful by-product variables specific to this algorithm.
HPFLTNB * mp_clusterValues
int ReadConfigurationFile(const string &a_configurationFile)
int StepInnerLoopInsideSubsetLoop(int a_iteration, int a_subset, int a_bed)
This function is called inside the subset loop. It contains the core operations of the algorithm an...
INTNB ** mp_listEventsIndices
HPFLTNB * mp_multiModalParam
int ComputeSumsPerClusters(int a_iteration)
Compute sums of voxel features for each cluster.
bool * mp_listRelevantVoxelIndices
HPFLTNB m_meanClusterVolumeMax
HPFLTNB m_meanClusterVolumeMin
RCP-GS : Random Clustering Prior - Gibbs Sampler.
int StepPostProcessInsideSubsetLoop(int a_iteration, int a_subset)
int StepBeforeIterationLoop()
This function is called at the beginning of the RunCPU function.
int SampleConditionalCompleteData(int a_iteration, int a_subset, int a_bed)
Gibbs sampler : first conditional probability (backprojection)
HPFLTNB * mp_clusterSensitivity
int StepAfterSubsetLoop(int a_iteration)
This function is called after finishing the data subset loop.
int StepBeforeSubsetLoop(int a_iteration)
This function is called before starting the data subset loop.
#define INTNB
Definition: gVariables.hh:92
int InitializeHelperVar()
Allocate and initialize temporary variables, after the main variables have been initialized Assumptio...
INTNB **** m4p_EventsBackprojectionTrace
HPFLTNB * temp_count_multimodal
This is the base class for reconstructions, containing a framework with iteration and data subset loo...
Definition: vAlgorithm.hh:51
HPFLTNB * mp_multiModalNoiseSigma
vector< INTNB > * mpv_parentLinks
void ShowHelpSpecific()
Show help for the child algorithm.
vector< INTNB > mv_newClusters
INTNB * mp_voxelClusterMapping
int ProcessMultiModalInfo()
Check input multimodal images.
int SampleConditionalClusterIntensity()
Gibbs sampler : third conditional probability (cluster intensity)
HPFLTNB ** mp_clusterN
int StepAfterIterationLoop()
This function is called at the end of the RunCPU function.
INTNB * mp_listVoxelIndices
int GenerateCurrentImage()
Generate the current image estimation from the current sample of partition/clustering and cluster int...
int StepImageOutput(int a_iteration, int a_subset=-1)
This function deals with everything about saving output images from the reconstruction.