From 90a0bd4962ae21413456b27e55382ba5223e1c10 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 11 Oct 2017 13:40:40 +0200 Subject: Adjust test to weights scaled by detector pixel width --- tests/test_ParallelBeamLinearKernelProjector2D.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test_ParallelBeamLinearKernelProjector2D.cpp') diff --git a/tests/test_ParallelBeamLinearKernelProjector2D.cpp b/tests/test_ParallelBeamLinearKernelProjector2D.cpp index f1fa311..c62f670 100644 --- a/tests/test_ParallelBeamLinearKernelProjector2D.cpp +++ b/tests/test_ParallelBeamLinearKernelProjector2D.cpp @@ -85,10 +85,10 @@ float32 compute_linear_kernel(const astra::CProjectionGeometry2D& projgeom, cons if (fabs(cos(fAngle)) > fabs(sin(fAngle))) { fDetStep = volgeom.getPixelLengthY() * fabs(cos(fAngle)); - fWeight = volgeom.getPixelLengthX() * 1.0f / fabs(cos(fAngle)); + fWeight = projgeom.getDetectorWidth() * volgeom.getPixelLengthX() * 1.0f / fabs(cos(fAngle)); } else { fDetStep = volgeom.getPixelLengthX() * fabs(sin(fAngle)); - fWeight = volgeom.getPixelLengthY() * 1.0f / fabs(sin(fAngle)); + fWeight = projgeom.getDetectorWidth() * volgeom.getPixelLengthY() * 1.0f / fabs(sin(fAngle)); } // printf("step: %f\n weight: %f\n", fDetStep, fWeight); @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE( testParallelBeamLinearKernelProjector2D_Rectangles ) pPix[i].m_iIndex / volGeom.getGridColCount(), iDet, projGeom.getProjectionAngle(0)); - BOOST_CHECK_SMALL( pPix[i].m_fWeight - fTest, 0.00037f); + BOOST_CHECK_SMALL( pPix[i].m_fWeight - fTest, 0.0004f); fW += pPix[i].m_fWeight; } -- cgit v1.2.3