summaryrefslogtreecommitdiffstats
path: root/src/ParallelProjectionGeometry2D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-07-29 12:03:38 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-07-29 12:11:52 +0200
commitb1ffc11d930c19bd73af9837a08bc8dde9fe8e72 (patch)
tree40ce622ffdc8d75c885135db1ce4773c9670e2c3 /src/ParallelProjectionGeometry2D.cpp
parentb2611a03577c285ddf48edab0d05dafa09ab362c (diff)
downloadastra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.gz
astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.bz2
astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.xz
astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.zip
Add CUDA parvec support
Diffstat (limited to 'src/ParallelProjectionGeometry2D.cpp')
-rw-r--r--src/ParallelProjectionGeometry2D.cpp35
1 files changed, 11 insertions, 24 deletions
diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp
index 105e24b..e1f93aa 100644
--- a/src/ParallelProjectionGeometry2D.cpp
+++ b/src/ParallelProjectionGeometry2D.cpp
@@ -28,6 +28,8 @@ $Id$
#include "astra/ParallelProjectionGeometry2D.h"
+#include "astra/GeometryUtil2D.h"
+
#include <cstring>
using namespace std;
@@ -48,15 +50,13 @@ CParallelProjectionGeometry2D::CParallelProjectionGeometry2D() :
CParallelProjectionGeometry2D::CParallelProjectionGeometry2D(int _iProjectionAngleCount,
int _iDetectorCount,
float32 _fDetectorWidth,
- const float32* _pfProjectionAngles,
- const float32* _pfExtraDetectorOffsets)
+ const float32* _pfProjectionAngles)
{
_clear();
initialize(_iProjectionAngleCount,
_iDetectorCount,
_fDetectorWidth,
- _pfProjectionAngles,
- _pfExtraDetectorOffsets);
+ _pfProjectionAngles);
}
//----------------------------------------------------------------------------------------
@@ -115,14 +115,12 @@ bool CParallelProjectionGeometry2D::initialize(const Config& _cfg)
bool CParallelProjectionGeometry2D::initialize(int _iProjectionAngleCount,
int _iDetectorCount,
float32 _fDetectorWidth,
- const float32* _pfProjectionAngles,
- const float32* _pfExtraDetectorOffsets)
+ const float32* _pfProjectionAngles)
{
_initialize(_iProjectionAngleCount,
_iDetectorCount,
_fDetectorWidth,
- _pfProjectionAngles,
- _pfExtraDetectorOffsets);
+ _pfProjectionAngles);
// success
m_bInitialized = _check();
@@ -178,11 +176,6 @@ Config* CParallelProjectionGeometry2D::getConfiguration() const
cfg->self.addChildNode("DetectorCount", getDetectorCount());
cfg->self.addChildNode("DetectorWidth", getDetectorWidth());
cfg->self.addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount);
- if(m_pfExtraDetectorOffset!=NULL){
- XMLNode opt = cfg->self.addChildNode("Option");
- opt.addAttribute("key","ExtraDetectorOffset");
- opt.setContent(m_pfExtraDetectorOffset, m_iProjectionAngleCount);
- }
return cfg;
}
@@ -203,17 +196,11 @@ CVector3D CParallelProjectionGeometry2D::getProjectionDirection(int _iProjection
//----------------------------------------------------------------------------------------
CParallelVecProjectionGeometry2D* CParallelProjectionGeometry2D::toVectorGeometry()
{
- SParProjection* vectors = new SParProjection[m_iProjectionAngleCount];
- for (int i = 0; i < m_iProjectionAngleCount; ++i)
- {
- vectors[i].fRayX = sinf(m_pfProjectionAngles[i]);
- vectors[i].fRayY = -cosf(m_pfProjectionAngles[i]);
- vectors[i].fDetUX = cosf(m_pfProjectionAngles[i]) * m_fDetectorWidth;
- vectors[i].fDetUY = sinf(m_pfProjectionAngles[i]) * m_fDetectorWidth;
- vectors[i].fDetSX = -0.5f * m_iDetectorCount * vectors[i].fDetUX;
- vectors[i].fDetSY = -0.5f * m_iDetectorCount * vectors[i].fDetUY;
- }
-
+ SParProjection* vectors = genParProjections(m_iProjectionAngleCount,
+ m_iDetectorCount,
+ m_fDetectorWidth,
+ m_pfProjectionAngles, 0);
+ // TODO: ExtraOffsets?
CParallelVecProjectionGeometry2D* vecGeom = new CParallelVecProjectionGeometry2D();
vecGeom->initialize(m_iProjectionAngleCount, m_iDetectorCount, vectors);
delete[] vectors;