From 9b9f3a23bb27434c8112ccc454d012384cec0a8e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Jun 2014 12:29:33 +0000 Subject: Check for valid sinogram and volume masks in ReconstructionAlgorithm --- src/CudaReconstructionAlgorithm2D.cpp | 4 +++- src/ReconstructionAlgorithm2D.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index 385cef1..0443303 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -114,6 +114,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg) m_bUseReconstructionMask = true; id = boost::lexical_cast(_cfg.self->getOption("ReconstructionMaskId")); m_pReconstructionMask = dynamic_cast(CData2DManager::getSingleton().get(id)); + ASTRA_CONFIG_CHECK(m_pReconstructionMask, "CudaReconstruction2D", "Invalid ReconstructionMaskId."); } CC.markOptionParsed("ReconstructionMaskId"); // fixed mask @@ -121,6 +122,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg) m_bUseSinogramMask = true; id = boost::lexical_cast(_cfg.self->getOption("SinogramMaskId")); m_pSinogramMask = dynamic_cast(CData2DManager::getSingleton().get(id)); + ASTRA_CONFIG_CHECK(m_pSinogramMask, "CudaReconstruction2D", "Invalid SinogramMaskId."); } CC.markOptionParsed("SinogramMaskId"); @@ -174,7 +176,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - cout << "Warning: non-CUDA Projector2D passed to FP_CUDA" << std::endl; + cout << "Warning: non-CUDA Projector2D passed" << std::endl; } delete node; } diff --git a/src/ReconstructionAlgorithm2D.cpp b/src/ReconstructionAlgorithm2D.cpp index ea693e3..2e7b8c4 100644 --- a/src/ReconstructionAlgorithm2D.cpp +++ b/src/ReconstructionAlgorithm2D.cpp @@ -112,6 +112,7 @@ bool CReconstructionAlgorithm2D::initialize(const Config& _cfg) m_bUseReconstructionMask = true; id = boost::lexical_cast(_cfg.self->getOption("ReconstructionMaskId")); m_pReconstructionMask = dynamic_cast(CData2DManager::getSingleton().get(id)); + ASTRA_CONFIG_CHECK(m_pReconstructionMask, "Reconstruction2D", "Invalid ReconstructionMaskId."); } CC.markOptionParsed("ReconstructionMaskId"); @@ -120,6 +121,7 @@ bool CReconstructionAlgorithm2D::initialize(const Config& _cfg) m_bUseSinogramMask = true; id = boost::lexical_cast(_cfg.self->getOption("SinogramMaskId")); m_pSinogramMask = dynamic_cast(CData2DManager::getSingleton().get(id)); + ASTRA_CONFIG_CHECK(m_pSinogramMask, "Reconstruction2D", "Invalid SinogramMaskId."); } CC.markOptionParsed("SinogramMaskId"); -- cgit v1.2.3