summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CudaFilteredBackProjectionAlgorithm.cpp7
-rw-r--r--src/CudaReconstructionAlgorithm2D.cpp4
-rw-r--r--src/FilteredBackProjectionAlgorithm.cpp8
3 files changed, 14 insertions, 5 deletions
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp
index 88e235b..69140fc 100644
--- a/src/CudaFilteredBackProjectionAlgorithm.cpp
+++ b/src/CudaFilteredBackProjectionAlgorithm.cpp
@@ -151,6 +151,13 @@ void CCudaFilteredBackProjectionAlgorithm::initCUDAAlgorithm()
if (!ok) {
ASTRA_ERROR("CCudaFilteredBackProjectionAlgorithm: Failed to set short-scan mode");
}
+
+ const CVolumeGeometry2D& volGeom = *m_pProjector->getVolumeGeometry();
+ float fPixelArea = volGeom.getPixelArea();
+ ok &= pFBP->setReconstructionScale(1.0f/fPixelArea);
+ if (!ok) {
+ ASTRA_ERROR("CCudaFilteredBackProjectionAlgorithm: Failed to set reconstruction scale");
+ }
}
diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp
index 939a026..6730cea 100644
--- a/src/CudaReconstructionAlgorithm2D.cpp
+++ b/src/CudaReconstructionAlgorithm2D.cpp
@@ -309,9 +309,7 @@ void CCudaReconstructionAlgorithm2D::run(int _iNrIterations)
m_bAlgoInit = true;
}
- float fSinogramScale = 1.0f;
-
- ok = m_pAlgo->copyDataToGPU(m_pSinogram->getDataConst(), m_pSinogram->getGeometry()->getDetectorCount(), fSinogramScale,
+ ok = m_pAlgo->copyDataToGPU(m_pSinogram->getDataConst(), m_pSinogram->getGeometry()->getDetectorCount(),
m_pReconstruction->getDataConst(), volgeom.getGridColCount(),
m_bUseReconstructionMask ? m_pReconstructionMask->getDataConst() : 0, volgeom.getGridColCount(),
m_bUseSinogramMask ? m_pSinogramMask->getDataConst() : 0, m_pSinogram->getGeometry()->getDetectorCount());
diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp
index 423dc6c..95bef3c 100644
--- a/src/FilteredBackProjectionAlgorithm.cpp
+++ b/src/FilteredBackProjectionAlgorithm.cpp
@@ -264,8 +264,12 @@ void CFilteredBackProjectionAlgorithm::run(int _iNrIterations)
DefaultBPPolicy(m_pReconstruction, &filteredSinogram));
// Scale data
- int iAngleCount = m_pProjector->getProjectionGeometry()->getProjectionAngleCount();
- (*m_pReconstruction) *= (PI/2)/iAngleCount;
+ const CVolumeGeometry2D& volGeom = *m_pProjector->getVolumeGeometry();
+ const CProjectionGeometry2D& projGeom = *m_pProjector->getProjectionGeometry();
+
+ int iAngleCount = projGeom.getProjectionAngleCount();
+ float fPixelArea = volGeom.getPixelArea();
+ (*m_pReconstruction) *= PI/(2*iAngleCount*fPixelArea);
m_pReconstruction->updateStatistics();
}