summaryrefslogtreecommitdiffstats
path: root/include/astra/ParallelBeamLineKernelProjector2D.inl
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2019-03-30 22:43:26 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-09-25 14:10:09 +0200
commit027dc56ffe325652314b4f9e5d804b3b20fd0db3 (patch)
treeb45ff4f24c32ad638f3dc0f32108a23179290ad5 /include/astra/ParallelBeamLineKernelProjector2D.inl
parent12f86554bafb66e6afc6193f181527ba0749de92 (diff)
downloadastra-027dc56ffe325652314b4f9e5d804b3b20fd0db3.tar.gz
astra-027dc56ffe325652314b4f9e5d804b3b20fd0db3.tar.bz2
astra-027dc56ffe325652314b4f9e5d804b3b20fd0db3.tar.xz
astra-027dc56ffe325652314b4f9e5d804b3b20fd0db3.zip
Work around some warnings
Diffstat (limited to 'include/astra/ParallelBeamLineKernelProjector2D.inl')
-rw-r--r--include/astra/ParallelBeamLineKernelProjector2D.inl29
1 files changed, 14 insertions, 15 deletions
diff --git a/include/astra/ParallelBeamLineKernelProjector2D.inl b/include/astra/ParallelBeamLineKernelProjector2D.inl
index 1fc67a8..903ebb6 100644
--- a/include/astra/ParallelBeamLineKernelProjector2D.inl
+++ b/include/astra/ParallelBeamLineKernelProjector2D.inl
@@ -167,21 +167,6 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i
const SParProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY);
- if (vertical) {
- RxOverRy = proj->fRayX/proj->fRayY;
- lengthPerRow = pixelLengthX * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayY);
- deltac = -pixelLengthY * RxOverRy * inv_pixelLengthX;
- S = 0.5f - 0.5f*fabs(RxOverRy);
- T = 0.5f + 0.5f*fabs(RxOverRy);
- invTminSTimesLengthPerRow = lengthPerRow / (T - S);
- } else {
- RyOverRx = proj->fRayY/proj->fRayX;
- lengthPerCol = pixelLengthY * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayX);
- deltar = -pixelLengthX * RyOverRx * inv_pixelLengthY;
- S = 0.5f - 0.5f*fabs(RyOverRx);
- T = 0.5f + 0.5f*fabs(RyOverRx);
- invTminSTimesLengthPerCol = lengthPerCol / (T - S);
- }
Ex = m_pVolumeGeometry->getWindowMinX() + pixelLengthX*0.5f;
Ey = m_pVolumeGeometry->getWindowMaxY() - pixelLengthY*0.5f;
@@ -202,6 +187,13 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i
// vertically
if (vertical) {
+ RxOverRy = proj->fRayX/proj->fRayY;
+ lengthPerRow = pixelLengthX * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayY);
+ deltac = -pixelLengthY * RxOverRy * inv_pixelLengthX;
+ S = 0.5f - 0.5f*fabs(RxOverRy);
+ T = 0.5f + 0.5f*fabs(RxOverRy);
+ invTminSTimesLengthPerRow = lengthPerRow / (T - S);
+
// calculate c for row 0
c = (Dx + (Ey - Dy)*RxOverRy - Ex) * inv_pixelLengthX;
@@ -246,6 +238,13 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i
// horizontally
else {
+ RyOverRx = proj->fRayY/proj->fRayX;
+ lengthPerCol = pixelLengthY * sqrt(proj->fRayY*proj->fRayY + proj->fRayX*proj->fRayX) / abs(proj->fRayX);
+ deltar = -pixelLengthX * RyOverRx * inv_pixelLengthY;
+ S = 0.5f - 0.5f*fabs(RyOverRx);
+ T = 0.5f + 0.5f*fabs(RyOverRx);
+ invTminSTimesLengthPerCol = lengthPerCol / (T - S);
+
// calculate r for col 0
r = -(Dy + (Ex - Dx)*RyOverRx - Ey) * inv_pixelLengthY;