summaryrefslogtreecommitdiffstats
path: root/include/astra/GeometryUtil2D.h
diff options
context:
space:
mode:
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);
}