diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-07-29 12:03:38 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-07-29 12:11:52 +0200 |
commit | b1ffc11d930c19bd73af9837a08bc8dde9fe8e72 (patch) | |
tree | 40ce622ffdc8d75c885135db1ce4773c9670e2c3 /src/FanFlatProjectionGeometry2D.cpp | |
parent | b2611a03577c285ddf48edab0d05dafa09ab362c (diff) | |
download | astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.gz astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.bz2 astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.xz astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.zip |
Add CUDA parvec support
Diffstat (limited to 'src/FanFlatProjectionGeometry2D.cpp')
-rw-r--r-- | src/FanFlatProjectionGeometry2D.cpp | 18 |
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); |