diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-12-17 14:37:41 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-01-05 11:15:17 +0100 |
commit | fc86917da1a175c04e9bd2e5f0bedb0a48a81c26 (patch) | |
tree | 6996a3e2e2cfd110a566d4093e22ca746a52038d /src/FanFlatVecProjectionGeometry2D.cpp | |
parent | 73fa0a8df8203288aca032c71caa5ff47d35a3e2 (diff) | |
download | astra-fc86917da1a175c04e9bd2e5f0bedb0a48a81c26.tar.gz astra-fc86917da1a175c04e9bd2e5f0bedb0a48a81c26.tar.bz2 astra-fc86917da1a175c04e9bd2e5f0bedb0a48a81c26.tar.xz astra-fc86917da1a175c04e9bd2e5f0bedb0a48a81c26.zip |
Replace boost::lexical_cast by stringstreams
This is to avoid the dependence of lexical_cast on the current locale.
The stringstreams used for the new string parsing/output functions
are explicitly imbued with the C/classic locale.
Diffstat (limited to 'src/FanFlatVecProjectionGeometry2D.cpp')
-rw-r--r-- | src/FanFlatVecProjectionGeometry2D.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/FanFlatVecProjectionGeometry2D.cpp b/src/FanFlatVecProjectionGeometry2D.cpp index 4104379..0b76fc5 100644 --- a/src/FanFlatVecProjectionGeometry2D.cpp +++ b/src/FanFlatVecProjectionGeometry2D.cpp @@ -30,7 +30,6 @@ $Id$ #include <cstring> #include <sstream> -#include <boost/lexical_cast.hpp> using namespace std; @@ -125,7 +124,7 @@ bool CFanFlatVecProjectionGeometry2D::initialize(const Config& _cfg) // Required: DetectorCount node = _cfg.self.getSingleNode("DetectorCount"); ASTRA_CONFIG_CHECK(node, "FanFlatVecProjectionGeometry3D", "No DetectorRowCount tag specified."); - m_iDetectorCount = boost::lexical_cast<int>(node.getContent()); + m_iDetectorCount = node.getContentInt(); CC.markNodeParsed("DetectorCount"); // Required: Vectors @@ -235,12 +234,12 @@ Config* CFanFlatVecProjectionGeometry2D::getConfiguration() const std::string vectors = ""; for (int i = 0; i < m_iProjectionAngleCount; ++i) { SFanProjection& p = m_pProjectionAngles[i]; - vectors += boost::lexical_cast<string>(p.fSrcX) + ","; - vectors += boost::lexical_cast<string>(p.fSrcY) + ","; - vectors += boost::lexical_cast<string>(p.fDetSX + 0.5f * m_iDetectorCount * p.fDetUX) + ","; - vectors += boost::lexical_cast<string>(p.fDetSY + 0.5f * m_iDetectorCount * p.fDetUY) + ","; - vectors += boost::lexical_cast<string>(p.fDetUX) + ","; - vectors += boost::lexical_cast<string>(p.fDetUY); + vectors += StringUtil::toString(p.fSrcX) + ","; + vectors += StringUtil::toString(p.fSrcY) + ","; + vectors += StringUtil::toString(p.fDetSX + 0.5f * m_iDetectorCount * p.fDetUX) + ","; + vectors += StringUtil::toString(p.fDetSY + 0.5f * m_iDetectorCount * p.fDetUY) + ","; + vectors += StringUtil::toString(p.fDetUX) + ","; + vectors += StringUtil::toString(p.fDetUY); if (i < m_iProjectionAngleCount-1) vectors += ';'; } cfg->self.addChildNode("Vectors", vectors); |