diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-06-26 12:00:20 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2015-06-26 12:00:20 +0200 |
commit | 62f3aa5792011792db866ce0841c8d164aa9a34d (patch) | |
tree | 8f494a765a3607afd1c9bac9c592f30536b950a1 /matlab | |
parent | 8ad46dc9cb28067047838e06770707cf86ef6e56 (diff) | |
parent | 9e3472ea9041b8755050427d8bdb8a4701019c55 (diff) | |
download | astra-62f3aa5792011792db866ce0841c8d164aa9a34d.tar.gz astra-62f3aa5792011792db866ce0841c8d164aa9a34d.tar.bz2 astra-62f3aa5792011792db866ce0841c8d164aa9a34d.tar.xz astra-62f3aa5792011792db866ce0841c8d164aa9a34d.zip |
Merge pull request #76 from dmpelt/projector-configuration-fix
Configuration fixes
Diffstat (limited to 'matlab')
-rw-r--r-- | matlab/mex/astra_mex_projector3d_c.cpp | 8 | ||||
-rw-r--r-- | matlab/mex/astra_mex_projector_c.cpp | 9 | ||||
-rw-r--r-- | matlab/mex/mexHelpFunctions.cpp | 6 |
3 files changed, 17 insertions, 6 deletions
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 |