summaryrefslogtreecommitdiffstats
path: root/src/FanFlatProjectionGeometry2D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FanFlatProjectionGeometry2D.cpp')
-rw-r--r--src/FanFlatProjectionGeometry2D.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/FanFlatProjectionGeometry2D.cpp b/src/FanFlatProjectionGeometry2D.cpp
index 3aab582..4eec9c4 100644
--- a/src/FanFlatProjectionGeometry2D.cpp
+++ b/src/FanFlatProjectionGeometry2D.cpp
@@ -28,6 +28,8 @@ $Id$
#include "astra/FanFlatProjectionGeometry2D.h"
+#include "astra/GeometryUtil2D.h"
+
#include <cstring>
#include <sstream>
@@ -218,16 +220,12 @@ Config* CFanFlatProjectionGeometry2D::getConfiguration() const
//----------------------------------------------------------------------------------------
CFanFlatVecProjectionGeometry2D* CFanFlatProjectionGeometry2D::toVectorGeometry()
{
- SFanProjection* vectors = new SFanProjection[m_iProjectionAngleCount];
- for (int i = 0; i < m_iProjectionAngleCount; ++i)
- {
- vectors[i].fSrcX = sinf(m_pfProjectionAngles[i]) * m_fOriginSourceDistance;
- vectors[i].fSrcY = -cosf(m_pfProjectionAngles[i]) * m_fOriginSourceDistance;
- vectors[i].fDetUX = cosf(m_pfProjectionAngles[i]) * m_fDetectorWidth;
- vectors[i].fDetUY = sinf(m_pfProjectionAngles[i]) * m_fDetectorWidth;
- vectors[i].fDetSX = -sinf(m_pfProjectionAngles[i]) * m_fOriginDetectorDistance - 0.5f * m_iDetectorCount * vectors[i].fDetUX;
- vectors[i].fDetSY = cosf(m_pfProjectionAngles[i]) * m_fOriginDetectorDistance - 0.5f * m_iDetectorCount * vectors[i].fDetUY;
- }
+ SFanProjection* vectors = genFanProjections(m_iProjectionAngleCount,
+ m_iDetectorCount,
+ m_fOriginSourceDistance,
+ m_fOriginDetectorDistance,
+ m_fDetectorWidth,
+ m_pfProjectionAngles);
CFanFlatVecProjectionGeometry2D* vecGeom = new CFanFlatVecProjectionGeometry2D();
vecGeom->initialize(m_iProjectionAngleCount, m_iDetectorCount, vectors);