From 91f8e20d164be682059346718828e274d9438b5c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 12 Mar 2019 16:37:15 +0100 Subject: Fix rounding error in ParStripProjector2D::getProjectionWeightsCount In the worst case this would lead to (nearly) empty storage for getMatrix(), resulting in (near) explicit projection matrices. (These are only used for exporting explicit sparse projection matrices to matlab/python; not for FP/BP/reconstruction.) This is a quick fix; ideally the affected code would use dynamic storage. --- src/ParallelBeamStripKernelProjector2D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ParallelBeamStripKernelProjector2D.cpp b/src/ParallelBeamStripKernelProjector2D.cpp index 849168d..45cfa83 100644 --- a/src/ParallelBeamStripKernelProjector2D.cpp +++ b/src/ParallelBeamStripKernelProjector2D.cpp @@ -141,8 +141,8 @@ bool CParallelBeamStripKernelProjector2D::initialize(CParallelProjectionGeometry int CParallelBeamStripKernelProjector2D::getProjectionWeightsCount(int _iProjectionIndex) { int maxDim = max(m_pVolumeGeometry->getGridRowCount(), m_pVolumeGeometry->getGridColCount()); - int scale = m_pProjectionGeometry->getDetectorWidth() / min(m_pVolumeGeometry->getPixelLengthX(), m_pVolumeGeometry->getPixelLengthY()); - return maxDim * scale * 10 + 1; + double scale = m_pProjectionGeometry->getDetectorWidth() / min(m_pVolumeGeometry->getPixelLengthX(), m_pVolumeGeometry->getPixelLengthY()); + return int(maxDim * scale * 10) + 1; } //---------------------------------------------------------------------------------------- -- cgit v1.2.3