diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-05-08 14:12:53 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2015-05-08 14:12:53 +0200 |
commit | 99f46882982b92c632869053ae0dd416312b02ff (patch) | |
tree | 539252314daa42411d053e926134b289a750f14c /src/ProjectionGeometry2D.cpp | |
parent | 63307fca7a82bfea7592d9c8d3a359333e622495 (diff) | |
parent | fff7470f1d74b0085355130350fa834ea8d37069 (diff) | |
download | astra-99f46882982b92c632869053ae0dd416312b02ff.tar.gz astra-99f46882982b92c632869053ae0dd416312b02ff.tar.bz2 astra-99f46882982b92c632869053ae0dd416312b02ff.tar.xz astra-99f46882982b92c632869053ae0dd416312b02ff.zip |
Merge pull request #61 from wjp/xmlnode_cleanup
Clean up XMLNode
Diffstat (limited to 'src/ProjectionGeometry2D.cpp')
-rw-r--r-- | src/ProjectionGeometry2D.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ProjectionGeometry2D.cpp b/src/ProjectionGeometry2D.cpp index 89b5fe0..b89605b 100644 --- a/src/ProjectionGeometry2D.cpp +++ b/src/ProjectionGeometry2D.cpp @@ -124,24 +124,21 @@ bool CProjectionGeometry2D::initialize(const Config& _cfg) } // Required: DetectorWidth - XMLNode* node = _cfg.self->getSingleNode("DetectorWidth"); + XMLNode node = _cfg.self.getSingleNode("DetectorWidth"); ASTRA_CONFIG_CHECK(node, "ProjectionGeometry2D", "No DetectorWidth tag specified."); - m_fDetectorWidth = boost::lexical_cast<float32>(node->getContent()); - ASTRA_DELETE(node); + m_fDetectorWidth = boost::lexical_cast<float32>(node.getContent()); CC.markNodeParsed("DetectorWidth"); // Required: DetectorCount - node = _cfg.self->getSingleNode("DetectorCount"); + node = _cfg.self.getSingleNode("DetectorCount"); ASTRA_CONFIG_CHECK(node, "ProjectionGeometry2D", "No DetectorCount tag specified."); - m_iDetectorCount = boost::lexical_cast<int>(node->getContent()); - ASTRA_DELETE(node); + m_iDetectorCount = boost::lexical_cast<int>(node.getContent()); CC.markNodeParsed("DetectorCount"); // Required: ProjectionAngles - node = _cfg.self->getSingleNode("ProjectionAngles"); + node = _cfg.self.getSingleNode("ProjectionAngles"); ASTRA_CONFIG_CHECK(node, "ProjectionGeometry2D", "No ProjectionAngles tag specified."); - vector<float32> angles = node->getContentNumericalArray(); - delete node; + vector<float32> angles = node.getContentNumericalArray(); m_iProjectionAngleCount = angles.size(); ASTRA_CONFIG_CHECK(m_iProjectionAngleCount > 0, "ProjectionGeometry2D", "Not enough ProjectionAngles specified."); m_pfProjectionAngles = new float32[m_iProjectionAngleCount]; @@ -150,7 +147,7 @@ bool CProjectionGeometry2D::initialize(const Config& _cfg) } CC.markNodeParsed("ProjectionAngles"); - vector<float32> offset = _cfg.self->getOptionNumericalArray("ExtraDetectorOffset"); + vector<float32> offset = _cfg.self.getOptionNumericalArray("ExtraDetectorOffset"); m_pfExtraDetectorOffset = new float32[m_iProjectionAngleCount]; if (offset.size() == (size_t)m_iProjectionAngleCount) { for (int i = 0; i < m_iProjectionAngleCount; i++) { |