diff options
Diffstat (limited to 'src/CudaDartSmoothingAlgorithm3D.cpp')
-rw-r--r-- | src/CudaDartSmoothingAlgorithm3D.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/CudaDartSmoothingAlgorithm3D.cpp b/src/CudaDartSmoothingAlgorithm3D.cpp index 5903d3c..0dc0631 100644 --- a/src/CudaDartSmoothingAlgorithm3D.cpp +++ b/src/CudaDartSmoothingAlgorithm3D.cpp @@ -60,19 +60,19 @@ CCudaDartSmoothingAlgorithm3D::~CCudaDartSmoothingAlgorithm3D() bool CCudaDartSmoothingAlgorithm3D::initialize(const Config& _cfg) { ASTRA_ASSERT(_cfg.self); - ConfigStackCheck<CAlgorithm> CC("CudaDartSmoothingAlgorithm", this, _cfg); + ConfigStackCheck<CAlgorithm> CC("CudaDartSmoothingAlgorithm3D", this, _cfg); // reconstruction data XMLNode node = _cfg.self.getSingleNode("InDataId"); - ASTRA_CONFIG_CHECK(node, "CudaDartMask", "No InDataId tag specified."); - int id = node.getContentInt(); + ASTRA_CONFIG_CHECK(node, "CudaDartSmoothing3D", "No InDataId tag specified."); + int id = StringUtil::stringToInt(node.getContent(), -1); m_pIn = dynamic_cast<CFloat32VolumeData3DMemory*>(CData3DManager::getSingleton().get(id)); CC.markNodeParsed("InDataId"); // reconstruction data node = _cfg.self.getSingleNode("OutDataId"); - ASTRA_CONFIG_CHECK(node, "CudaDartMask", "No OutDataId tag specified."); - id = node.getContentInt(); + ASTRA_CONFIG_CHECK(node, "CudaDartSmoothing3D", "No OutDataId tag specified."); + id = StringUtil::stringToInt(node.getContent(), -1); m_pOut = dynamic_cast<CFloat32VolumeData3DMemory*>(CData3DManager::getSingleton().get(id)); CC.markNodeParsed("OutDataId"); @@ -84,11 +84,19 @@ bool CCudaDartSmoothingAlgorithm3D::initialize(const Config& _cfg) CC.markOptionParsed("GPUIndex"); // Option: Intensity - m_fB = (float)_cfg.self.getOptionNumerical("Intensity", 0.3f); + try { + m_fB = (float)_cfg.self.getOptionNumerical("Intensity", 0.3f); + } catch (const StringUtil::bad_cast &e) { + ASTRA_CONFIG_CHECK(false, "CudaDartSmoothing3D", "Intensity must be numerical"); + } CC.markOptionParsed("Intensity"); // Option: Radius - m_iRadius = (unsigned int)_cfg.self.getOptionNumerical("Radius", 1); + try { + m_iRadius = _cfg.self.getOptionInt("Radius", 1); + } catch (const StringUtil::bad_cast &e) { + ASTRA_CONFIG_CHECK(false, "CudaDartSmoothing3D", "Radius must be an integer."); + } CC.markOptionParsed("Radius"); _check(); |