From 90ef1f69d79a0c40414c5932dfa9bd69f363ae80 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 10 Oct 2017 13:15:53 +0200 Subject: Scale 2D projection results by detector pixel width The strip and cuda projectors already did this scaling, so this makes the other behave consistently. --- include/astra/FanFlatBeamLineKernelProjector2D.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/astra/FanFlatBeamLineKernelProjector2D.inl') diff --git a/include/astra/FanFlatBeamLineKernelProjector2D.inl b/include/astra/FanFlatBeamLineKernelProjector2D.inl index 01f031c..c1e1e94 100644 --- a/include/astra/FanFlatBeamLineKernelProjector2D.inl +++ b/include/astra/FanFlatBeamLineKernelProjector2D.inl @@ -82,6 +82,8 @@ void CFanFlatBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, in const SFanProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle]; + float32 detSize = sqrt(proj->fDetUX * proj->fDetUX + proj->fDetUY * proj->fDetUY); + // loop detectors for (iDetector = _iDetFrom; iDetector < _iDetTo; ++iDetector) { @@ -99,14 +101,14 @@ void CFanFlatBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, in bool vertical = fabs(Rx) < fabs(Ry); if (vertical) { RxOverRy = Rx/Ry; - lengthPerRow = pixelLengthX * sqrt(Rx*Rx + Ry*Ry) / abs(Ry); + lengthPerRow = detSize * pixelLengthX * sqrt(Rx*Rx + Ry*Ry) / abs(Ry); 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 = Ry/Rx; - lengthPerCol = pixelLengthY * sqrt(Rx*Rx + Ry*Ry) / abs(Rx); + lengthPerCol = detSize * pixelLengthY * sqrt(Rx*Rx + Ry*Ry) / abs(Rx); deltar = -pixelLengthX * RyOverRx * inv_pixelLengthY; S = 0.5f - 0.5f*fabs(RyOverRx); T = 0.5f + 0.5f*fabs(RyOverRx); -- cgit v1.2.3