summaryrefslogtreecommitdiffstats
path: root/include/astra/GeometryUtil2D.h
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 /include/astra/GeometryUtil2D.h
parentb2611a03577c285ddf48edab0d05dafa09ab362c (diff)
downloadastra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.gz
astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.bz2
astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.tar.xz
astra-b1ffc11d930c19bd73af9837a08bc8dde9fe8e72.zip
Add CUDA parvec support
Diffstat (limited to 'include/astra/GeometryUtil2D.h')
-rw-r--r--include/astra/GeometryUtil2D.h73
1 files changed, 59 insertions, 14 deletions
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);
}