From 569515f3e20ef3b3c2c4a777f38f45dc67e6f9b6 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Tue, 24 Feb 2015 16:46:39 +0100 Subject: added get_geometry for 3d projection data objects --- src/ConeVecProjectionGeometry3D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ConeVecProjectionGeometry3D.cpp') diff --git a/src/ConeVecProjectionGeometry3D.cpp b/src/ConeVecProjectionGeometry3D.cpp index cf8f76d..fd549e0 100644 --- a/src/ConeVecProjectionGeometry3D.cpp +++ b/src/ConeVecProjectionGeometry3D.cpp @@ -198,13 +198,13 @@ bool CConeVecProjectionGeometry3D::isEqual(const CProjectionGeometry3D * _pGeom2 // is of type bool CConeVecProjectionGeometry3D::isOfType(const std::string& _sType) const { - return (_sType == "cone3d_vec"); + return (_sType == "cone3d_vec" || _sType == "cone_vec"); } //---------------------------------------------------------------------------------------- void CConeVecProjectionGeometry3D::toXML(XMLNode* _sNode) const { - _sNode->addAttribute("type","cone3d_vec"); + _sNode->addAttribute("type","cone_vec"); _sNode->addChildNode("DetectorRowCount", m_iDetectorRowCount); _sNode->addChildNode("DetectorColCount", m_iDetectorColCount); // TODO: -- cgit v1.2.3 From 85f397c64461499a27b13e84fbc0348b19feb248 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Tue, 24 Feb 2015 16:58:50 +0100 Subject: re-enabled get_geometry for 3d projectors --- src/ConeVecProjectionGeometry3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ConeVecProjectionGeometry3D.cpp') diff --git a/src/ConeVecProjectionGeometry3D.cpp b/src/ConeVecProjectionGeometry3D.cpp index fd549e0..3c32527 100644 --- a/src/ConeVecProjectionGeometry3D.cpp +++ b/src/ConeVecProjectionGeometry3D.cpp @@ -198,7 +198,7 @@ bool CConeVecProjectionGeometry3D::isEqual(const CProjectionGeometry3D * _pGeom2 // is of type bool CConeVecProjectionGeometry3D::isOfType(const std::string& _sType) const { - return (_sType == "cone3d_vec" || _sType == "cone_vec"); + return (_sType == "cone_vec"); } //---------------------------------------------------------------------------------------- -- cgit v1.2.3 From cca150841cd1de4f3b4d24c1188263b9623bc511 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 13:47:59 +0100 Subject: get_geometry now uses XML config object (for projections) --- src/ConeVecProjectionGeometry3D.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/ConeVecProjectionGeometry3D.cpp') diff --git a/src/ConeVecProjectionGeometry3D.cpp b/src/ConeVecProjectionGeometry3D.cpp index 3c32527..4f58188 100644 --- a/src/ConeVecProjectionGeometry3D.cpp +++ b/src/ConeVecProjectionGeometry3D.cpp @@ -210,6 +210,39 @@ void CConeVecProjectionGeometry3D::toXML(XMLNode* _sNode) const // TODO: //_sNode->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); } +//---------------------------------------------------------------------------------------- +// Get the configuration object +Config* CConeVecProjectionGeometry3D::getConfiguration() const +{ + Config* cfg = new Config(); + cfg->initialize("ProjectionGeometry3D"); + + cfg->self->addAttribute("type", "cone"); + cfg->self->addChildNode("DetectorRowCount", m_iDetectorRowCount); + cfg->self->addChildNode("DetectorColCount", m_iDetectorColCount); + + std::string vectors = ""; + for (int i = 0; i < m_iProjectionAngleCount; ++i) { + SConeProjection& p = m_pProjectionAngles[i]; + vectors += boost::lexical_cast(p.fSrcX) + ","; + vectors += boost::lexical_cast(p.fSrcY) + ","; + vectors += boost::lexical_cast(p.fSrcZ) + ","; + vectors += boost::lexical_cast(p.fDetSX + 0.5f*m_iDetectorRowCount*p.fDetUX + 0.5f*m_iDetectorColCount*p.fDetVX) + ","; + vectors += boost::lexical_cast(p.fDetSY + 0.5f*m_iDetectorRowCount*p.fDetUY + 0.5f*m_iDetectorColCount*p.fDetVY) + ","; + vectors += boost::lexical_cast(p.fDetSZ + 0.5f*m_iDetectorRowCount*p.fDetUZ + 0.5f*m_iDetectorColCount*p.fDetVZ) + ","; + vectors += boost::lexical_cast(p.fDetUX) + ","; + vectors += boost::lexical_cast(p.fDetUY) + ","; + vectors += boost::lexical_cast(p.fDetUZ) + ","; + vectors += boost::lexical_cast(p.fDetVX) + ","; + vectors += boost::lexical_cast(p.fDetVY) + ","; + vectors += boost::lexical_cast(p.fDetVZ); + if (i < m_iProjectionAngleCount-1) vectors += ';'; + } + cfg->self->addChildNode("Vectors", vectors); + + return cfg; +} +//---------------------------------------------------------------------------------------- CVector3D CConeVecProjectionGeometry3D::getProjectionDirection(int _iProjectionIndex, int _iDetectorIndex) const { -- cgit v1.2.3 From 2d11dcfc8d85cd562a36c192f5dda64c8378d160 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 14:00:14 +0100 Subject: updated docs --- src/ConeVecProjectionGeometry3D.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/ConeVecProjectionGeometry3D.cpp') diff --git a/src/ConeVecProjectionGeometry3D.cpp b/src/ConeVecProjectionGeometry3D.cpp index 4f58188..a4bd22d 100644 --- a/src/ConeVecProjectionGeometry3D.cpp +++ b/src/ConeVecProjectionGeometry3D.cpp @@ -201,15 +201,6 @@ bool CConeVecProjectionGeometry3D::isOfType(const std::string& _sType) const return (_sType == "cone_vec"); } -//---------------------------------------------------------------------------------------- -void CConeVecProjectionGeometry3D::toXML(XMLNode* _sNode) const -{ - _sNode->addAttribute("type","cone_vec"); - _sNode->addChildNode("DetectorRowCount", m_iDetectorRowCount); - _sNode->addChildNode("DetectorColCount", m_iDetectorColCount); - // TODO: - //_sNode->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); -} //---------------------------------------------------------------------------------------- // Get the configuration object Config* CConeVecProjectionGeometry3D::getConfiguration() const -- cgit v1.2.3