diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-03-12 16:37:15 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-03-12 16:40:14 +0100 |
commit | 91f8e20d164be682059346718828e274d9438b5c (patch) | |
tree | 9f69d2755bcdab23e522154d2fafc44e28d57af3 /src/ParallelBeamStripKernelProjector2D.cpp | |
parent | 78b36155d7633bf862045f3eff7fbc37fbc03498 (diff) | |
download | astra-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.cpp | 4 |
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; } //---------------------------------------------------------------------------------------- |