summaryrefslogtreecommitdiffstats
path: root/src/ProjectionGeometry3D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-05-01 17:48:32 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-05-06 15:18:03 +0200
commit47fe3421585302f2101691a685ab99b0e1ad5cfc (patch)
tree5f7ff204c5d19f83313487a840748724e04ad8e5 /src/ProjectionGeometry3D.cpp
parentbf31003d74f538a9096ef5999b31b0daa58c38c9 (diff)
downloadastra-47fe3421585302f2101691a685ab99b0e1ad5cfc.tar.gz
astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.tar.bz2
astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.tar.xz
astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.zip
Change XMLNode* to XMLNode
An XMLNode object is already simply a pointer, so no need to dynamically allocate XMLNodes.
Diffstat (limited to 'src/ProjectionGeometry3D.cpp')
-rw-r--r--src/ProjectionGeometry3D.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/ProjectionGeometry3D.cpp b/src/ProjectionGeometry3D.cpp
index 5b77767..ef0246c 100644
--- a/src/ProjectionGeometry3D.cpp
+++ b/src/ProjectionGeometry3D.cpp
@@ -149,38 +149,34 @@ bool CProjectionGeometry3D::initialize(const Config& _cfg)
ASTRA_ASSERT(_cfg.self);
// Required: DetectorWidth
- XMLNode* node = _cfg.self->getSingleNode("DetectorSpacingX");
+ XMLNode node = _cfg.self.getSingleNode("DetectorSpacingX");
ASTRA_CONFIG_CHECK(node, "ProjectionGeometry3D", "No DetectorSpacingX tag specified.");
- m_fDetectorSpacingX = boost::lexical_cast<float32>(node->getContent());
- ASTRA_DELETE(node);
+ m_fDetectorSpacingX = boost::lexical_cast<float32>(node.getContent());
CC.markNodeParsed("DetectorSpacingX");
// Required: DetectorHeight
- node = _cfg.self->getSingleNode("DetectorSpacingY");
+ node = _cfg.self.getSingleNode("DetectorSpacingY");
ASTRA_CONFIG_CHECK(node, "ProjectionGeometry3D", "No DetectorSpacingY tag specified.");
- m_fDetectorSpacingY = boost::lexical_cast<float32>(node->getContent());
- ASTRA_DELETE(node);
+ m_fDetectorSpacingY = boost::lexical_cast<float32>(node.getContent());
CC.markNodeParsed("DetectorSpacingY");
// Required: DetectorRowCount
- node = _cfg.self->getSingleNode("DetectorRowCount");
+ node = _cfg.self.getSingleNode("DetectorRowCount");
ASTRA_CONFIG_CHECK(node, "ProjectionGeometry3D", "No DetectorRowCount tag specified.");
- m_iDetectorRowCount = boost::lexical_cast<int>(node->getContent());
- ASTRA_DELETE(node);
+ m_iDetectorRowCount = boost::lexical_cast<int>(node.getContent());
CC.markNodeParsed("DetectorRowCount");
// Required: DetectorCount
- node = _cfg.self->getSingleNode("DetectorColCount");
+ node = _cfg.self.getSingleNode("DetectorColCount");
ASTRA_CONFIG_CHECK(node, "ProjectionGeometry3D", "No DetectorColCount tag specified.");
- m_iDetectorColCount = boost::lexical_cast<int>(node->getContent());
+ m_iDetectorColCount = boost::lexical_cast<int>(node.getContent());
m_iDetectorTotCount = m_iDetectorRowCount * m_iDetectorColCount;
- ASTRA_DELETE(node);
CC.markNodeParsed("DetectorColCount");
// Required: ProjectionAngles
- node = _cfg.self->getSingleNode("ProjectionAngles");
+ node = _cfg.self.getSingleNode("ProjectionAngles");
ASTRA_CONFIG_CHECK(node, "ProjectionGeometry3D", "No ProjectionAngles tag specified.");
- vector<float32> angles = node->getContentNumericalArray();
+ vector<float32> angles = node.getContentNumericalArray();
m_iProjectionAngleCount = angles.size();
ASTRA_CONFIG_CHECK(m_iProjectionAngleCount > 0, "ProjectionGeometry3D", "Not enough ProjectionAngles specified.");
m_pfProjectionAngles = new float32[m_iProjectionAngleCount];
@@ -188,7 +184,6 @@ bool CProjectionGeometry3D::initialize(const Config& _cfg)
m_pfProjectionAngles[i] = angles[i];
}
CC.markNodeParsed("ProjectionAngles");
- ASTRA_DELETE(node);
// Interface class, so don't return true
return false;