summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-12-07 16:41:40 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-12-23 16:57:45 +0100
commit8220a50be6bcbddf179bb855b2f7d36436fcca6b (patch)
tree81986f22c74784ff02c88f1d071fae32186e5f89 /include
parentcbc2e1079cf40c6f0c08d2f9c54f7b41b678e567 (diff)
downloadastra-8220a50be6bcbddf179bb855b2f7d36436fcca6b.tar.gz
astra-8220a50be6bcbddf179bb855b2f7d36436fcca6b.tar.bz2
astra-8220a50be6bcbddf179bb855b2f7d36436fcca6b.tar.xz
astra-8220a50be6bcbddf179bb855b2f7d36436fcca6b.zip
More gracefully handle config errors in geometries
Diffstat (limited to 'include')
-rw-r--r--include/astra/ConeVecProjectionGeometry3D.h2
-rw-r--r--include/astra/FanFlatVecProjectionGeometry2D.h2
-rw-r--r--include/astra/ParallelVecProjectionGeometry2D.h2
-rw-r--r--include/astra/ParallelVecProjectionGeometry3D.h3
-rw-r--r--include/astra/ProjectionGeometry2D.h3
-rw-r--r--include/astra/ProjectionGeometry3D.h3
-rw-r--r--include/astra/Utilities.h4
7 files changed, 19 insertions, 0 deletions
diff --git a/include/astra/ConeVecProjectionGeometry3D.h b/include/astra/ConeVecProjectionGeometry3D.h
index 0a9813c..252e32c 100644
--- a/include/astra/ConeVecProjectionGeometry3D.h
+++ b/include/astra/ConeVecProjectionGeometry3D.h
@@ -157,6 +157,8 @@ public:
virtual void backprojectPointZ(int iAngleIndex, double fU, double fV,
double fZ, double &fX, double &fY) const;
+protected:
+ virtual bool initializeAngles(const Config& _cfg);
};
} // namespace astra
diff --git a/include/astra/FanFlatVecProjectionGeometry2D.h b/include/astra/FanFlatVecProjectionGeometry2D.h
index cafeda8..fe4253f 100644
--- a/include/astra/FanFlatVecProjectionGeometry2D.h
+++ b/include/astra/FanFlatVecProjectionGeometry2D.h
@@ -157,6 +157,8 @@ public:
virtual CVector3D getProjectionDirection(int _iProjectionIndex, int _iDetectorIndex);
const SFanProjection* getProjectionVectors() const { return m_pProjectionAngles; }
+protected:
+ virtual bool initializeAngles(const Config& _cfg);
};
diff --git a/include/astra/ParallelVecProjectionGeometry2D.h b/include/astra/ParallelVecProjectionGeometry2D.h
index 805a142..e99fb35 100644
--- a/include/astra/ParallelVecProjectionGeometry2D.h
+++ b/include/astra/ParallelVecProjectionGeometry2D.h
@@ -155,6 +155,8 @@ public:
const SParProjection* getProjectionVectors() const { return m_pProjectionAngles; }
+protected:
+ virtual bool initializeAngles(const Config& _cfg);
};
} // namespace astra
diff --git a/include/astra/ParallelVecProjectionGeometry3D.h b/include/astra/ParallelVecProjectionGeometry3D.h
index 08e7af9..04418a0 100644
--- a/include/astra/ParallelVecProjectionGeometry3D.h
+++ b/include/astra/ParallelVecProjectionGeometry3D.h
@@ -157,6 +157,9 @@ public:
double fY, double &fX, double &fZ) const;
virtual void backprojectPointZ(int iAngleIndex, double fU, double fV,
double fZ, double &fX, double &fY) const;
+
+protected:
+ virtual bool initializeAngles(const Config& _cfg);
};
} // namespace astra
diff --git a/include/astra/ProjectionGeometry2D.h b/include/astra/ProjectionGeometry2D.h
index 65b3006..66cc8ad 100644
--- a/include/astra/ProjectionGeometry2D.h
+++ b/include/astra/ProjectionGeometry2D.h
@@ -254,6 +254,9 @@ public:
//< For Config unused argument checking
ConfigCheckData* configCheckData;
friend class ConfigStackCheck<CProjectionGeometry2D>;
+
+protected:
+ virtual bool initializeAngles(const Config& _cfg);
};
diff --git a/include/astra/ProjectionGeometry3D.h b/include/astra/ProjectionGeometry3D.h
index 092402d..11545ea 100644
--- a/include/astra/ProjectionGeometry3D.h
+++ b/include/astra/ProjectionGeometry3D.h
@@ -351,6 +351,9 @@ public:
//< For Config unused argument checking
ConfigCheckData* configCheckData;
friend class ConfigStackCheck<CProjectionGeometry3D>;
+
+protected:
+ virtual bool initializeAngles(const Config& _cfg);
};
diff --git a/include/astra/Utilities.h b/include/astra/Utilities.h
index 7ed8ecd..e830c5d 100644
--- a/include/astra/Utilities.h
+++ b/include/astra/Utilities.h
@@ -51,6 +51,10 @@ public:
//< Throw exception on failure.
_AstraExport int stringToInt(const std::string& s);
+//< Parse string as int.
+//< Return fallback on failure.
+_AstraExport int stringToInt(const std::string& s, int fallback);
+
//< Parse string as float.
//< Throw exception on failure.
_AstraExport float stringToFloat(const std::string& s);