summaryrefslogtreecommitdiffstats
path: root/include/astra/ParallelBeamDistanceDrivenProjector2D.inl
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-09-27 15:16:26 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-09-27 15:16:26 +0200
commit54af7e8e22a3f1c9d90b13291b28d39778c05564 (patch)
tree260310b16d624261bb80f82979af27750022259b /include/astra/ParallelBeamDistanceDrivenProjector2D.inl
parent1fec36f7ccadd5f7dcf2bb59b0654dc53653b0f3 (diff)
parentb629db207bb263495bfff2e61ce189ccac27b4b9 (diff)
downloadastra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.gz
astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.bz2
astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.xz
astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.zip
Merge branch 'consistent_scaling'
Diffstat (limited to 'include/astra/ParallelBeamDistanceDrivenProjector2D.inl')
-rw-r--r--include/astra/ParallelBeamDistanceDrivenProjector2D.inl9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/astra/ParallelBeamDistanceDrivenProjector2D.inl b/include/astra/ParallelBeamDistanceDrivenProjector2D.inl
index aedcee9..3a18c6f 100644
--- a/include/astra/ParallelBeamDistanceDrivenProjector2D.inl
+++ b/include/astra/ParallelBeamDistanceDrivenProjector2D.inl
@@ -72,7 +72,7 @@ void CParallelBeamDistanceDrivenProjector2D::projectBlock_internal(int _iProjFro
const int rowCount = m_pVolumeGeometry->getGridRowCount();
// Performance note:
- // This is not a very well optimizated version of the distance driven
+ // This is not a very well optimized version of the distance driven
// projector. The CPU projector model in ASTRA requires ray-driven iteration,
// which limits re-use of intermediate computations.
@@ -86,6 +86,9 @@ void CParallelBeamDistanceDrivenProjector2D::projectBlock_internal(int _iProjFro
const float32 Ex = m_pVolumeGeometry->getWindowMinX() + pixelLengthX*0.5f;
const float32 Ey = m_pVolumeGeometry->getWindowMaxY() - pixelLengthY*0.5f;
+ const float32 rayWidth = fabs(proj->fDetUX * proj->fRayY - proj->fDetUY * proj->fRayX) /
+ sqrt(proj->fRayX * proj->fRayX + proj->fRayY * proj->fRayY);
+
// loop detectors
for (int iDetector = _iDetFrom; iDetector < _iDetTo; ++iDetector) {
@@ -100,7 +103,7 @@ void CParallelBeamDistanceDrivenProjector2D::projectBlock_internal(int _iProjFro
if (vertical) {
const float32 RxOverRy = proj->fRayX/proj->fRayY;
- const float32 lengthPerRow = m_pVolumeGeometry->getPixelLengthX() * m_pVolumeGeometry->getPixelLengthY();
+ const float32 lengthPerRow = m_pVolumeGeometry->getPixelLengthX() * m_pVolumeGeometry->getPixelLengthY() / rayWidth;
const float32 deltac = -pixelLengthY * RxOverRy * inv_pixelLengthX;
const float32 deltad = 0.5f * fabs((proj->fDetUX - proj->fDetUY * RxOverRy) * inv_pixelLengthX);
@@ -157,7 +160,7 @@ void CParallelBeamDistanceDrivenProjector2D::projectBlock_internal(int _iProjFro
} else {
const float32 RyOverRx = proj->fRayY/proj->fRayX;
- const float32 lengthPerCol = m_pVolumeGeometry->getPixelLengthX() * m_pVolumeGeometry->getPixelLengthY();
+ const float32 lengthPerCol = m_pVolumeGeometry->getPixelLengthX() * m_pVolumeGeometry->getPixelLengthY() / rayWidth;
const float32 deltar = -pixelLengthX * RyOverRx * inv_pixelLengthY;
const float32 deltad = 0.5f * fabs((proj->fDetUY - proj->fDetUX * RyOverRx) * inv_pixelLengthY);