summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWim van Aarle <wimvanaarle@gmail.com>2015-03-12 15:16:10 +0100
committerWim van Aarle <wimvanaarle@gmail.com>2015-03-12 15:16:10 +0100
commitc0b6862d75edcde6beacf811ce97200776d13b62 (patch)
tree5e113db79ff7cbfd3f9bfe98ac32f88f897a8972 /src
parent424c97dcdcf4604ffcf6dd0d3a5cda93e332c7e4 (diff)
downloadastra-c0b6862d75edcde6beacf811ce97200776d13b62.tar.gz
astra-c0b6862d75edcde6beacf811ce97200776d13b62.tar.bz2
astra-c0b6862d75edcde6beacf811ce97200776d13b62.tar.xz
astra-c0b6862d75edcde6beacf811ce97200776d13b62.zip
updated 'line_fanflat' projector
Diffstat (limited to 'src')
-rw-r--r--src/FanFlatProjectionGeometry2D.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/FanFlatProjectionGeometry2D.cpp b/src/FanFlatProjectionGeometry2D.cpp
index d757f18..9851d40 100644
--- a/src/FanFlatProjectionGeometry2D.cpp
+++ b/src/FanFlatProjectionGeometry2D.cpp
@@ -217,7 +217,25 @@ Config* CFanFlatProjectionGeometry2D::getConfiguration() const
cfg->self->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount);
return cfg;
}
+
//----------------------------------------------------------------------------------------
+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;
+ }
+ CFanFlatVecProjectionGeometry2D* vecGeom = new CFanFlatVecProjectionGeometry2D();
+ vecGeom->initialize(m_iProjectionAngleCount, m_iDetectorCount, vectors);
+ delete[] vectors;
+ return vecGeom;
+}
} // namespace astra