diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-10-11 13:40:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-10-11 15:04:14 +0200 |
commit | 90a0bd4962ae21413456b27e55382ba5223e1c10 (patch) | |
tree | f53c9e89adf293df492ca70e6f9a00358f29fdf2 /tests | |
parent | f64c471e882c925417336354e15ca46d586bdc70 (diff) | |
download | astra-90a0bd4962ae21413456b27e55382ba5223e1c10.tar.gz astra-90a0bd4962ae21413456b27e55382ba5223e1c10.tar.bz2 astra-90a0bd4962ae21413456b27e55382ba5223e1c10.tar.xz astra-90a0bd4962ae21413456b27e55382ba5223e1c10.zip |
Adjust test to weights scaled by detector pixel width
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ParallelBeamLinearKernelProjector2D.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |