diff options
author | Wim van Aarle <wimvanaarle@gmail.com> | 2015-02-26 13:47:59 +0100 |
---|---|---|
committer | Wim van Aarle <wimvanaarle@gmail.com> | 2015-02-26 13:47:59 +0100 |
commit | cca150841cd1de4f3b4d24c1188263b9623bc511 (patch) | |
tree | dca9846737f33fd9173a53231bd0bec566fb6bb3 /src/ParallelVecProjectionGeometry3D.cpp | |
parent | 065d9c6a18f2b8eececc608ce850a9a308ca6356 (diff) | |
download | astra-cca150841cd1de4f3b4d24c1188263b9623bc511.tar.gz astra-cca150841cd1de4f3b4d24c1188263b9623bc511.tar.bz2 astra-cca150841cd1de4f3b4d24c1188263b9623bc511.tar.xz astra-cca150841cd1de4f3b4d24c1188263b9623bc511.zip |
get_geometry now uses XML config object (for projections)
Diffstat (limited to 'src/ParallelVecProjectionGeometry3D.cpp')
-rw-r--r-- | src/ParallelVecProjectionGeometry3D.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ParallelVecProjectionGeometry3D.cpp b/src/ParallelVecProjectionGeometry3D.cpp index 17f00a4..0f39c4a 100644 --- a/src/ParallelVecProjectionGeometry3D.cpp +++ b/src/ParallelVecProjectionGeometry3D.cpp @@ -211,6 +211,40 @@ void CParallelVecProjectionGeometry3D::toXML(XMLNode* _sNode) const //_sNode->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); } +//---------------------------------------------------------------------------------------- +// Get the configuration object +Config* CParallelVecProjectionGeometry3D::getConfiguration() const +{ + Config* cfg = new Config(); + cfg->initialize("ProjectionGeometry3D"); + + cfg->self->addAttribute("type", "parallel3d"); + cfg->self->addChildNode("DetectorRowCount", m_iDetectorRowCount); + cfg->self->addChildNode("DetectorColCount", m_iDetectorColCount); + + std::string vectors = ""; + for (int i = 0; i < m_iProjectionAngleCount; ++i) { + SPar3DProjection& p = m_pProjectionAngles[i]; + vectors += boost::lexical_cast<string>(p.fRayX) + ","; + vectors += boost::lexical_cast<string>(p.fRayY) + ","; + vectors += boost::lexical_cast<string>(p.fRayZ) + ","; + vectors += boost::lexical_cast<string>(p.fDetSX + 0.5f*m_iDetectorRowCount*p.fDetUX + 0.5f*m_iDetectorColCount*p.fDetVX) + ","; + vectors += boost::lexical_cast<string>(p.fDetSY + 0.5f*m_iDetectorRowCount*p.fDetUY + 0.5f*m_iDetectorColCount*p.fDetVY) + ","; + vectors += boost::lexical_cast<string>(p.fDetSZ + 0.5f*m_iDetectorRowCount*p.fDetUZ + 0.5f*m_iDetectorColCount*p.fDetVZ) + ","; + vectors += boost::lexical_cast<string>(p.fDetUX) + ","; + vectors += boost::lexical_cast<string>(p.fDetUY) + ","; + vectors += boost::lexical_cast<string>(p.fDetUZ) + ","; + vectors += boost::lexical_cast<string>(p.fDetVX) + ","; + vectors += boost::lexical_cast<string>(p.fDetVY) + ","; + vectors += boost::lexical_cast<string>(p.fDetVZ); + if (i < m_iProjectionAngleCount-1) vectors += ';'; + } + cfg->self->addChildNode("Vectors", vectors); + + return cfg; +} +//---------------------------------------------------------------------------------------- + CVector3D CParallelVecProjectionGeometry3D::getProjectionDirection(int _iProjectionIndex, int _iDetectorIndex) const { const SPar3DProjection& p = m_pProjectionAngles[_iProjectionIndex]; |