diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/CudaFilteredBackProjectionAlgorithm.cpp | 8 | ||||
| -rw-r--r-- | src/Float32ProjectionData3D.cpp | 36 | ||||
| -rw-r--r-- | src/ReconstructionAlgorithm3D.cpp | 1 | 
3 files changed, 24 insertions, 21 deletions
| diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index aac96d6..6353c46 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -189,9 +189,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg)  	m_pFBP = new AstraFBP;  	m_bAstraFBPInit = false; -	// success -	m_bIsInitialized = true; -	return m_bIsInitialized; +	return check();  }  bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D * _pSinogram, CFloat32VolumeData2D * _pReconstruction, E_FBPFILTER _eFilter, const float * _pfFilter /* = NULL */, int _iFilterWidth /* = 0 */, int _iGPUIndex /* = 0 */, float _fFilterParameter /* = -1.0f */) @@ -241,7 +239,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D *  	m_fFilterParameter = _fFilterParameter; -	return m_bIsInitialized; +	return check();  }  void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */) @@ -361,7 +359,7 @@ bool CCudaFilteredBackProjectionAlgorithm::check()  	ASTRA_CONFIG_CHECK(m_pReconstruction->isInitialized(), "FBP_CUDA", "Reconstruction Data Object Not Initialized.");  	// check gpu index -	ASTRA_CONFIG_CHECK(m_iGPUIndex >= -1, "FBP_CUDA", "GPUIndex must be a non-negative integer."); +	ASTRA_CONFIG_CHECK(m_iGPUIndex >= -1, "FBP_CUDA", "GPUIndex must be a non-negative integer or -1.");  	// check pixel supersampling  	ASTRA_CONFIG_CHECK(m_iPixelSuperSampling >= 0, "FBP_CUDA", "PixelSuperSampling must be a non-negative integer."); diff --git a/src/Float32ProjectionData3D.cpp b/src/Float32ProjectionData3D.cpp index 2bd0447..680ad55 100644 --- a/src/Float32ProjectionData3D.cpp +++ b/src/Float32ProjectionData3D.cpp @@ -53,13 +53,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32Pro  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  #ifdef _DEBUG  	CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); -	int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount(); -	int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount(); +	int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();  	ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); -	ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount); +	ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);  #endif  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) @@ -67,7 +67,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32Pro  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);  		CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex];  			float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; @@ -91,13 +91,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32Pro  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  #ifdef _DEBUG  	CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); -	int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount(); -	int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount(); +	int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();  	ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); -	ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount); +	ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);  #endif  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) @@ -105,7 +105,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32Pro  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);  		CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex];  			float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; @@ -129,13 +129,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32Pro  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  #ifdef _DEBUG  	CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); -	int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount(); -	int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount(); +	int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();  	ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); -	ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount); +	ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);  #endif  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) @@ -143,7 +143,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32Pro  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);  		CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex];  			float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; @@ -167,12 +167,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const float32& _f  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)  	{  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; @@ -194,12 +195,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator/=(const float32& _f  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)  	{  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; @@ -221,12 +223,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const float32& _f  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)  	{  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; @@ -248,12 +251,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const float32& _f  	CProjectionGeometry3D * pThisGeometry = getGeometry();  	int iProjectionCount = pThisGeometry->getProjectionCount(); +	int iDetectorCount = pThisGeometry->getDetectorTotCount();  	for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)  	{  		CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); -		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) +		for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)  		{  			float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; diff --git a/src/ReconstructionAlgorithm3D.cpp b/src/ReconstructionAlgorithm3D.cpp index f975ace..13d4b07 100644 --- a/src/ReconstructionAlgorithm3D.cpp +++ b/src/ReconstructionAlgorithm3D.cpp @@ -147,6 +147,7 @@ bool CReconstructionAlgorithm3D::initialize(const Config& _cfg)  		id = boost::lexical_cast<int>(_cfg.self.getOption("SinogramMaskId"));  		m_pSinogramMask = dynamic_cast<CFloat32ProjectionData3D*>(CData3DManager::getSingleton().get(id));  	} +	CC.markOptionParsed("SinogramMaskId");  	// Constraints - NEW  	if (_cfg.self.hasOption("MinConstraint")) { | 
