summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--astra_vc09.sln22
-rw-r--r--astra_vc11.sln22
-rw-r--r--build/linux/Makefile.in3
-rw-r--r--build/msvc/gen.py15
-rwxr-xr-xmatlab/mex/astra_mex_direct_c.cpp348
-rw-r--r--matlab/mex/astra_mex_direct_vc09.vcproj612
-rw-r--r--matlab/mex/astra_mex_direct_vc11.vcxproj306
-rw-r--r--matlab/tools/astra_mex_direct.m24
-rw-r--r--src/CudaFilteredBackProjectionAlgorithm.cpp8
-rw-r--r--src/CudaReconstructionAlgorithm2D.cpp16
-rw-r--r--src/Float32ProjectionData3D.cpp36
-rw-r--r--src/Logging.cpp60
12 files changed, 1428 insertions, 44 deletions
diff --git a/astra_vc09.sln b/astra_vc09.sln
index 9b93a0f..371e9b1 100644
--- a/astra_vc09.sln
+++ b/astra_vc09.sln
@@ -48,6 +48,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_log", "matlab\mex
{12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_direct", "matlab\mex\astra_mex_direct_vc09.vcproj", "{85FE09A6-FA49-4314-A2B1-59D77C7442A8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_CUDA|Win32 = Debug_CUDA|Win32
@@ -204,6 +209,22 @@ Global
{CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|Win32.Build.0 = Release|Win32
{CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|x64.ActiveCfg = Release|x64
{CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|x64.Build.0 = Release|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug|Win32.Build.0 = Debug|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug|x64.ActiveCfg = Debug|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Debug|x64.Build.0 = Debug|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release_CUDA|x64.Build.0 = Release_CUDA|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release|Win32.ActiveCfg = Release|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release|Win32.Build.0 = Release|Win32
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release|x64.ActiveCfg = Release|x64
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -217,5 +238,6 @@ Global
{4DD6056F-8EEE-4C9A-B2A9-923F01A32E97} = {33EF0AC5-B475-40BF-BAE5-67075B204D10}
{F94CCD79-AA11-42DF-AC8A-6C9D2238A883} = {33EF0AC5-B475-40BF-BAE5-67075B204D10}
{CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8} = {33EF0AC5-B475-40BF-BAE5-67075B204D10}
+ {85FE09A6-FA49-4314-A2B1-59D77C7442A8} = {33EF0AC5-B475-40BF-BAE5-67075B204D10}
EndGlobalSection
EndGlobal
diff --git a/astra_vc11.sln b/astra_vc11.sln
index 2832eab..92fb584 100644
--- a/astra_vc11.sln
+++ b/astra_vc11.sln
@@ -48,6 +48,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_log", "matlab\mex
{BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_direct", "matlab\mex\astra_mex_direct_vc11.vcxproj", "{0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_CUDA|Win32 = Debug_CUDA|Win32
@@ -204,6 +209,22 @@ Global
{03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E}.Release|Win32.Build.0 = Release|Win32
{03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E}.Release|x64.ActiveCfg = Release|x64
{03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E}.Release|x64.Build.0 = Release|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug|Win32.Build.0 = Debug|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug|x64.ActiveCfg = Debug|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Debug|x64.Build.0 = Debug|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release_CUDA|x64.Build.0 = Release_CUDA|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release|Win32.ActiveCfg = Release|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release|Win32.Build.0 = Release|Win32
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release|x64.ActiveCfg = Release|x64
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -217,5 +238,6 @@ Global
{4DD6056F-8EEE-4C9A-B2A9-923F01A32E97} = {5E99A109-374E-4102-BE9B-99BA1FA8AA30}
{F94CCD79-AA11-42DF-AC8A-6C9D2238A883} = {5E99A109-374E-4102-BE9B-99BA1FA8AA30}
{03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E} = {5E99A109-374E-4102-BE9B-99BA1FA8AA30}
+ {0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7} = {5E99A109-374E-4102-BE9B-99BA1FA8AA30}
EndGlobalSection
EndGlobal
diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in
index 2d862f2..abbebe2 100644
--- a/build/linux/Makefile.in
+++ b/build/linux/Makefile.in
@@ -232,7 +232,8 @@ MATLAB_MEX=\
matlab/mex/astra_mex_projector_c.$(MEXSUFFIX) \
matlab/mex/astra_mex_projector3d_c.$(MEXSUFFIX) \
matlab/mex/astra_mex_log_c.$(MEXSUFFIX) \
- matlab/mex/astra_mex_data3d_c.$(MEXSUFFIX)
+ matlab/mex/astra_mex_data3d_c.$(MEXSUFFIX) \
+ matlab/mex/astra_mex_direct_c.$(MEXSUFFIX)
OBJECT_DIRS = src/ tests/ cuda/2d/ cuda/3d/ matlab/mex/ ./
diff --git a/build/msvc/gen.py b/build/msvc/gen.py
index aeca3b0..a9bc494 100644
--- a/build/msvc/gen.py
+++ b/build/msvc/gen.py
@@ -24,6 +24,7 @@ P4 = create_mex_project("astra_mex_matrix", "9D041710-2119-4230-BCF2-5FBE753FDE4
P5 = create_mex_project("astra_mex_projector", "4DD6056F-8EEE-4C9A-B2A9-923F01A32E97", "4DD6056F-8EEE-4C9A-B2A9-923F01A32E97")
P6 = create_mex_project("astra_mex_projector3d", "F94CCD79-AA11-42DF-AC8A-6C9D2238A883", "F94CCD79-AA11-42DF-AC8A-6C9D2238A883")
P7 = create_mex_project("astra_mex_log", "03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E", "CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8")
+P8 = create_mex_project("astra_mex_direct", "0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7", "85FE09A6-FA49-4314-A2B1-59D77C7442A8")
F_astra_mex = { "type": siguid,
"name": "astra_mex",
@@ -31,7 +32,7 @@ F_astra_mex = { "type": siguid,
"file09": "astra_mex",
"uuid11": "5E99A109-374E-4102-BE9B-99BA1FA8AA30",
"uuid09": "33EF0AC5-B475-40BF-BAE5-67075B204D10",
- "entries": [ P0, P1, P2, P3, P4, P5, P6, P7 ] }
+ "entries": [ P0, P1, P2, P3, P4, P5, P6, P7, P8 ] }
P0["files"] = [
@@ -98,6 +99,14 @@ P7["files"] = [
"mexInitFunctions.cpp",
"mexInitFunctions.h",
]
+P8["files"] = [
+"astra_mex_direct_c.cpp",
+"mexHelpFunctions.cpp",
+"mexHelpFunctions.h",
+"mexInitFunctions.cpp",
+"mexInitFunctions.h",
+]
+
@@ -407,7 +416,7 @@ for f in P_astra["filters"]:
P_astra["files"].extend(P_astra["filters"][f][1:])
P_astra["files"].sort()
-projects = [ P_astra, F_astra_mex, P0, P1, P2, P3, P4, P5, P6, P7 ]
+projects = [ P_astra, F_astra_mex, P0, P1, P2, P3, P4, P5, P6, P7, P8 ]
bom = "\xef\xbb\xbf"
@@ -1111,6 +1120,7 @@ if sys.argv[1] in ["vc11", "all"]:
write_mex_project11(P5)
write_mex_project11(P6)
write_mex_project11(P7)
+ write_mex_project11(P8)
if sys.argv[1] in ["vc09", "all"]:
# HACK
@@ -1126,3 +1136,4 @@ if sys.argv[1] in ["vc09", "all"]:
write_mex_project09(P5)
write_mex_project09(P6)
write_mex_project09(P7)
+ write_mex_project09(P8)
diff --git a/matlab/mex/astra_mex_direct_c.cpp b/matlab/mex/astra_mex_direct_c.cpp
new file mode 100755
index 0000000..38b3f59
--- /dev/null
+++ b/matlab/mex/astra_mex_direct_c.cpp
@@ -0,0 +1,348 @@
+/*
+-----------------------------------------------------------------------
+Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp
+ 2014-2015, CWI, Amsterdam
+
+Contact: astra@uantwerpen.be
+Website: http://sf.net/projects/astra-toolbox
+
+This file is part of the ASTRA Toolbox.
+
+
+The ASTRA Toolbox is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+The ASTRA Toolbox is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
+
+-----------------------------------------------------------------------
+$Id$
+*/
+
+/** \file astra_mex_direct_c.cpp
+ *
+ * \brief Utility functions for low-overhead FP and BP calls.
+ */
+#include <mex.h>
+#include "mexHelpFunctions.h"
+#include "mexCopyDataHelpFunctions.h"
+#include "mexDataManagerHelpFunctions.h"
+
+#include <list>
+
+#include "astra/Globals.h"
+
+#include "astra/AstraObjectManager.h"
+
+#include "astra/Float32ProjectionData2D.h"
+#include "astra/Float32VolumeData2D.h"
+#include "astra/CudaProjector3D.h"
+#include "astra/Projector3D.h"
+#include "astra/Float32ProjectionData3DMemory.h"
+#include "astra/Float32VolumeData3DMemory.h"
+
+#include "astra/CudaForwardProjectionAlgorithm3D.h"
+
+#include "astra/CudaBackProjectionAlgorithm3D.h"
+
+using namespace std;
+using namespace astra;
+
+#define USE_MATLAB_UNDOCUMENTED
+
+
+class CFloat32CustomMemory_simple : public astra::CFloat32CustomMemory {
+public:
+ CFloat32CustomMemory_simple(float *ptr) { m_fPtr = ptr; }
+ ~CFloat32CustomMemory_simple() { }
+};
+
+#ifdef ASTRA_CUDA
+
+//-----------------------------------------------------------------------------------------
+/**
+ * projection = astra_mex_direct_c('FP3D', projector_id, volume);
+ * Both 'projection' and 'volume' are Matlab arrays.
+ */
+void astra_mex_direct_fp3d(int& nlhs, mxArray* plhs[], int& nrhs, const mxArray* prhs[])
+{
+ // TODO: Add an optional way of specifying extra options
+
+ if (nrhs < 3) {
+ mexErrMsgTxt("Not enough arguments. Syntax: astra_mex_direct_c('FP3D', projector_id, data)");
+ return;
+ }
+
+ int iPid = (int)(mxGetScalar(prhs[1]));
+ astra::CProjector3D* pProjector;
+ pProjector = astra::CProjector3DManager::getSingleton().get(iPid);
+ if (!pProjector) {
+ mexErrMsgTxt("Projector not found.");
+ return;
+ }
+ if (!pProjector->isInitialized()) {
+ mexErrMsgTxt("Projector not initialized.");
+ return;
+ }
+ bool isCuda = false;
+ if (dynamic_cast<CCudaProjector3D*>(pProjector))
+ isCuda = true;
+ if (!isCuda) {
+ mexErrMsgTxt("Only CUDA projectors are currently supported.");
+ return;
+ }
+
+ astra::CVolumeGeometry3D* pVolGeom = pProjector->getVolumeGeometry();
+ astra::CProjectionGeometry3D* pProjGeom = pProjector->getProjectionGeometry();
+
+ const mxArray* const data = prhs[2];
+ if (!checkDataType(data)) {
+ mexErrMsgTxt("Data must be single or double.");
+ return;
+ }
+
+ if (!checkDataSize(data, pVolGeom)) {
+ mexErrMsgTxt("The dimensions of the data do not match those specified in the geometry.");
+ return;
+ }
+
+
+ // Allocate input data
+ astra::CFloat32VolumeData3DMemory* pInput;
+ if (mxIsSingle(data)) {
+ astra::CFloat32CustomMemory* m = new CFloat32CustomMemory_simple((float *)mxGetData(data));
+ pInput = new astra::CFloat32VolumeData3DMemory(pVolGeom, m);
+ } else {
+ pInput = new astra::CFloat32VolumeData3DMemory(pVolGeom);
+ copyMexToCFloat32Array(data, pInput->getData(), pInput->getSize());
+ }
+
+
+ // Allocate output data
+ // If the input is single, we also allocate single output.
+ // Otherwise, double.
+ astra::CFloat32ProjectionData3DMemory* pOutput;
+ mxArray *pOutputMx;
+ if (mxIsSingle(data)) {
+ mwSize dims[3];
+ dims[0] = pProjGeom->getDetectorColCount();
+ dims[1] = pProjGeom->getProjectionCount();
+ dims[2] = pProjGeom->getDetectorRowCount();
+
+ // Allocate uninitialized mxArray of size dims.
+ // (It will be zeroed by CudaForwardProjectionAlgorithm3D)
+ const mwSize zero_dims[2] = {0, 0};
+ pOutputMx = mxCreateNumericArray(2, zero_dims, mxSINGLE_CLASS, mxREAL);
+ mxSetDimensions(pOutputMx, dims, 3);
+ const mwSize num_elems = mxGetNumberOfElements(pOutputMx);
+ const mwSize elem_size = mxGetElementSize(pOutputMx);
+ mxSetData(pOutputMx, mxMalloc(elem_size * num_elems));
+
+ astra::CFloat32CustomMemory* m = new CFloat32CustomMemory_simple((float *)mxGetData(pOutputMx));
+ pOutput = new astra::CFloat32ProjectionData3DMemory(pProjGeom, m);
+ } else {
+ pOutput = new astra::CFloat32ProjectionData3DMemory(pProjGeom);
+ }
+
+ // Perform FP
+
+ astra::CCudaForwardProjectionAlgorithm3D* pAlg;
+ pAlg = new astra::CCudaForwardProjectionAlgorithm3D();
+ pAlg->initialize(pProjector, pOutput, pInput);
+
+ if (!pAlg->isInitialized()) {
+ mexErrMsgTxt("Error initializing algorithm.");
+ // TODO: Delete pOutputMx?
+ delete pAlg;
+ delete pInput;
+ delete pOutput;
+ return;
+ }
+
+ pAlg->run();
+
+ delete pAlg;
+
+
+ if (mxIsSingle(data)) {
+
+ } else {
+ pOutputMx = createEquivMexArray<mxDOUBLE_CLASS>(pOutput);
+ copyCFloat32ArrayToMex(pOutput->getData(), pOutputMx);
+ }
+ plhs[0] = pOutputMx;
+
+ delete pOutput;
+ delete pInput;
+}
+//-----------------------------------------------------------------------------------------
+/**
+ * projection = astra_mex_direct_c('BP3D', projector_id, volume);
+ * Both 'projection' and 'volume' are Matlab arrays.
+ */
+void astra_mex_direct_bp3d(int& nlhs, mxArray* plhs[], int& nrhs, const mxArray* prhs[])
+{
+ // TODO: Add an optional way of specifying extra options
+
+ if (nrhs < 3) {
+ mexErrMsgTxt("Not enough arguments. Syntax: astra_mex_direct_c('BP3D', projector_id, data)");
+ return;
+ }
+
+ int iPid = (int)(mxGetScalar(prhs[1]));
+ astra::CProjector3D* pProjector;
+ pProjector = astra::CProjector3DManager::getSingleton().get(iPid);
+ if (!pProjector) {
+ mexErrMsgTxt("Projector not found.");
+ return;
+ }
+ if (!pProjector->isInitialized()) {
+ mexErrMsgTxt("Projector not initialized.");
+ return;
+ }
+ bool isCuda = false;
+ if (dynamic_cast<CCudaProjector3D*>(pProjector))
+ isCuda = true;
+ if (!isCuda) {
+ mexErrMsgTxt("Only CUDA projectors are currently supported.");
+ return;
+ }
+
+ astra::CVolumeGeometry3D* pVolGeom = pProjector->getVolumeGeometry();
+ astra::CProjectionGeometry3D* pProjGeom = pProjector->getProjectionGeometry();
+
+ const mxArray* const data = prhs[2];
+ if (!checkDataType(data)) {
+ mexErrMsgTxt("Data must be single or double.");
+ return;
+ }
+
+ if (!checkDataSize(data, pProjGeom)) {
+ mexErrMsgTxt("The dimensions of the data do not match those specified in the geometry.");
+ return;
+ }
+
+
+ // Allocate input data
+ astra::CFloat32ProjectionData3DMemory* pInput;
+ if (mxIsSingle(data)) {
+ astra::CFloat32CustomMemory* m = new CFloat32CustomMemory_simple((float *)mxGetData(data));
+ pInput = new astra::CFloat32ProjectionData3DMemory(pProjGeom, m);
+ } else {
+ pInput = new astra::CFloat32ProjectionData3DMemory(pProjGeom);
+ copyMexToCFloat32Array(data, pInput->getData(), pInput->getSize());
+ }
+
+
+ // Allocate output data
+ // If the input is single, we also allocate single output.
+ // Otherwise, double.
+ astra::CFloat32VolumeData3DMemory* pOutput;
+ mxArray *pOutputMx;
+ if (mxIsSingle(data)) {
+ mwSize dims[3];
+ dims[0] = pVolGeom->getGridColCount();
+ dims[1] = pVolGeom->getGridRowCount();
+ dims[2] = pVolGeom->getGridSliceCount();
+
+ // Allocate uninitialized mxArray of size dims.
+ // (It will be zeroed by CudaBackProjectionAlgorithm3D)
+ const mwSize zero_dims[2] = {0, 0};
+ pOutputMx = mxCreateNumericArray(2, zero_dims, mxSINGLE_CLASS, mxREAL);
+ mxSetDimensions(pOutputMx, dims, 3);
+ const mwSize num_elems = mxGetNumberOfElements(pOutputMx);
+ const mwSize elem_size = mxGetElementSize(pOutputMx);
+ mxSetData(pOutputMx, mxMalloc(elem_size * num_elems));
+
+ astra::CFloat32CustomMemory* m = new CFloat32CustomMemory_simple((float *)mxGetData(pOutputMx));
+ pOutput = new astra::CFloat32VolumeData3DMemory(pVolGeom, m);
+ } else {
+ pOutput = new astra::CFloat32VolumeData3DMemory(pVolGeom);
+ }
+
+ // Perform BP
+
+ astra::CCudaBackProjectionAlgorithm3D* pAlg;
+ pAlg = new astra::CCudaBackProjectionAlgorithm3D();
+ pAlg->initialize(pProjector, pInput, pOutput);
+
+ if (!pAlg->isInitialized()) {
+ mexErrMsgTxt("Error initializing algorithm.");
+ // TODO: Delete pOutputMx?
+ delete pAlg;
+ delete pInput;
+ delete pOutput;
+ return;
+ }
+
+ pAlg->run();
+
+ delete pAlg;
+
+
+ if (mxIsSingle(data)) {
+
+ } else {
+ pOutputMx = createEquivMexArray<mxDOUBLE_CLASS>(pOutput);
+ copyCFloat32ArrayToMex(pOutput->getData(), pOutputMx);
+ }
+ plhs[0] = pOutputMx;
+
+ delete pOutput;
+ delete pInput;
+}
+
+#endif
+
+//-----------------------------------------------------------------------------------------
+
+static void printHelp()
+{
+ mexPrintf("Please specify a mode of operation.\n");
+ mexPrintf("Valid modes: FP3D, BP3D\n");
+}
+
+
+//-----------------------------------------------------------------------------------------
+/**
+ * ... = astra_mex_direct_c(mode,...);
+ */
+void mexFunction(int nlhs, mxArray* plhs[],
+ int nrhs, const mxArray* prhs[])
+{
+
+ // INPUT: Mode
+ string sMode;
+ if (1 <= nrhs) {
+ sMode = mexToString(prhs[0]);
+ } else {
+ printHelp();
+ return;
+ }
+
+#ifndef ASTRA_CUDA
+ mexErrMsgTxt("Only CUDA projectors are currently supported.");
+ return;
+#else
+
+ // 3D data
+ if (sMode == "FP3D") {
+ astra_mex_direct_fp3d(nlhs, plhs, nrhs, prhs);
+ } else if (sMode == "BP3D") {
+ astra_mex_direct_bp3d(nlhs, plhs, nrhs, prhs);
+ } else {
+ printHelp();
+ }
+#endif
+
+ return;
+}
+
+
diff --git a/matlab/mex/astra_mex_direct_vc09.vcproj b/matlab/mex/astra_mex_direct_vc09.vcproj
new file mode 100644
index 0000000..04b49ac
--- /dev/null
+++ b/matlab/mex/astra_mex_direct_vc09.vcproj
@@ -0,0 +1,612 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="astra_mex_direct"
+ ProjectGUID="{85FE09A6-FA49-4314-A2B1-59D77C7442A8}"
+ RootNamespace="astraMatlab"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug_CUDA|Win32"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;&quot;$(CUDA_INC_PATH)&quot;;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="ASTRA_CUDA;__SSE2__"
+ Optimization="0"
+ RuntimeLibrary="3"
+ EnableEnhancedInstructionSet="2"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="AstraCuda32D.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw32"
+ AdditionalLibraryDirectories="..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="true"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_CUDA|x64"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;&quot;$(CUDA_INC_PATH)&quot;;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="ASTRA_CUDA;__SSE2__"
+ Optimization="0"
+ RuntimeLibrary="3"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="AstraCuda64D.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw64"
+ AdditionalLibraryDirectories="..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="__SSE2__"
+ Optimization="0"
+ RuntimeLibrary="3"
+ EnableEnhancedInstructionSet="2"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Astra32D.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw32"
+ AdditionalLibraryDirectories="..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="true"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="__SSE2__"
+ Optimization="0"
+ RuntimeLibrary="3"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Astra64D.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw64"
+ AdditionalLibraryDirectories="..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CUDA|Win32"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;&quot;$(CUDA_INC_PATH)&quot;;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="ASTRA_CUDA;__SSE2__"
+ Optimization="2"
+ RuntimeLibrary="2"
+ EnableEnhancedInstructionSet="2"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="AstraCuda32.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw32"
+ AdditionalLibraryDirectories="..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="false"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CUDA|x64"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;&quot;$(CUDA_INC_PATH)&quot;;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="ASTRA_CUDA;__SSE2__"
+ Optimization="2"
+ RuntimeLibrary="2"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="AstraCuda64.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw64"
+ AdditionalLibraryDirectories="..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="false"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="__SSE2__"
+ Optimization="2"
+ RuntimeLibrary="2"
+ EnableEnhancedInstructionSet="2"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Astra32.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw32"
+ AdditionalLibraryDirectories="..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="false"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)\obj\$(ProjectName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include"
+ PreprocessorDefinitions="__SSE2__"
+ Optimization="2"
+ RuntimeLibrary="2"
+ OpenMP="true"
+ AdditionalOptions="/MP"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Astra64.lib libmex.lib libmx.lib libut.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_c.mexw64"
+ AdditionalLibraryDirectories="..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64"
+ ModuleDefinitionFile="mex.def"
+ GenerateDebugInformation="false"
+ TargetMachine="17"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\astra_mex_direct_c.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\mexHelpFunctions.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\mexHelpFunctions.h"
+ >
+ </File>
+ <File
+ RelativePath=".\mexInitFunctions.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\mexInitFunctions.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/matlab/mex/astra_mex_direct_vc11.vcxproj b/matlab/mex/astra_mex_direct_vc11.vcxproj
new file mode 100644
index 0000000..15c3c06
--- /dev/null
+++ b/matlab/mex/astra_mex_direct_vc11.vcxproj
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_CUDA|Win32">
+ <Configuration>Debug_CUDA</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_CUDA|x64">
+ <Configuration>Debug_CUDA</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_CUDA|Win32">
+ <Configuration>Release_CUDA</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_CUDA|x64">
+ <Configuration>Release_CUDA</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>astra_mex_direct</ProjectName>
+ <ProjectGuid>{0F68F4E2-BE1B-4A9A-B101-AECF4C069CC7}</ProjectGuid>
+ <RootNamespace>astraMatlab</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|Win32'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw32</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|x64'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw64</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw32</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw64</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|Win32'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw32</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|x64'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw64</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw32</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <TargetName>$(ProjectName)_c</TargetName>
+ <TargetExt>.mexw64</TargetExt>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw32</OutputFile>
+ <AdditionalDependencies>AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_CUDA|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw64</OutputFile>
+ <AdditionalDependencies>AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw32</OutputFile>
+ <AdditionalDependencies>Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw64</OutputFile>
+ <AdditionalDependencies>Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <Optimization>MaxSpeed</Optimization>
+ <PreprocessorDefinitions>ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw32</OutputFile>
+ <AdditionalDependencies>AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_CUDA|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <Optimization>MaxSpeed</Optimization>
+ <PreprocessorDefinitions>ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw64</OutputFile>
+ <AdditionalDependencies>AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <Optimization>MaxSpeed</Optimization>
+ <PreprocessorDefinitions>__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw32</OutputFile>
+ <AdditionalDependencies>Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <AdditionalIncludeDirectories>$(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <OpenMPSupport>true</OpenMPSupport>
+ <Optimization>MaxSpeed</Optimization>
+ <PreprocessorDefinitions>__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(ProjectName)_c.mexw64</OutputFile>
+ <AdditionalDependencies>Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>mex.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="astra_mex_direct_c.cpp" />
+ <ClCompile Include="mexHelpFunctions.cpp" />
+ <ClCompile Include="mexInitFunctions.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="mexHelpFunctions.h" />
+ <ClInclude Include="mexInitFunctions.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/matlab/tools/astra_mex_direct.m b/matlab/tools/astra_mex_direct.m
new file mode 100644
index 0000000..58c4fd2
--- /dev/null
+++ b/matlab/tools/astra_mex_direct.m
@@ -0,0 +1,24 @@
+function [varargout] = astra_mex_direct(varargin)
+%------------------------------------------------------------------------
+% Reference page in Help browser
+% <a href="matlab:docsearch('astra_mex_direct' )">astra_mex_data3d</a>.
+%------------------------------------------------------------------------
+%------------------------------------------------------------------------
+% This file is part of the ASTRA Toolbox
+%
+% Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp
+% 2014-2015, CWI, Amsterdam
+% License: Open Source under GPLv3
+% Contact: astra@uantwerpen.be
+% Website: http://sf.net/projects/astra-toolbox
+%------------------------------------------------------------------------
+% $Id$
+if nargout == 0
+ astra_mex_direct_c(varargin{:});
+ if exist('ans','var')
+ varargout{1} = ans;
+ end
+else
+ varargout = cell(1,nargout);
+ [varargout{:}] = astra_mex_direct_c(varargin{:});
+end
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp
index 8c0659d..bcd70c4 100644
--- a/src/CudaFilteredBackProjectionAlgorithm.cpp
+++ b/src/CudaFilteredBackProjectionAlgorithm.cpp
@@ -204,9 +204,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 */)
@@ -256,7 +254,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D *
m_fFilterParameter = _fFilterParameter;
- return m_bIsInitialized;
+ return check();
}
void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */)
@@ -376,7 +374,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/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp
index 2d023b7..71dddf7 100644
--- a/src/CudaReconstructionAlgorithm2D.cpp
+++ b/src/CudaReconstructionAlgorithm2D.cpp
@@ -361,10 +361,18 @@ void CCudaReconstructionAlgorithm2D::run(int _iNrIterations)
ASTRA_ASSERT(ok);
- if (m_bUseMinConstraint)
- ok &= m_pAlgo->setMinConstraint(m_fMinValue);
- if (m_bUseMaxConstraint)
- ok &= m_pAlgo->setMaxConstraint(m_fMaxValue);
+ if (m_bUseMinConstraint) {
+ bool ret = m_pAlgo->setMinConstraint(m_fMinValue);
+ if (!ret) {
+ ASTRA_WARN("This algorithm ignores MinConstraint");
+ }
+ }
+ if (m_bUseMaxConstraint) {
+ bool ret= m_pAlgo->setMaxConstraint(m_fMaxValue);
+ if (!ret) {
+ ASTRA_WARN("This algorithm ignores MaxConstraint");
+ }
+ }
ok &= m_pAlgo->iterate(_iNrIterations);
ASTRA_ASSERT(ok);
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/Logging.cpp b/src/Logging.cpp
index 8290ca0..cd7e3f0 100644
--- a/src/Logging.cpp
+++ b/src/Logging.cpp
@@ -70,37 +70,65 @@ void CLogger::disable()
void CLogger::debug(const char *sfile, int sline, const char *fmt, ...)
{
_assureIsInitialized();
- va_list ap;
- va_start(ap, fmt);
- if(m_bEnabledScreen) clog_debug(sfile,sline,0,fmt,ap);
- if(m_bEnabledFile && m_bFileProvided) clog_debug(sfile,sline,1,fmt,ap);
+ va_list ap, apf;
+ if(m_bEnabledScreen){
+ va_start(ap, fmt);
+ clog_debug(sfile,sline,0,fmt,ap);
+ va_end(ap);
+ }
+ if(m_bEnabledFile && m_bFileProvided){
+ va_start(apf, fmt);
+ clog_debug(sfile,sline,1,fmt,apf);
+ va_end(apf);
+ }
}
void CLogger::info(const char *sfile, int sline, const char *fmt, ...)
{
_assureIsInitialized();
- va_list ap;
- va_start(ap, fmt);
- if(m_bEnabledScreen) clog_info(sfile,sline,0,fmt,ap);
- if(m_bEnabledFile && m_bFileProvided) clog_info(sfile,sline,1,fmt,ap);
+ va_list ap, apf;
+ if(m_bEnabledScreen){
+ va_start(ap, fmt);
+ clog_info(sfile,sline,0,fmt,ap);
+ va_end(ap);
+ }
+ if(m_bEnabledFile && m_bFileProvided){
+ va_start(apf, fmt);
+ clog_info(sfile,sline,1,fmt,apf);
+ va_end(apf);
+ }
}
void CLogger::warn(const char *sfile, int sline, const char *fmt, ...)
{
_assureIsInitialized();
- va_list ap;
- va_start(ap, fmt);
- if(m_bEnabledScreen) clog_warn(sfile,sline,0,fmt,ap);
- if(m_bEnabledFile && m_bFileProvided) clog_warn(sfile,sline,1,fmt,ap);
+ va_list ap, apf;
+ if(m_bEnabledScreen){
+ va_start(ap, fmt);
+ clog_warn(sfile,sline,0,fmt,ap);
+ va_end(ap);
+ }
+ if(m_bEnabledFile && m_bFileProvided){
+ va_start(apf, fmt);
+ clog_warn(sfile,sline,1,fmt,apf);
+ va_end(apf);
+ }
}
void CLogger::error(const char *sfile, int sline, const char *fmt, ...)
{
_assureIsInitialized();
- va_list ap;
- va_start(ap, fmt);
- if(m_bEnabledScreen) clog_error(sfile,sline,0,fmt,ap);
- if(m_bEnabledFile && m_bFileProvided) clog_error(sfile,sline,1,fmt,ap);
+ va_list ap, apf;
+ if(m_bEnabledScreen){
+ va_start(ap, fmt);
+ clog_error(sfile,sline,0,fmt,ap);
+ va_end(ap);
+ }
+ if(m_bEnabledFile && m_bFileProvided){
+ va_start(apf, fmt);
+ clog_error(sfile,sline,1,fmt,apf);
+ va_end(apf);
+ }
}
void CLogger::_setLevel(int id, log_level m_eLevel)