CASToR
3.0
Tomographic Reconstruction (PET/SPECT/CT)
|
RCP-GS : Random Clustering Prior - Gibbs Sampler. More...
#include <iRCPGSAlgorithm.hh>
Public Member Functions | |
iRCPGSAlgorithm () | |
~iRCPGSAlgorithm () | |
int | InitSpecificOptions (string a_specificOptions) |
void | ShowHelpSpecific () |
Show help for the child algorithm. More... | |
Public Member Functions inherited from vAlgorithm | |
vAlgorithm () | |
vAlgorithm constructor. Initialize the member variables to their default values. More... | |
virtual | ~vAlgorithm () |
vAlgorithm destructor. More... | |
int | Run () |
Just call either the RunCPU or the RunGPU function as asked for. More... | |
int | RunCPU () |
Perform the iterative loop of the algorithm. Function designed to be executed on the CPU only. More... | |
void | SetSaveSensitivityHistoFlag (bool a_saveSensitivityHistoFlag) |
Set the flag that specifies if the sensitivity image in histogram mode has to be saved for each subset/iteration. More... | |
void | SetSaveSubsetImageFlag (bool a_saveImageAfterSubsets) |
Set the flag that specifies if the image has to be saved for each subset. More... | |
void | SetSaveDynamicBasisCoefficientImages (bool a_saveDynamicBasisCoefficients) |
Set the flag that specifies if the dynamic basis functions coefficients images have to be saved. More... | |
void | SetOptimizerManager (oOptimizerManager *ap_OptimizerManager) |
Set the Optimizer Manager Object. More... | |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification) |
Set the Image Dimensions and Quantification Object. More... | |
void | SetImageSpace (oImageSpace *ap_ImageSpace) |
Set the Image Space Object. More... | |
void | SetProjectorManager (oProjectorManager *ap_ProjectorManager) |
Set the Projector Manager Object. More... | |
void | SetImageConvolverManager (oImageConvolverManager *ap_ImageConvolverManager) |
Set the Image Convolver Manager Object. More... | |
void | SetImageProcessingManager (oImageProcessingManager *ap_ImageProcessingManager) |
Set the Image Processing Manager Object. More... | |
void | SetDynamicModelManager (oDynamicModelManager *ap_DynamicModelManager) |
Set the Dynamic Model Manager Object. More... | |
void | SetDeformationManager (oDeformationManager *ap_DeformationManager) |
Set the Deformation Manager Object. More... | |
void | SetDataFile (vDataFile **a2p_DataFile) |
Set the list of DataFile. More... | |
void | SetGPUflag (bool a_flagGPU) |
Set the GPU flag. More... | |
void | SetVerbose (int a_verboseLevel) |
Set Verbosity. More... | |
void | SetNbBeds (int a_nbBeds) |
Set number of beds (bed positions) More... | |
void | SetPathInitImage (string a_pathToInitialImage) |
Set path to an initial image. More... | |
void | SetPathToAttenuationImage (string a_pathToAttenuationImage) |
This function is used to set the path to the attenuation image. More... | |
void | SetPathToSensitivityImage (string a_pathToSensitivityImage) |
Set path to the sensitivity image. More... | |
void | SetPathToMultiModalImage (vector< string > a_pathToMultiModalImage) |
Set path to multimodal images. More... | |
void | SetPathToMaskImage (string a_pathToMaskImage) |
Set path to a mask image. More... | |
int | SetNbIterationsAndSubsets (const string &a_nbIterationsSubsets) |
Set the number of iterations and subsets. More... | |
int | SetOutputIterations (const string &a_outputIterations) |
Set the selected output iterations. More... | |
Protected Member Functions | |
int | StepBeforeIterationLoop () |
This function is called at the beginning of the RunCPU function. More... | |
int | StepAfterIterationLoop () |
This function is called at the end of the RunCPU function. More... | |
int | StepBeforeSubsetLoop (int a_iteration) |
This function is called before starting the data subset loop. More... | |
int | StepAfterSubsetLoop (int a_iteration) |
This function is called after finishing the data subset loop. More... | |
int | StepPreProcessInsideSubsetLoop (int a_iteration, int a_subset) |
This function is called right after starting the data subset loop. More... | |
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 and must be implemented by child classes. More... | |
int | StepPostProcessInsideSubsetLoop (int a_iteration, int a_subset) |
int | StepImageOutput (int a_iteration, int a_subset=-1) |
This function deals with everything about saving output images from the reconstruction. More... | |
int | ReadConfigurationFile (const string &a_configurationFile) |
Private Member Functions | |
int | SampleConditionalCompleteData (int a_iteration, int a_subset, int a_bed) |
Gibbs sampler : first conditional probability (backprojection) More... | |
int | SampleConditionalClustering (int a_iteration) |
Gibbs sampler : second conditional probability (ddCRP links) More... | |
int | SampleConditionalClusterIntensity () |
Gibbs sampler : third conditional probability (cluster intensity) More... | |
int | UpdateVisitedVoxels () |
Check for voxels which do not contribute to recorded observed data. More... | |
int | InitializeHelperVar () |
Allocate and initialize temporary variables, after the main variables have been initialized Assumption : the initial image and the sensitivity image have already been initialized. More... | |
int | ProcessMultiModalInfo () |
Check input multimodal images. More... | |
int | GenerateCurrentImage () |
Generate the current image estimation from the current sample of partition/clustering and cluster intensities. More... | |
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, for ddCRP. More... | |
int | ComputeSumsPerClusters (int a_iteration) |
Compute sums of voxel features for each cluster. More... | |
int | SaveIntermediaryData (int a_iteration) |
Save potentially useful by-product variables specific to this algorithm. More... | |
Additional Inherited Members | |
Protected Attributes inherited from vAlgorithm | |
int | m_nbIterations |
int * | mp_nbSubsets |
bool * | mp_outputIterations |
int | m_verbose |
bool | m_flagGPU |
oImageDimensionsAndQuantification * | mp_ID |
vDataFile ** | m2p_DataFile |
oProjectorManager * | mp_ProjectorManager |
oOptimizerManager * | mp_OptimizerManager |
oDeformationManager * | mp_DeformationManager |
oDynamicModelManager * | mp_DynamicModelManager |
oImageSpace * | mp_ImageSpace |
oImageConvolverManager * | mp_ImageConvolverManager |
oImageProcessingManager * | mp_ImageProcessingManager |
int | m_nbBeds |
string | m_pathToInitialImg |
string | m_pathToAtnImg |
string | m_pathToSensitivityImg |
vector< string > | m_pathToMultiModalImg |
string | m_pathToMaskImg |
bool | m_saveSensitivityHistoFlag |
bool | m_saveImageAfterSubsets |
bool | m_saveDynamicBasisCoefficients |
RCP-GS : Random Clustering Prior - Gibbs Sampler.
Sampling of the posterior probability distribution (Bayesian inference) Image prior : ddCRP, with intensity ~ Gamma (conjugate prior for Poisson likelihood) Multinomial distribution for the backprojection from acquired data into (latent) emissions from voxel j into projection i
Definition at line 42 of file iRCPGSAlgorithm.hh.
iRCPGSAlgorithm::iRCPGSAlgorithm | ( | ) |
Definition at line 34 of file iRCPGSAlgorithm.cc.
iRCPGSAlgorithm::~iRCPGSAlgorithm | ( | ) |
|
private |
Fill the input list of fellow voxels for the current type of neighbourhood and the input voxel, for ddCRP.
Definition at line 1790 of file iRCPGSAlgorithm.cc.
|
private |
Compute sums of voxel features for each cluster.
Definition at line 1356 of file iRCPGSAlgorithm.cc.
|
private |
Generate the current image estimation from the current sample of partition/clustering and cluster intensities.
Definition at line 1852 of file iRCPGSAlgorithm.cc.
|
private |
Allocate and initialize temporary variables, after the main variables have been initialized Assumption : the initial image and the sensitivity image have already been initialized.
Definition at line 543 of file iRCPGSAlgorithm.cc.
|
virtual |
a_specificOptions |
Reimplemented from vAlgorithm.
Definition at line 158 of file iRCPGSAlgorithm.cc.
|
private |
Check input multimodal images.
Definition at line 688 of file iRCPGSAlgorithm.cc.
|
protected |
Definition at line 463 of file iRCPGSAlgorithm.cc.
|
private |
Gibbs sampler : second conditional probability (ddCRP links)
Definition at line 1441 of file iRCPGSAlgorithm.cc.
|
private |
Gibbs sampler : third conditional probability (cluster intensity)
Definition at line 1738 of file iRCPGSAlgorithm.cc.
|
private |
Gibbs sampler : first conditional probability (backprojection)
Definition at line 912 of file iRCPGSAlgorithm.cc.
|
private |
Save potentially useful by-product variables specific to this algorithm.
|
virtual |
Show help for the child algorithm.
Reimplemented from vAlgorithm.
Definition at line 2031 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function is called at the end of the RunCPU function.
Reimplemented from vAlgorithm.
Definition at line 1879 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function is called after finishing the data subset loop.
a_iteration | : iteration index |
Reimplemented from vAlgorithm.
Definition at line 1910 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function is called at the beginning of the RunCPU function.
Reimplemented from vAlgorithm.
Definition at line 715 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function is called before starting the data subset loop.
a_iteration | : iteration index |
Reimplemented from vAlgorithm.
Definition at line 1899 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function deals with everything about saving output images from the reconstruction.
Implements vAlgorithm.
Definition at line 1938 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function is called inside the subset loop.
It contains the core operations of the algorithm and must be implemented by child classes.
a_iteration | : iteration index |
a_subset | : subset index |
a_bed | : bed position |
Implements vAlgorithm.
Definition at line 776 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
Reimplemented from vAlgorithm.
Definition at line 792 of file iRCPGSAlgorithm.cc.
|
protectedvirtual |
This function is called right after starting the data subset loop.
This function is called right after starting the subset loop.
.
a_iteration | : iteration index |
a_subset | : subset index |
Reimplemented from vAlgorithm.
Definition at line 760 of file iRCPGSAlgorithm.cc.
|
private |
Check for voxels which do not contribute to recorded observed data.
Definition at line 1420 of file iRCPGSAlgorithm.cc.
|
private |
Trace of the backprojection destination for each observed count at previous iteration, Number of beds x Number of events x Number of TOF bins x Number of counts
Definition at line 158 of file iRCPGSAlgorithm.hh.
|
private |
flag describing the multinomial backprojection of the current iteration/subset data (sampling of conditional complete data): 0 = the previous backprojection state is cleared, as for ML-EM 1 = update of the previous backprojection state 2 = backprojection marginalized over cluster intensity, implies update of the previous backprojection state
Definition at line 133 of file iRCPGSAlgorithm.hh.
|
private |
helper variable for the average cluster volume after each iteration/subset
Definition at line 163 of file iRCPGSAlgorithm.hh.
|
private |
flag describing the ddCRP prior : 0 = no ddCRP, 1 = original ddCRP, 2 = modified ddCRP
Definition at line 132 of file iRCPGSAlgorithm.hh.
|
private |
ddCRP : the unnormalized probability of drawing a self link
Definition at line 140 of file iRCPGSAlgorithm.hh.
|
private |
Multiplicative increment for optimizing the ddCRP alpha parameter through iterations
Definition at line 142 of file iRCPGSAlgorithm.hh.
|
private |
helper variable for precomputed log of ddCRP : the probability of drawing a self link (not normalized)
Definition at line 162 of file iRCPGSAlgorithm.hh.
|
private |
Gamma prior distribution rate parameter
Definition at line 139 of file iRCPGSAlgorithm.hh.
|
private |
Gamma prior distribution shape parameter
Definition at line 138 of file iRCPGSAlgorithm.hh.
|
private |
Maximum threshold for average cluster volume (in mm3), used for adapting ddCRP alpha automatically through iterations
Definition at line 165 of file iRCPGSAlgorithm.hh.
|
private |
Minimum threshold for average cluster volume (in mm3), used for adapting ddCRP alpha automatically through iterations
Definition at line 164 of file iRCPGSAlgorithm.hh.
|
private |
Number of iterations after which the multimodal images start affecting voxels clustering
Definition at line 141 of file iRCPGSAlgorithm.hh.
|
private |
Number of voxels in the neighbourhood
Definition at line 137 of file iRCPGSAlgorithm.hh.
|
private |
Number of voxels per cluster
Definition at line 152 of file iRCPGSAlgorithm.hh.
|
private |
Ns : sum over cluster voxels and all LORs of latent backprojected variable (complete data), requires HPFLTNB precision, can be threaded
Definition at line 149 of file iRCPGSAlgorithm.hh.
|
private |
Sensitivity : sum over cluster voxels and all LORs of system matrix components, requires HPFLTNB precision
Definition at line 150 of file iRCPGSAlgorithm.hh.
|
private |
Values (here voxel intensities) associated with each cluster
Definition at line 148 of file iRCPGSAlgorithm.hh.
|
private |
List of events indices, per bed, used for random shuffling
Definition at line 157 of file iRCPGSAlgorithm.hh.
|
private |
Indices of voxels which will be taken into account in the algorithm; all the other voxels are regarded as background and set to 0
Definition at line 160 of file iRCPGSAlgorithm.hh.
|
private |
List of voxel indices, used for random shuffling
Definition at line 156 of file iRCPGSAlgorithm.hh.
|
private |
Standard deviation of Gaussian noise in multimodal images
Definition at line 144 of file iRCPGSAlgorithm.hh.
|
private |
Parameter for the standard deviation of the prior on multimodal images
Definition at line 145 of file iRCPGSAlgorithm.hh.
|
private |
Mapping : voxel index -> next voxel index (link from this voxel to another voxel)
Definition at line 153 of file iRCPGSAlgorithm.hh.
|
private |
A buffer image used for holding the complete up-to-date backward image at any time. It is updated at each iteration/subset, and used in backprojection modes 1 and 2
Definition at line 166 of file iRCPGSAlgorithm.hh.
|
private |
Mapping : voxel index -> cluster index
Definition at line 147 of file iRCPGSAlgorithm.hh.
|
private |
Multimodal image(s) : sum over cluster voxels, requires HPFLTNB precision
Definition at line 151 of file iRCPGSAlgorithm.hh.
|
private |
Mapping : voxel index -> list of previous voxels (links from other voxels to this voxel)
Definition at line 154 of file iRCPGSAlgorithm.hh.
|
private |
Indices of free available (empty) clusters (the number of clusters <= the number of voxels + 1)
Definition at line 155 of file iRCPGSAlgorithm.hh.
|
private |
helper variable for the second sampling step, just to avoid allocating repeatedly >
Definition at line 161 of file iRCPGSAlgorithm.hh.