summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWim van Aarle <wimvanaarle@gmail.com>2015-03-12 11:40:56 +0100
committerWim van Aarle <wimvanaarle@gmail.com>2015-03-12 11:40:56 +0100
commit2c1999b1bbfb7ef2ca1ae22b43e2a0ab8108073f (patch)
tree0cc0dc584ebc18fd361f13df5e581a11fcfd451c /src
parent043005e280194ab529bae7863ba50d33f34daa42 (diff)
downloadastra-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.cpp22
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