summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--matlab/mex/astra_mex_data2d_c.cpp4
-rw-r--r--matlab/mex/astra_mex_matrix_c.cpp2
-rw-r--r--matlab/tools/opTomo.m2
-rw-r--r--src/CudaFilteredBackProjectionAlgorithm.cpp8
-rw-r--r--src/Float32ProjectionData3D.cpp36
-rw-r--r--src/ReconstructionAlgorithm3D.cpp1
6 files changed, 29 insertions, 24 deletions
diff --git a/matlab/mex/astra_mex_data2d_c.cpp b/matlab/mex/astra_mex_data2d_c.cpp
index 909d229..935e476 100644
--- a/matlab/mex/astra_mex_data2d_c.cpp
+++ b/matlab/mex/astra_mex_data2d_c.cpp
@@ -222,7 +222,7 @@ void astra_mex_data2d_create(int& nlhs, mxArray* plhs[], int& nrhs, const mxArra
// logical data
if (mxIsLogical(prhs[3])) {
- bool* pbMatlabData = mxGetLogicals(prhs[3]);
+ mxLogical* pbMatlabData = mxGetLogicals(prhs[3]);
int i = 0;
int col, row;
for (col = 0; col < dims[1]; ++col) {
@@ -322,7 +322,7 @@ void astra_mex_data2d_store(int nlhs, mxArray* plhs[], int nrhs, const mxArray*
// logical data
if (mxIsLogical(prhs[2])) {
- bool* pbMatlabData = mxGetLogicals(prhs[2]);
+ mxLogical* pbMatlabData = mxGetLogicals(prhs[2]);
int i = 0;
int col, row;
for (col = 0; col < dims[1]; ++col) {
diff --git a/matlab/mex/astra_mex_matrix_c.cpp b/matlab/mex/astra_mex_matrix_c.cpp
index aa31383..e07ddb6 100644
--- a/matlab/mex/astra_mex_matrix_c.cpp
+++ b/matlab/mex/astra_mex_matrix_c.cpp
@@ -112,7 +112,7 @@ static bool matlab_to_astra(const mxArray* _rhs, CSparseMatrix* _pMatrix)
mwIndex *colStarts = mxGetJc(_rhs);
mwIndex *rowIndices = mxGetIr(_rhs);
double *floatValues = 0;
- bool *boolValues = 0;
+ mxLogical *boolValues = 0;
bool bLogical = mxIsLogical(_rhs);
if (bLogical)
boolValues = mxGetLogicals(_rhs);
diff --git a/matlab/tools/opTomo.m b/matlab/tools/opTomo.m
index 14128d2..71dfb1e 100644
--- a/matlab/tools/opTomo.m
+++ b/matlab/tools/opTomo.m
@@ -248,6 +248,7 @@ classdef opTomo < opSpot
% cleanup
astra_mex_data3d('delete', vol_id);
astra_mex_data3d('delete', sino_id);
+ astra_mex_algorithm('delete', alg_id);
else
% X is passed as a vector, reshape it into projection data
x = reshape(x, op.proj_size);
@@ -272,6 +273,7 @@ classdef opTomo < opSpot
% cleanup
astra_mex_data3d('delete', vol_id);
astra_mex_data3d('delete', sino_id);
+ astra_mex_algorithm('delete', alg_id);
end
end % opTomo_intrnl3D
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.");
diff --git a/src/Float32ProjectionData3D.cpp b/src/Float32ProjectionData3D.cpp
index 2bd0447..680ad55 100644
--- a/src/Float32ProjectionData3D.cpp
+++ b/src/Float32ProjectionData3D.cpp
@@ -53,13 +53,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32Pro
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
#ifdef _DEBUG
CProjectionGeometry3D * pDataGeometry = _data.getGeometry();
- int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount();
- int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount();
+ int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();
ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount());
- ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount);
+ ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);
#endif
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
@@ -67,7 +67,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32Pro
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex];
@@ -91,13 +91,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32Pro
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
#ifdef _DEBUG
CProjectionGeometry3D * pDataGeometry = _data.getGeometry();
- int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount();
- int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount();
+ int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();
ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount());
- ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount);
+ ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);
#endif
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
@@ -105,7 +105,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32Pro
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex];
@@ -129,13 +129,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32Pro
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
#ifdef _DEBUG
CProjectionGeometry3D * pDataGeometry = _data.getGeometry();
- int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount();
- int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount();
+ int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();
ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount());
- ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount);
+ ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);
#endif
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
@@ -143,7 +143,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32Pro
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex];
@@ -167,12 +167,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
@@ -194,12 +195,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator/=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
@@ -221,12 +223,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
@@ -248,12 +251,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
diff --git a/src/ReconstructionAlgorithm3D.cpp b/src/ReconstructionAlgorithm3D.cpp
index f975ace..13d4b07 100644
--- a/src/ReconstructionAlgorithm3D.cpp
+++ b/src/ReconstructionAlgorithm3D.cpp
@@ -147,6 +147,7 @@ bool CReconstructionAlgorithm3D::initialize(const Config& _cfg)
id = boost::lexical_cast<int>(_cfg.self.getOption("SinogramMaskId"));
m_pSinogramMask = dynamic_cast<CFloat32ProjectionData3D*>(CData3DManager::getSingleton().get(id));
}
+ CC.markOptionParsed("SinogramMaskId");
// Constraints - NEW
if (_cfg.self.hasOption("MinConstraint")) {