diff options
author | Wim van Aarle <wimvanaarle@gmail.com> | 2015-03-12 11:40:56 +0100 |
---|---|---|
committer | Wim van Aarle <wimvanaarle@gmail.com> | 2015-03-12 11:40:56 +0100 |
commit | 2c1999b1bbfb7ef2ca1ae22b43e2a0ab8108073f (patch) | |
tree | 0cc0dc584ebc18fd361f13df5e581a11fcfd451c /src | |
parent | 043005e280194ab529bae7863ba50d33f34daa42 (diff) | |
download | astra-2c1999b1bbfb7ef2ca1ae22b43e2a0ab8108073f.tar.gz astra-2c1999b1bbfb7ef2ca1ae22b43e2a0ab8108073f.tar.bz2 astra-2c1999b1bbfb7ef2ca1ae22b43e2a0ab8108073f.tar.xz astra-2c1999b1bbfb7ef2ca1ae22b43e2a0ab8108073f.zip |
parallel projectors now always use vector geometries internally
Diffstat (limited to 'src')
-rw-r--r-- | src/ParallelProjectionGeometry2D.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp index cac8f30..64fc0b9 100644 --- a/src/ParallelProjectionGeometry2D.cpp +++ b/src/ParallelProjectionGeometry2D.cpp @@ -182,8 +182,8 @@ Config* CParallelProjectionGeometry2D::getConfiguration() const cfg->self->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); return cfg; } -//---------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------- CVector3D CParallelProjectionGeometry2D::getProjectionDirection(int _iProjectionIndex, int _iDetectorIndex /* = 0 */) { CVector3D vOutput; @@ -197,4 +197,24 @@ CVector3D CParallelProjectionGeometry2D::getProjectionDirection(int _iProjection return vOutput; } +//---------------------------------------------------------------------------------------- +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; + } + + CParallelVecProjectionGeometry2D* vecGeom = new CParallelVecProjectionGeometry2D(); + vecGeom->initialize(m_iProjectionAngleCount, m_iDetectorCount, vectors); + delete[] vectors; + return vecGeom; +} + } // end namespace astra |