summaryrefslogtreecommitdiffstats
path: root/src/ParallelBeamStripKernelProjector2D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-03-12 16:37:15 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-03-12 16:40:14 +0100
commit91f8e20d164be682059346718828e274d9438b5c (patch)
tree9f69d2755bcdab23e522154d2fafc44e28d57af3 /src/ParallelBeamStripKernelProjector2D.cpp
parent78b36155d7633bf862045f3eff7fbc37fbc03498 (diff)
downloadastra-91f8e20d164be682059346718828e274d9438b5c.tar.gz
astra-91f8e20d164be682059346718828e274d9438b5c.tar.bz2
astra-91f8e20d164be682059346718828e274d9438b5c.tar.xz
astra-91f8e20d164be682059346718828e274d9438b5c.zip
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.
Diffstat (limited to 'src/ParallelBeamStripKernelProjector2D.cpp')
-rw-r--r--src/ParallelBeamStripKernelProjector2D.cpp4
1 files changed, 2 insertions, 2 deletions
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;
}
//----------------------------------------------------------------------------------------