From bf943fb8b7aea8790589affca19bbcfa8e71090d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 13 Mar 2019 12:30:53 +0100 Subject: Make ParStripProjector2D::getProjectionWeightsCount safer for very thin strips --- src/ParallelBeamStripKernelProjector2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3