summaryrefslogtreecommitdiffstats
path: root/include/astra/ParallelBeamLinearKernelProjector2D.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/ParallelBeamLinearKernelProjector2D.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/ParallelBeamLinearKernelProjector2D.inl')
-rw-r--r--include/astra/ParallelBeamLinearKernelProjector2D.inl19
1 files changed, 8 insertions, 11 deletions
diff --git a/include/astra/ParallelBeamLinearKernelProjector2D.inl b/include/astra/ParallelBeamLinearKernelProjector2D.inl
index 10d4892..53451e5 100644
--- a/include/astra/ParallelBeamLinearKernelProjector2D.inl
+++ b/include/astra/ParallelBeamLinearKernelProjector2D.inl
@@ -154,18 +154,7 @@ void CParallelBeamLinearKernelProjector2D::projectBlock_internal(int _iProjFrom,
const SParProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
- float32 detSize = sqrt(proj->fDetUX * proj->fDetUX + proj->fDetUY * proj->fDetUY);
-
const bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY);
- if (vertical) {
- RxOverRy = proj->fRayX/proj->fRayY;
- lengthPerRow = detSize * m_pVolumeGeometry->getPixelLengthX() * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayY);
- deltac = -pixelLengthY * RxOverRy * inv_pixelLengthX;
- } else {
- RyOverRx = proj->fRayY/proj->fRayX;
- lengthPerCol = detSize * m_pVolumeGeometry->getPixelLengthY() * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayX);
- deltar = -pixelLengthX * RyOverRx * inv_pixelLengthY;
- }
Ex = m_pVolumeGeometry->getWindowMinX() + pixelLengthX*0.5f;
Ey = m_pVolumeGeometry->getWindowMaxY() - pixelLengthY*0.5f;
@@ -186,6 +175,10 @@ void CParallelBeamLinearKernelProjector2D::projectBlock_internal(int _iProjFrom,
// vertically
if (vertical) {
+ RxOverRy = proj->fRayX/proj->fRayY;
+ lengthPerRow = m_pVolumeGeometry->getPixelLengthX() * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayY);
+ deltac = -pixelLengthY * RxOverRy * inv_pixelLengthX;
+
// calculate c for row 0
c = (Dx + (Ey - Dy)*RxOverRy - Ex) * inv_pixelLengthX;
@@ -209,6 +202,10 @@ void CParallelBeamLinearKernelProjector2D::projectBlock_internal(int _iProjFrom,
// horizontally
else {
+ RyOverRx = proj->fRayY/proj->fRayX;
+ lengthPerCol = m_pVolumeGeometry->getPixelLengthY() * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayX);
+ deltar = -pixelLengthX * RyOverRx * inv_pixelLengthY;
+
// calculate r for col 0
r = -(Dy + (Ex - Dx)*RyOverRx - Ey) * inv_pixelLengthY;