From 26713deae284d6bb793b728c7af2db28a7484054 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Wed, 24 Jun 2015 20:30:52 +0200 Subject: Include ExtraDetectorOffset in returned configuration --- src/ParallelProjectionGeometry2D.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ParallelProjectionGeometry2D.cpp') diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp index 699e141..5f51d08 100644 --- a/src/ParallelProjectionGeometry2D.cpp +++ b/src/ParallelProjectionGeometry2D.cpp @@ -180,6 +180,9 @@ Config* CParallelProjectionGeometry2D::getConfiguration() const cfg->self.addChildNode("DetectorCount", getDetectorCount()); cfg->self.addChildNode("DetectorWidth", getDetectorWidth()); cfg->self.addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); + XMLNode opt = cfg->self.addChildNode("Option"); + opt.addAttribute("key","ExtraDetectorOffset"); + opt.setContent(m_pfExtraDetectorOffset, m_iProjectionAngleCount); return cfg; } //---------------------------------------------------------------------------------------- -- cgit v1.2.3 From f1a8bd8d2b62b089a90fef55268e3300581717ed Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Thu, 25 Jun 2015 21:38:46 +0200 Subject: Add extra null check for ExtraDetectorOffset --- src/ParallelProjectionGeometry2D.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ParallelProjectionGeometry2D.cpp') diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp index 5f51d08..7260b83 100644 --- a/src/ParallelProjectionGeometry2D.cpp +++ b/src/ParallelProjectionGeometry2D.cpp @@ -180,9 +180,11 @@ Config* CParallelProjectionGeometry2D::getConfiguration() const cfg->self.addChildNode("DetectorCount", getDetectorCount()); cfg->self.addChildNode("DetectorWidth", getDetectorWidth()); cfg->self.addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); - XMLNode opt = cfg->self.addChildNode("Option"); - opt.addAttribute("key","ExtraDetectorOffset"); - opt.setContent(m_pfExtraDetectorOffset, m_iProjectionAngleCount); + if(m_pfExtraDetectorOffset!=NULL){ + XMLNode opt = cfg->self.addChildNode("Option"); + opt.addAttribute("key","ExtraDetectorOffset"); + opt.setContent(m_pfExtraDetectorOffset, m_iProjectionAngleCount); + } return cfg; } //---------------------------------------------------------------------------------------- -- cgit v1.2.3