diff options
author | Wim van Aarle <wimvanaarle@gmail.com> | 2015-05-26 16:07:10 +0200 |
---|---|---|
committer | Wim van Aarle <wimvanaarle@gmail.com> | 2015-05-26 16:07:10 +0200 |
commit | fe9bba178fdae86ab47fa0428ed38dc04f6ac0a2 (patch) | |
tree | 7a7f4580924380c6c74168e13c459a7fdae4f628 | |
parent | 3117c7a61a83ca28ba00211d1eb65eaf13a7307a (diff) | |
download | astra-fe9bba178fdae86ab47fa0428ed38dc04f6ac0a2.tar.gz astra-fe9bba178fdae86ab47fa0428ed38dc04f6ac0a2.tar.bz2 astra-fe9bba178fdae86ab47fa0428ed38dc04f6ac0a2.tar.xz astra-fe9bba178fdae86ab47fa0428ed38dc04f6ac0a2.zip |
updated configuration of ParallelVecProjectionGeometry
-rw-r--r-- | src/ParallelVecProjectionGeometry2D.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/ParallelVecProjectionGeometry2D.cpp b/src/ParallelVecProjectionGeometry2D.cpp index c1ed1c4..1503076 100644 --- a/src/ParallelVecProjectionGeometry2D.cpp +++ b/src/ParallelVecProjectionGeometry2D.cpp @@ -101,25 +101,21 @@ bool CParallelVecProjectionGeometry2D::initialize(const Config& _cfg) ASTRA_ASSERT(_cfg.self); ConfigStackCheck<CProjectionGeometry2D> CC("ParallelVecProjectionGeometry2D", this, _cfg); - XMLNode* node; - // TODO: Fix up class hierarchy... this class doesn't fit very well. // initialization of parent class //CProjectionGeometry2D::initialize(_cfg); // Required: DetectorCount - node = _cfg.self->getSingleNode("DetectorCount"); + XMLNode node = _cfg.self.getSingleNode("DetectorCount"); ASTRA_CONFIG_CHECK(node, "ParallelVecProjectionGeometry2D", "No DetectorRowCount 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: Vectors - node = _cfg.self->getSingleNode("Vectors"); + node = _cfg.self.getSingleNode("Vectors"); ASTRA_CONFIG_CHECK(node, "ParallelVecProjectionGeometry2D", "No Vectors tag specified."); - vector<float32> data = node->getContentNumericalArray(); + vector<float32> data = node.getContentNumericalArray(); CC.markNodeParsed("Vectors"); - ASTRA_DELETE(node); ASTRA_CONFIG_CHECK(data.size() % 6 == 0, "ParallelVecProjectionGeometry2D", "Vectors doesn't consist of 6-tuples."); m_iProjectionAngleCount = data.size() / 6; m_pProjectionAngles = new SParProjection[m_iProjectionAngleCount]; @@ -137,8 +133,6 @@ bool CParallelVecProjectionGeometry2D::initialize(const Config& _cfg) p.fDetSY = data[6*i + 3] - 0.5f * m_iDetectorCount * p.fDetUY; } - - // success m_bInitialized = _check(); return m_bInitialized; @@ -217,8 +211,8 @@ Config* CParallelVecProjectionGeometry2D::getConfiguration() const { Config* cfg = new Config(); cfg->initialize("ProjectionGeometry2D"); - cfg->self->addAttribute("type", "parallel_vec"); - cfg->self->addChildNode("DetectorCount", getDetectorCount()); + cfg->self.addAttribute("type", "parallel_vec"); + cfg->self.addChildNode("DetectorCount", getDetectorCount()); std::string vectors = ""; for (int i = 0; i < m_iProjectionAngleCount; ++i) { SParProjection& p = m_pProjectionAngles[i]; @@ -230,7 +224,7 @@ Config* CParallelVecProjectionGeometry2D::getConfiguration() const vectors += boost::lexical_cast<string>(p.fDetUY); if (i < m_iProjectionAngleCount-1) vectors += ';'; } - cfg->self->addChildNode("Vectors", vectors); + cfg->self.addChildNode("Vectors", vectors); return cfg; } //---------------------------------------------------------------------------------------- |