diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-03-13 12:30:53 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-03-13 12:30:53 +0100 |
commit | bf943fb8b7aea8790589affca19bbcfa8e71090d (patch) | |
tree | 21e90c5eb086f12f4a7136492199797e295c88b1 | |
parent | 91f8e20d164be682059346718828e274d9438b5c (diff) | |
download | astra-bf943fb8b7aea8790589affca19bbcfa8e71090d.tar.gz astra-bf943fb8b7aea8790589affca19bbcfa8e71090d.tar.bz2 astra-bf943fb8b7aea8790589affca19bbcfa8e71090d.tar.xz astra-bf943fb8b7aea8790589affca19bbcfa8e71090d.zip |
Make ParStripProjector2D::getProjectionWeightsCount safer for very thin strips
-rw-r--r-- | src/ParallelBeamStripKernelProjector2D.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ParallelBeamStripKernelProjector2D.cpp b/src/ParallelBeamStripKernelProjector2D.cpp index 45cfa83..d2086da 100644 --- a/src/ParallelBeamStripKernelProjector2D.cpp +++ b/src/ParallelBeamStripKernelProjector2D.cpp @@ -141,7 +141,7 @@ bool CParallelBeamStripKernelProjector2D::initialize(CParallelProjectionGeometry int CParallelBeamStripKernelProjector2D::getProjectionWeightsCount(int _iProjectionIndex) { int maxDim = max(m_pVolumeGeometry->getGridRowCount(), m_pVolumeGeometry->getGridColCount()); - double scale = m_pProjectionGeometry->getDetectorWidth() / min(m_pVolumeGeometry->getPixelLengthX(), m_pVolumeGeometry->getPixelLengthY()); + double scale = max(m_pProjectionGeometry->getDetectorWidth() / min(m_pVolumeGeometry->getPixelLengthX(), m_pVolumeGeometry->getPixelLengthY()), 1.0f); return int(maxDim * scale * 10) + 1; } |