summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-10-09 16:10:45 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-10-09 16:10:45 +0200
commitc7128284fdbbfa0d4a5cbc951b9cdeaf8f9b41e0 (patch)
treeaab59644f0ca597b6057c0473e2f2ab102fbb6cd
parentf7e01f5a3ca7780a29d1fbc3790e527c310cc7f8 (diff)
downloadastra-c7128284fdbbfa0d4a5cbc951b9cdeaf8f9b41e0.tar.gz
astra-c7128284fdbbfa0d4a5cbc951b9cdeaf8f9b41e0.tar.bz2
astra-c7128284fdbbfa0d4a5cbc951b9cdeaf8f9b41e0.tar.xz
astra-c7128284fdbbfa0d4a5cbc951b9cdeaf8f9b41e0.zip
Call check() function after initializing CUDA_FBP
This would cause crashes when specifying invalid data.
-rw-r--r--src/CudaFilteredBackProjectionAlgorithm.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp
index aac96d6..6353c46 100644
--- a/src/CudaFilteredBackProjectionAlgorithm.cpp
+++ b/src/CudaFilteredBackProjectionAlgorithm.cpp
@@ -189,9 +189,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg)
m_pFBP = new AstraFBP;
m_bAstraFBPInit = false;
- // success
- m_bIsInitialized = true;
- return m_bIsInitialized;
+ return check();
}
bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D * _pSinogram, CFloat32VolumeData2D * _pReconstruction, E_FBPFILTER _eFilter, const float * _pfFilter /* = NULL */, int _iFilterWidth /* = 0 */, int _iGPUIndex /* = 0 */, float _fFilterParameter /* = -1.0f */)
@@ -241,7 +239,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D *
m_fFilterParameter = _fFilterParameter;
- return m_bIsInitialized;
+ return check();
}
void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */)
@@ -361,7 +359,7 @@ bool CCudaFilteredBackProjectionAlgorithm::check()
ASTRA_CONFIG_CHECK(m_pReconstruction->isInitialized(), "FBP_CUDA", "Reconstruction Data Object Not Initialized.");
// check gpu index
- ASTRA_CONFIG_CHECK(m_iGPUIndex >= -1, "FBP_CUDA", "GPUIndex must be a non-negative integer.");
+ ASTRA_CONFIG_CHECK(m_iGPUIndex >= -1, "FBP_CUDA", "GPUIndex must be a non-negative integer or -1.");
// check pixel supersampling
ASTRA_CONFIG_CHECK(m_iPixelSuperSampling >= 0, "FBP_CUDA", "PixelSuperSampling must be a non-negative integer.");