summaryrefslogtreecommitdiffstats
path: root/src/CudaDartMaskAlgorithm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CudaDartMaskAlgorithm.cpp')
-rw-r--r--src/CudaDartMaskAlgorithm.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/CudaDartMaskAlgorithm.cpp b/src/CudaDartMaskAlgorithm.cpp
index 3c5519c..bd9f59f 100644
--- a/src/CudaDartMaskAlgorithm.cpp
+++ b/src/CudaDartMaskAlgorithm.cpp
@@ -66,14 +66,14 @@ bool CCudaDartMaskAlgorithm::initialize(const Config& _cfg)
// reconstruction data
XMLNode node = _cfg.self.getSingleNode("SegmentationDataId");
ASTRA_CONFIG_CHECK(node, "CudaDartMask", "No SegmentationDataId tag specified.");
- int id = node.getContentInt();
+ int id = StringUtil::stringToInt(node.getContent(), -1);
m_pSegmentation = dynamic_cast<CFloat32VolumeData2D*>(CData2DManager::getSingleton().get(id));
CC.markNodeParsed("SegmentationDataId");
// reconstruction data
node = _cfg.self.getSingleNode("MaskDataId");
ASTRA_CONFIG_CHECK(node, "CudaDartMask", "No MaskDataId tag specified.");
- id = node.getContentInt();
+ id = StringUtil::stringToInt(node.getContent(), -1);
m_pMask = dynamic_cast<CFloat32VolumeData2D*>(CData2DManager::getSingleton().get(id));
CC.markNodeParsed("MaskDataId");
@@ -84,16 +84,28 @@ bool CCudaDartMaskAlgorithm::initialize(const Config& _cfg)
if (!_cfg.self.hasOption("GPUindex"))
CC.markOptionParsed("GPUIndex");
- // Option: Connectivity
- m_iConn = (unsigned int)_cfg.self.getOptionNumerical("Connectivity", 8);
+ // Option: Connectivity
+ try {
+ m_iConn = _cfg.self.getOptionInt("Connectivity", 8);
+ } catch (const StringUtil::bad_cast &e) {
+ ASTRA_CONFIG_CHECK(false, "CudaDartMask", "Connectivity must be an integer.");
+ }
CC.markOptionParsed("Connectivity");
// Option: Threshold
- m_iThreshold = (unsigned int)_cfg.self.getOptionNumerical("Threshold", 1);
+ try {
+ m_iThreshold = _cfg.self.getOptionInt("Threshold", 1);
+ } catch (const StringUtil::bad_cast &e) {
+ ASTRA_CONFIG_CHECK(false, "CudaDartMask", "Threshold must be an integer.");
+ }
CC.markOptionParsed("Threshold");
// 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, "CudaDartMask", "Radius must be an integer.");
+ }
CC.markOptionParsed("Radius");
_check();