From b1ffc11d930c19bd73af9837a08bc8dde9fe8e72 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 29 Jul 2016 12:03:38 +0200 Subject: Add CUDA parvec support --- include/astra/GeometryUtil2D.h | 73 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 14 deletions(-) (limited to 'include/astra/GeometryUtil2D.h') diff --git a/include/astra/GeometryUtil2D.h b/include/astra/GeometryUtil2D.h index 680cecd..2f03062 100644 --- a/include/astra/GeometryUtil2D.h +++ b/include/astra/GeometryUtil2D.h @@ -32,27 +32,72 @@ $Id$ namespace astra { struct SParProjection { - // the ray direction - float fRayX, fRayY; + // the ray direction + float fRayX, fRayY; + + // the start of the (linear) detector + float fDetSX, fDetSY; + + // the length of a single detector pixel + float fDetUX, fDetUY; + + + void translate(double dx, double dy) { + fDetSX += dx; + fDetSY += dy; + } + void scale(double factor) { + fRayX *= factor; + fRayY *= factor; + fDetSX *= factor; + fDetSY *= factor; + fDetUX *= factor; + fDetUY *= factor; + } +}; - // the start of the (linear) detector - float fDetSX, fDetSY; - // the length of a single detector pixel - float fDetUX, fDetUY; +struct SFanProjection { + // the source + float fSrcX, fSrcY; + + // the start of the (linear) detector + float fDetSX, fDetSY; + + // the length of a single detector pixel + float fDetUX, fDetUY; + + void translate(double dx, double dy) { + fSrcX += dx; + fSrcY += dy; + fDetSX += dx; + fDetSY += dy; + } + void scale(double factor) { + fSrcX *= factor; + fSrcY *= factor; + fDetSX *= factor; + fDetSY *= factor; + fDetUX *= factor; + fDetUY *= factor; + } }; -struct SFanProjection { - // the source - float fSrcX, fSrcY; - // the start of the (linear) detector - float fDetSX, fDetSY; +SParProjection* genParProjections(unsigned int iProjAngles, + unsigned int iProjDets, + double fDetSize, + const float *pfAngles, + const float *pfExtraOffsets); - // the length of a single detector pixel - float fDetUX, fDetUY; -}; +SFanProjection* genFanProjections(unsigned int iProjAngles, + unsigned int iProjDets, + double fOriginSource, double fOriginDetector, + double fDetSize, + const float *pfAngles); + +bool getFanParameters(const SFanProjection &proj, unsigned int iProjDets, float &fAngle, float &fOriginSource, float &fOriginDetector, float &fDetSize, float &fOffset); } -- cgit v1.2.3