summaryrefslogtreecommitdiffstats
path: root/include
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
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')
-rw-r--r--include/astra/ParallelBeamLineKernelProjector2D.inl29
-rw-r--r--include/astra/ParallelBeamLinearKernelProjector2D.inl17
-rw-r--r--include/astra/ParallelBeamStripKernelProjector2D.inl25
3 files changed, 34 insertions, 37 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;
diff --git a/include/astra/ParallelBeamLinearKernelProjector2D.inl b/include/astra/ParallelBeamLinearKernelProjector2D.inl
index 1acd422..53451e5 100644
--- a/include/astra/ParallelBeamLinearKernelProjector2D.inl
+++ b/include/astra/ParallelBeamLinearKernelProjector2D.inl
@@ -155,15 +155,6 @@ void CParallelBeamLinearKernelProjector2D::projectBlock_internal(int _iProjFrom,
const SParProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
const bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY);
- 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;
- } 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;
- }
Ex = m_pVolumeGeometry->getWindowMinX() + pixelLengthX*0.5f;
Ey = m_pVolumeGeometry->getWindowMaxY() - pixelLengthY*0.5f;
@@ -184,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;
@@ -207,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;
diff --git a/include/astra/ParallelBeamStripKernelProjector2D.inl b/include/astra/ParallelBeamStripKernelProjector2D.inl
index bed02ab..2031560 100644
--- a/include/astra/ParallelBeamStripKernelProjector2D.inl
+++ b/include/astra/ParallelBeamStripKernelProjector2D.inl
@@ -147,19 +147,6 @@ void CParallelBeamStripKernelProjector2D::projectBlock_internal(int _iProjFrom,
const float32 relPixelArea = pixelArea / rayWidth;
bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY);
- if (vertical) {
- RxOverRy = proj->fRayX/proj->fRayY;
- deltac = -m_pVolumeGeometry->getPixelLengthY() * RxOverRy * inv_pixelLengthX;
- S = 0.5f - 0.5f*fabs(RxOverRy);
- T = 0.5f + 0.5f*fabs(RxOverRy);
- invTminS = 1.0f / (T-S);
- } else {
- RyOverRx = proj->fRayY/proj->fRayX;
- deltar = -m_pVolumeGeometry->getPixelLengthX() * RyOverRx * inv_pixelLengthY;
- S = 0.5f - 0.5f*fabs(RyOverRx);
- T = 0.5f + 0.5f*fabs(RyOverRx);
- invTminS = 1.0f / (T-S);
- }
Ex = m_pVolumeGeometry->getWindowMinX() + pixelLengthX*0.5f;
Ey = m_pVolumeGeometry->getWindowMaxY() - pixelLengthY*0.5f;
@@ -180,6 +167,12 @@ void CParallelBeamStripKernelProjector2D::projectBlock_internal(int _iProjFrom,
// vertically
if (vertical) {
+ RxOverRy = proj->fRayX/proj->fRayY;
+ deltac = -m_pVolumeGeometry->getPixelLengthY() * RxOverRy * inv_pixelLengthX;
+ S = 0.5f - 0.5f*fabs(RxOverRy);
+ T = 0.5f + 0.5f*fabs(RxOverRy);
+ invTminS = 1.0f / (T-S);
+
// calculate cL and cR for row 0
cL = (DLx + (Ey - DLy)*RxOverRy - Ex) * inv_pixelLengthX;
cR = (DRx + (Ey - DRy)*RxOverRy - Ex) * inv_pixelLengthX;
@@ -233,6 +226,12 @@ void CParallelBeamStripKernelProjector2D::projectBlock_internal(int _iProjFrom,
// horizontally
else {
+ RyOverRx = proj->fRayY/proj->fRayX;
+ deltar = -m_pVolumeGeometry->getPixelLengthX() * RyOverRx * inv_pixelLengthY;
+ S = 0.5f - 0.5f*fabs(RyOverRx);
+ T = 0.5f + 0.5f*fabs(RyOverRx);
+ invTminS = 1.0f / (T-S);
+
// calculate rL and rR for row 0
rL = -(DLy + (Ex - DLx)*RyOverRx - Ey) * inv_pixelLengthY;
rR = -(DRy + (Ex - DRx)*RyOverRx - Ey) * inv_pixelLengthY;