::CombineListPolicy() 
{
	size = 0;
}
//----------------------------------------------------------------------------------------
template ::CombineListPolicy(std::vector  _policyList) 
{
	policyList = _policyList;
	size = policyList.size();
}
//----------------------------------------------------------------------------------------	
template ::~CombineListPolicy() 
{
}
//----------------------------------------------------------------------------------------
template ::addPolicy(P _policy) 
{
	policyList.push_back(_policy);
	size = policyList.size();
}
//----------------------------------------------------------------------------------------	
template ::rayPrior(int _iRayIndex) 
{
	for(unsigned int i = 0; i < size; ++i) {
		if (!policyList[i].rayPrior(_iRayIndex)) return false;
	}
	return true;
}
//----------------------------------------------------------------------------------------
template ::pixelPrior(int _iVolumeIndex) 
{
	for(unsigned int i = 0; i < size; ++i) {
		if (!policyList[i].pixelPrior(_iVolumeIndex)) return false;
	}
	return true;
}
//----------------------------------------------------------------------------------------	
template ::addWeight(int _iRayIndex, int _iVolumeIndex, float32 _fWeight) 
{
	for(unsigned int i = 0; i < size; ++i) {
		policyList[i].addWeight(_iRayIndex, _iVolumeIndex, _fWeight);
	}
}
//----------------------------------------------------------------------------------------
template ::rayPosterior(int _iRayIndex) 
{
	for(unsigned int i = 0; i < size; ++i) {
		policyList[i].rayPosterior(_iRayIndex);
	}
}
//----------------------------------------------------------------------------------------
template ::pixelPosterior(int _iVolumeIndex) 
{
	for(unsigned int i = 0; i < size; ++i) {
		policyList[i].pixelPosterior(_iVolumeIndex);
	}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// EMPTY POLICY  (Ray+Pixel Driven)
//----------------------------------------------------------------------------------------
EmptyPolicy::EmptyPolicy() 
{
}
//----------------------------------------------------------------------------------------	
EmptyPolicy::~EmptyPolicy() 
{
}
//----------------------------------------------------------------------------------------	
bool EmptyPolicy::rayPrior(int _iRayIndex) 
{
	return true;
}
//----------------------------------------------------------------------------------------
bool EmptyPolicy::pixelPrior(int _iVolumeIndex) 
{
	return true;
}
//----------------------------------------------------------------------------------------	
void EmptyPolicy::addWeight(int _iRayIndex, int _iVolumeIndex, float32 _fWeight) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void EmptyPolicy::rayPosterior(int _iRayIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void EmptyPolicy::pixelPosterior(int _iVolumeIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// SIRT BACKPROJECTION  (Ray+Pixel Driven)
//----------------------------------------------------------------------------------------
SIRTBPPolicy::SIRTBPPolicy() 
{
}
//----------------------------------------------------------------------------------------
SIRTBPPolicy::SIRTBPPolicy(CFloat32VolumeData2D* _pReconstruction, 
						   CFloat32ProjectionData2D* _pSinogram, 
						   CFloat32VolumeData2D* _pTotalPixelWeight, 
						   CFloat32ProjectionData2D* _pTotalRayLength) 
{
	m_pReconstruction = _pReconstruction;
	m_pSinogram = _pSinogram;
	m_pTotalPixelWeight = _pTotalPixelWeight;
	m_pTotalRayLength = _pTotalRayLength;
}
//----------------------------------------------------------------------------------------	
SIRTBPPolicy::~SIRTBPPolicy() 
{
}
//----------------------------------------------------------------------------------------	
bool SIRTBPPolicy::rayPrior(int _iRayIndex) 
{
	return true;
}
//----------------------------------------------------------------------------------------
bool SIRTBPPolicy::pixelPrior(int _iVolumeIndex) 
{
	return true;
}
//----------------------------------------------------------------------------------------	
void SIRTBPPolicy::addWeight(int _iRayIndex, int _iVolumeIndex, float32 _fWeight) 
{
	float32 fGammaBeta = m_pTotalPixelWeight->getData()[_iVolumeIndex] * m_pTotalRayLength->getData()[_iRayIndex];
	if ((fGammaBeta > 0.001f) || (fGammaBeta < -0.001f)) {
		m_pReconstruction->getData()[_iVolumeIndex] += _fWeight * m_pSinogram->getData()[_iRayIndex] / fGammaBeta;
	}
}
//----------------------------------------------------------------------------------------
void SIRTBPPolicy::rayPosterior(int _iRayIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void SIRTBPPolicy::pixelPosterior(int _iVolumeIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// SINOGRAM MASK  (Ray+Pixel Driven)
//----------------------------------------------------------------------------------------
SinogramMaskPolicy::SinogramMaskPolicy() 
{
}
//----------------------------------------------------------------------------------------
SinogramMaskPolicy::SinogramMaskPolicy(CFloat32ProjectionData2D* _pSinogramMask) 
{
	m_pSinogramMask = _pSinogramMask;
}
//----------------------------------------------------------------------------------------	
SinogramMaskPolicy::~SinogramMaskPolicy() 
{
}
//----------------------------------------------------------------------------------------	
bool SinogramMaskPolicy::rayPrior(int _iRayIndex) 
{
	return (m_pSinogramMask->getData()[_iRayIndex] != 0);
}
//----------------------------------------------------------------------------------------
bool SinogramMaskPolicy::pixelPrior(int _iVolumeIndex) 
{
	return true;
}
//----------------------------------------------------------------------------------------	
void SinogramMaskPolicy::addWeight(int _iRayIndex, int _iVolumeIndex, float32 _fWeight) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void SinogramMaskPolicy::rayPosterior(int _iRayIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void SinogramMaskPolicy::pixelPosterior(int _iVolumeIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// RECONSTRUCTION MASK (Ray+Pixel Driven)
//----------------------------------------------------------------------------------------
ReconstructionMaskPolicy::ReconstructionMaskPolicy() 
{
}
//----------------------------------------------------------------------------------------
ReconstructionMaskPolicy::ReconstructionMaskPolicy(CFloat32VolumeData2D* _pReconstructionMask) 
{
	m_pReconstructionMask = _pReconstructionMask;
}
//----------------------------------------------------------------------------------------	
ReconstructionMaskPolicy::~ReconstructionMaskPolicy() 
{
}
//----------------------------------------------------------------------------------------	
bool ReconstructionMaskPolicy::rayPrior(int _iRayIndex) 
{
	return true;
}
//----------------------------------------------------------------------------------------
bool ReconstructionMaskPolicy::pixelPrior(int _iVolumeIndex) 
{
	return (m_pReconstructionMask->getData()[_iVolumeIndex] != 0);
}
//----------------------------------------------------------------------------------------	
void ReconstructionMaskPolicy::addWeight(int _iRayIndex, int _iVolumeIndex, float32 _fWeight) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void ReconstructionMaskPolicy::rayPosterior(int _iRayIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
void ReconstructionMaskPolicy::pixelPosterior(int _iVolumeIndex) 
{
	// nothing
}
//----------------------------------------------------------------------------------------
#endif