diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-09-27 15:16:26 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-09-27 15:16:26 +0200 |
commit | 54af7e8e22a3f1c9d90b13291b28d39778c05564 (patch) | |
tree | 260310b16d624261bb80f82979af27750022259b /include/astra/ParallelBeamLineKernelProjector2D.inl | |
parent | 1fec36f7ccadd5f7dcf2bb59b0654dc53653b0f3 (diff) | |
parent | b629db207bb263495bfff2e61ce189ccac27b4b9 (diff) | |
download | astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.gz astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.bz2 astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.xz astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.zip |
Merge branch 'consistent_scaling'
Diffstat (limited to 'include/astra/ParallelBeamLineKernelProjector2D.inl')
-rw-r--r-- | include/astra/ParallelBeamLineKernelProjector2D.inl | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/include/astra/ParallelBeamLineKernelProjector2D.inl b/include/astra/ParallelBeamLineKernelProjector2D.inl index a9f1aa0..903ebb6 100644 --- a/include/astra/ParallelBeamLineKernelProjector2D.inl +++ b/include/astra/ParallelBeamLineKernelProjector2D.inl @@ -166,24 +166,7 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i const SParProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle]; - float32 detSize = sqrt(proj->fDetUX * proj->fDetUX + proj->fDetUY * proj->fDetUY); - bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY); - if (vertical) { - RxOverRy = proj->fRayX/proj->fRayY; - lengthPerRow = detSize * 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 = detSize * 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; @@ -204,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; @@ -248,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; |