summaryrefslogtreecommitdiffstats
path: root/matlab
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-06-26 12:20:44 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-06-26 12:20:44 +0200
commit47b520d51fc4fc49db992b9117f6c0abfa8152b5 (patch)
tree8f494a765a3607afd1c9bac9c592f30536b950a1 /matlab
parent9f86a4c3f20ac8785f80288ec4cdefe79ed67e68 (diff)
parent62f3aa5792011792db866ce0841c8d164aa9a34d (diff)
downloadastra-47b520d51fc4fc49db992b9117f6c0abfa8152b5.tar.gz
astra-47b520d51fc4fc49db992b9117f6c0abfa8152b5.tar.bz2
astra-47b520d51fc4fc49db992b9117f6c0abfa8152b5.tar.xz
astra-47b520d51fc4fc49db992b9117f6c0abfa8152b5.zip
Merge branch 'master'
Diffstat (limited to 'matlab')
-rw-r--r--matlab/mex/astra_mex_c.cpp4
-rw-r--r--matlab/mex/astra_mex_projector3d_c.cpp8
-rw-r--r--matlab/mex/astra_mex_projector_c.cpp9
-rw-r--r--matlab/mex/mexHelpFunctions.cpp6
-rw-r--r--matlab/tools/astra_create_reconstruction_cuda.m2
5 files changed, 20 insertions, 9 deletions
diff --git a/matlab/mex/astra_mex_c.cpp b/matlab/mex/astra_mex_c.cpp
index 4a331f5..a9b9654 100644
--- a/matlab/mex/astra_mex_c.cpp
+++ b/matlab/mex/astra_mex_c.cpp
@@ -36,9 +36,9 @@ $Id$
#include "mexInitFunctions.h"
#include "astra/Globals.h"
-
+#ifdef ASTRA_CUDA
#include "../cuda/2d/darthelper.h"
-
+#endif
using namespace std;
using namespace astra;
diff --git a/matlab/mex/astra_mex_projector3d_c.cpp b/matlab/mex/astra_mex_projector3d_c.cpp
index c3b547f..e25802c 100644
--- a/matlab/mex/astra_mex_projector3d_c.cpp
+++ b/matlab/mex/astra_mex_projector3d_c.cpp
@@ -137,7 +137,9 @@ void astra_mex_projector3d_get_projection_geometry(int nlhs, mxArray* plhs[], in
// step3: get projection_geometry and turn it into a MATLAB struct
if (1 <= nlhs) {
- plhs[0] = configToStruct(pProjector->getProjectionGeometry()->getConfiguration());
+ Config *cfg = pProjector->getProjectionGeometry()->getConfiguration();
+ plhs[0] = configToStruct(cfg);
+ delete cfg;
}
}
@@ -163,7 +165,9 @@ void astra_mex_projector3d_get_volume_geometry(int nlhs, mxArray* plhs[], int nr
// step3: get projection_geometry and turn it into a MATLAB struct
if (1 <= nlhs) {
- plhs[0] = configToStruct(pProjector->getVolumeGeometry()->getConfiguration());
+ Config *cfg = pProjector->getVolumeGeometry()->getConfiguration();
+ plhs[0] = configToStruct(cfg);
+ delete cfg;
}
}
diff --git a/matlab/mex/astra_mex_projector_c.cpp b/matlab/mex/astra_mex_projector_c.cpp
index 204ba8e..bf701af 100644
--- a/matlab/mex/astra_mex_projector_c.cpp
+++ b/matlab/mex/astra_mex_projector_c.cpp
@@ -160,7 +160,9 @@ void astra_mex_projector_projection_geometry(int nlhs, mxArray* plhs[], int nrhs
// step3: get projection_geometry and turn it into a MATLAB struct
if (1 <= nlhs) {
- plhs[0] = configToStruct(pProjector->getProjectionGeometry()->getConfiguration());
+ Config *cfg = pProjector->getProjectionGeometry()->getConfiguration();
+ plhs[0] = configToStruct(cfg);
+ delete cfg;
}
}
@@ -189,8 +191,9 @@ void astra_mex_projector_volume_geometry(int nlhs, mxArray* plhs[], int nrhs, co
// step3: get projection_geometry and turn it into a MATLAB struct
if (1 <= nlhs) {
- plhs[0] = configToStruct(pProjector->getVolumeGeometry()->getConfiguration());
-
+ Config *cfg = pProjector->getVolumeGeometry()->getConfiguration();
+ plhs[0] = configToStruct(cfg);
+ delete cfg;
}
}
diff --git a/matlab/mex/mexHelpFunctions.cpp b/matlab/mex/mexHelpFunctions.cpp
index 87a9672..58e84d2 100644
--- a/matlab/mex/mexHelpFunctions.cpp
+++ b/matlab/mex/mexHelpFunctions.cpp
@@ -336,7 +336,11 @@ mxArray* XMLNodeToStruct(astra::XMLNode node)
// option
if (subnode.getName() == "Option") {
- mOptions[subnode.getAttribute("key")] = stringToMxArray(subnode.getAttribute("value"));
+ if(subnode.hasAttribute("value")){
+ mOptions[subnode.getAttribute("key")] = stringToMxArray(subnode.getAttribute("value"));
+ }else{
+ mOptions[subnode.getAttribute("key")] = stringToMxArray(subnode.getContent());
+ }
}
// regular content
diff --git a/matlab/tools/astra_create_reconstruction_cuda.m b/matlab/tools/astra_create_reconstruction_cuda.m
index 7d9e1dd..7d0421c 100644
--- a/matlab/tools/astra_create_reconstruction_cuda.m
+++ b/matlab/tools/astra_create_reconstruction_cuda.m
@@ -45,7 +45,7 @@ if strcmp(rec_type,'')
end
% configure
-cfg = astra_struct('SIRT_CUDA');
+cfg = astra_struct(rec_type);
cfg.ProjectionGeometry = proj_geom;
cfg.ReconstructionGeometry = vol_geom;
cfg.ProjectionDataId = sinogram_id;