summaryrefslogtreecommitdiffstats
path: root/include/astra
diff options
context:
space:
mode:
Diffstat (limited to 'include/astra')
-rw-r--r--include/astra/Algorithm.h15
-rw-r--r--include/astra/AsyncAlgorithm.h4
-rw-r--r--include/astra/CudaCglsAlgorithm3D.h3
-rw-r--r--include/astra/CudaReconstructionAlgorithm2D.h2
-rw-r--r--include/astra/CudaSirtAlgorithm3D.h3
-rw-r--r--include/astra/Globals.h19
-rw-r--r--include/astra/cuda/2d/algo.h4
-rw-r--r--include/astra/cuda/3d/algo3d.h5
-rw-r--r--include/astra/cuda/3d/astra3d.h8
9 files changed, 19 insertions, 44 deletions
diff --git a/include/astra/Algorithm.h b/include/astra/Algorithm.h
index af9e41d..393baf0 100644
--- a/include/astra/Algorithm.h
+++ b/include/astra/Algorithm.h
@@ -93,26 +93,11 @@ public:
*/
virtual void setGPUIndex(int /*_iGPUIndex*/) { };
- /** Signal the algorithm it should abort soon.
- * This is intended to be called from a different thread
- * while the algorithm is running. There are no guarantees
- * on how soon the algorithm will abort. The state of the
- * algorithm object will be consistent (so it is safe to delete it
- * normally afterwards), but the algorithm's output is undefined.
- *
- * Note that specific algorithms may give guarantees on their
- * state after an abort. Check their documentation for details.
- */
- virtual void signalAbort() { m_bShouldAbort = true; }
-
protected:
//< Has this class been initialized?
bool m_bIsInitialized;
- //< If this is set, the algorithm should try to abort as soon as possible.
- volatile bool m_bShouldAbort;
-
private:
/**
* Private copy constructor to prevent CAlgorithms from being copied.
diff --git a/include/astra/AsyncAlgorithm.h b/include/astra/AsyncAlgorithm.h
index 0e43e67..6cb84bb 100644
--- a/include/astra/AsyncAlgorithm.h
+++ b/include/astra/AsyncAlgorithm.h
@@ -80,10 +80,6 @@ public:
*/
bool isDone() const { return m_bDone; }
- /** Signal abort to the wrapped algorithm.
- */
- void signalAbort();
-
protected:
//< Has this class been initialized?
bool m_bInitialized;
diff --git a/include/astra/CudaCglsAlgorithm3D.h b/include/astra/CudaCglsAlgorithm3D.h
index 6f35192..63f028a 100644
--- a/include/astra/CudaCglsAlgorithm3D.h
+++ b/include/astra/CudaCglsAlgorithm3D.h
@@ -141,9 +141,6 @@ public:
*/
void setGPUIndex(int _iGPUIndex) { m_iGPUIndex = _iGPUIndex; }
-
- virtual void signalAbort();
-
/** Get the norm of the residual image.
* Only a few algorithms support this method.
*
diff --git a/include/astra/CudaReconstructionAlgorithm2D.h b/include/astra/CudaReconstructionAlgorithm2D.h
index 197f984..56f3b25 100644
--- a/include/astra/CudaReconstructionAlgorithm2D.h
+++ b/include/astra/CudaReconstructionAlgorithm2D.h
@@ -122,8 +122,6 @@ public:
*/
virtual void run(int _iNrIterations = 0);
- virtual void signalAbort();
-
protected:
/** Check this object.
diff --git a/include/astra/CudaSirtAlgorithm3D.h b/include/astra/CudaSirtAlgorithm3D.h
index 9c041b9..dd3f749 100644
--- a/include/astra/CudaSirtAlgorithm3D.h
+++ b/include/astra/CudaSirtAlgorithm3D.h
@@ -155,9 +155,6 @@ public:
*/
void setGPUIndex(int _iGPUIndex) { m_iGPUIndex = _iGPUIndex; }
-
- virtual void signalAbort();
-
/** Get the norm of the residual image.
* Only a few algorithms support this method.
*
diff --git a/include/astra/Globals.h b/include/astra/Globals.h
index 993e443..a353940 100644
--- a/include/astra/Globals.h
+++ b/include/astra/Globals.h
@@ -150,6 +150,25 @@ namespace astra {
};
}
+//----------------------------------------------------------------------------------------
+// functions for internal use
+
+namespace astra {
+
+/** Specify a function) to be called by shouldAbort() to check if an external
+ * abort signal has arrived, or NULL to disable. Intended to be used by the
+ * matlab/python interfaces to check if Ctrl-C has been pressed.
+ */
+void setShouldAbortHook(bool (*pShouldAbortHook)(void));
+
+/** Check if we should abort execution (due to an external signal).
+ */
+bool shouldAbort();
+}
+
+//----------------------------------------------------------------------------------------
+// functions for external use
+
namespace astra {
_AstraExport inline int getVersion() { return ASTRA_TOOLBOXVERSION; }
_AstraExport inline const char* getVersionString() { return ASTRA_TOOLBOXVERSION_STRING; }
diff --git a/include/astra/cuda/2d/algo.h b/include/astra/cuda/2d/algo.h
index 2ce929c..3fccdef 100644
--- a/include/astra/cuda/2d/algo.h
+++ b/include/astra/cuda/2d/algo.h
@@ -56,8 +56,6 @@ public:
bool setSuperSampling(int raysPerDet, int raysPerPixelDim);
- void signalAbort() { shouldAbort = true; }
-
virtual bool enableVolumeMask();
virtual bool enableSinogramMask();
@@ -137,8 +135,6 @@ protected:
SFanProjection* fanProjs;
float fOutputScale;
- volatile bool shouldAbort;
-
bool freeGPUMemory;
// Input/output
diff --git a/include/astra/cuda/3d/algo3d.h b/include/astra/cuda/3d/algo3d.h
index f5fd207..b6b1db7 100644
--- a/include/astra/cuda/3d/algo3d.h
+++ b/include/astra/cuda/3d/algo3d.h
@@ -41,8 +41,6 @@ public:
bool setConeGeometry(const SDimensions3D& dims, const SConeProjection* projs, const SProjectorParams3D& params);
bool setPar3DGeometry(const SDimensions3D& dims, const SPar3DProjection* projs, const SProjectorParams3D& params);
- void signalAbort() { shouldAbort = true; }
-
protected:
void reset();
@@ -59,9 +57,6 @@ protected:
SPar3DProjection* par3DProjs;
float fOutputScale;
-
- volatile bool shouldAbort;
-
};
diff --git a/include/astra/cuda/3d/astra3d.h b/include/astra/cuda/3d/astra3d.h
index 28a8f01..a97efd6 100644
--- a/include/astra/cuda/3d/astra3d.h
+++ b/include/astra/cuda/3d/astra3d.h
@@ -157,10 +157,6 @@ public:
// It can be called after iterate().
float computeDiffNorm();
- // Signal the algorithm that it should abort after the current iteration.
- // This is intended to be called from another thread.
- void signalAbort();
-
protected:
AstraSIRT3d_internal *pData;
};
@@ -274,10 +270,6 @@ public:
// It can be called after iterate().
float computeDiffNorm();
- // Signal the algorithm that it should abort after the current iteration.
- // This is intended to be called from another thread.
- void signalAbort();
-
protected:
AstraCGLS3d_internal *pData;
};