From 3f5e4b145c22d2dd512d584cd71bd4ae60c08a49 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Tue, 24 Feb 2015 14:54:11 +0100 Subject: added get_geometry for 3d volume objects --- matlab/mex/mexHelpFunctions.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'matlab/mex/mexHelpFunctions.h') diff --git a/matlab/mex/mexHelpFunctions.h b/matlab/mex/mexHelpFunctions.h index 84372ba..ae8acac 100644 --- a/matlab/mex/mexHelpFunctions.h +++ b/matlab/mex/mexHelpFunctions.h @@ -47,6 +47,9 @@ $Id$ #include "astra/FanFlatProjectionGeometry2D.h" #include "astra/VolumeGeometry2D.h" +#include "astra/VolumeGeometry3D.h" + + #include "astra/XMLDocument.h" #include "astra/XMLNode.h" @@ -63,8 +66,11 @@ mxArray* anyToMxArray(boost::any _any); astra::CProjectionGeometry2D* parseProjectionGeometryStruct(const mxArray*); mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry2D*); + astra::CVolumeGeometry2D* parseVolumeGeometryStruct(const mxArray*); + mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pReconGeom); +mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry3D* _pReconGeom); astra::XMLDocument* struct2XML(string rootname, const mxArray* pStruct); -- cgit v1.2.3 From 569515f3e20ef3b3c2c4a777f38f45dc67e6f9b6 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Tue, 24 Feb 2015 16:46:39 +0100 Subject: added get_geometry for 3d projection data objects --- matlab/mex/mexHelpFunctions.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'matlab/mex/mexHelpFunctions.h') diff --git a/matlab/mex/mexHelpFunctions.h b/matlab/mex/mexHelpFunctions.h index ae8acac..8b65a04 100644 --- a/matlab/mex/mexHelpFunctions.h +++ b/matlab/mex/mexHelpFunctions.h @@ -45,8 +45,12 @@ $Id$ #include "astra/ParallelProjectionGeometry2D.h" #include "astra/FanFlatProjectionGeometry2D.h" -#include "astra/VolumeGeometry2D.h" +#include "astra/ParallelProjectionGeometry3D.h" +#include "astra/ParallelVecProjectionGeometry3D.h" +#include "astra/ConeProjectionGeometry3D.h" +#include "astra/ConeVecProjectionGeometry3D.h" +#include "astra/VolumeGeometry2D.h" #include "astra/VolumeGeometry3D.h" @@ -65,10 +69,11 @@ mxArray* vectorToMxArray(std::vector mInput); mxArray* anyToMxArray(boost::any _any); astra::CProjectionGeometry2D* parseProjectionGeometryStruct(const mxArray*); -mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry2D*); - astra::CVolumeGeometry2D* parseVolumeGeometryStruct(const mxArray*); +mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry2D*); +mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry3D*); + mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pReconGeom); mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry3D* _pReconGeom); -- cgit v1.2.3 From 065d9c6a18f2b8eececc608ce850a9a308ca6356 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Wed, 25 Feb 2015 16:46:09 +0100 Subject: get_geometry now uses XML config object (for volumes) --- matlab/mex/mexHelpFunctions.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'matlab/mex/mexHelpFunctions.h') diff --git a/matlab/mex/mexHelpFunctions.h b/matlab/mex/mexHelpFunctions.h index 8b65a04..f8a7d48 100644 --- a/matlab/mex/mexHelpFunctions.h +++ b/matlab/mex/mexHelpFunctions.h @@ -74,11 +74,12 @@ astra::CVolumeGeometry2D* parseVolumeGeometryStruct(const mxArray*); mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry2D*); mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry3D*); -mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pReconGeom); -mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry3D* _pReconGeom); +// mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pReconGeom); +// mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry3D* _pReconGeom); astra::XMLDocument* struct2XML(string rootname, const mxArray* pStruct); +mxArray* config2struct(astra::Config* cfg); mxArray* XML2struct(astra::XMLDocument* xml); mxArray* XMLNode2struct(astra::XMLNode* xml); -- cgit v1.2.3 From cca150841cd1de4f3b4d24c1188263b9623bc511 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 13:47:59 +0100 Subject: get_geometry now uses XML config object (for projections) --- matlab/mex/mexHelpFunctions.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'matlab/mex/mexHelpFunctions.h') diff --git a/matlab/mex/mexHelpFunctions.h b/matlab/mex/mexHelpFunctions.h index f8a7d48..6c80f8c 100644 --- a/matlab/mex/mexHelpFunctions.h +++ b/matlab/mex/mexHelpFunctions.h @@ -71,17 +71,13 @@ mxArray* anyToMxArray(boost::any _any); astra::CProjectionGeometry2D* parseProjectionGeometryStruct(const mxArray*); astra::CVolumeGeometry2D* parseVolumeGeometryStruct(const mxArray*); -mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry2D*); -mxArray* createProjectionGeometryStruct(astra::CProjectionGeometry3D*); - -// mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pReconGeom); -// mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry3D* _pReconGeom); - astra::XMLDocument* struct2XML(string rootname, const mxArray* pStruct); -mxArray* config2struct(astra::Config* cfg); +mxArray* configToStruct(astra::Config* cfg); mxArray* XML2struct(astra::XMLDocument* xml); mxArray* XMLNode2struct(astra::XMLNode* xml); +mxArray* stringToMxArray(std::string input); + void get3DMatrixDims(const mxArray* x, mwSize *dims); -- cgit v1.2.3 From 169e912d2633cda7ffc234e78afba1b096e122ea Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 16:11:38 +0100 Subject: code cleanup --- matlab/mex/mexHelpFunctions.h | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) (limited to 'matlab/mex/mexHelpFunctions.h') diff --git a/matlab/mex/mexHelpFunctions.h b/matlab/mex/mexHelpFunctions.h index 6c80f8c..f9ffcf2 100644 --- a/matlab/mex/mexHelpFunctions.h +++ b/matlab/mex/mexHelpFunctions.h @@ -43,42 +43,31 @@ $Id$ #include "astra/Globals.h" #include "astra/Utilities.h" -#include "astra/ParallelProjectionGeometry2D.h" -#include "astra/FanFlatProjectionGeometry2D.h" -#include "astra/ParallelProjectionGeometry3D.h" -#include "astra/ParallelVecProjectionGeometry3D.h" -#include "astra/ConeProjectionGeometry3D.h" -#include "astra/ConeVecProjectionGeometry3D.h" - -#include "astra/VolumeGeometry2D.h" -#include "astra/VolumeGeometry3D.h" - - +#include "astra/Config.h" #include "astra/XMLDocument.h" #include "astra/XMLNode.h" -std::string mex_util_get_string(const mxArray* pInput); -bool isOption(std::list lOptions, std::string sOption); - -bool mex_is_scalar(const mxArray* pInput); +// utility functions +string mexToString(const mxArray* pInput); +bool mexIsScalar(const mxArray* pInput); +void get3DMatrixDims(const mxArray* x, mwSize *dims); -std::map parseStruct(const mxArray* pInput); -mxArray* buildStruct(std::map mInput); +// convert boost::any into a MALTAB object mxArray* vectorToMxArray(std::vector mInput); - mxArray* anyToMxArray(boost::any _any); -astra::CProjectionGeometry2D* parseProjectionGeometryStruct(const mxArray*); -astra::CVolumeGeometry2D* parseVolumeGeometryStruct(const mxArray*); - -astra::XMLDocument* struct2XML(string rootname, const mxArray* pStruct); +// turn a MATLAB struct into a Config object +astra::Config* structToConfig(string rootname, const mxArray* pStruct); +bool structToXMLNode(astra::XMLNode* node, const mxArray* pStruct); +bool optionsToXMLNode(astra::XMLNode* node, const mxArray* pOptionStruct); +std::map parseStruct(const mxArray* pInput); +// turn a Config object into a MATLAB struct mxArray* configToStruct(astra::Config* cfg); -mxArray* XML2struct(astra::XMLDocument* xml); -mxArray* XMLNode2struct(astra::XMLNode* xml); +mxArray* XMLNodeToStruct(astra::XMLNode* xml); mxArray* stringToMxArray(std::string input); +mxArray* buildStruct(std::map mInput); -void get3DMatrixDims(const mxArray* x, mwSize *dims); #endif -- cgit v1.2.3