diff options
author | Wim van Aarle <wimvanaarle@gmail.com> | 2015-02-24 14:54:11 +0100 |
---|---|---|
committer | Wim van Aarle <wimvanaarle@gmail.com> | 2015-02-24 14:54:11 +0100 |
commit | 3f5e4b145c22d2dd512d584cd71bd4ae60c08a49 (patch) | |
tree | fd5bde6240e9189090b73e0be097fc653a3e9648 /matlab/mex/mexHelpFunctions.cpp | |
parent | f619aba4543de6b9a4fe6fb63b6f1840ef509846 (diff) | |
download | astra-3f5e4b145c22d2dd512d584cd71bd4ae60c08a49.tar.gz astra-3f5e4b145c22d2dd512d584cd71bd4ae60c08a49.tar.bz2 astra-3f5e4b145c22d2dd512d584cd71bd4ae60c08a49.tar.xz astra-3f5e4b145c22d2dd512d584cd71bd4ae60c08a49.zip |
added get_geometry for 3d volume objects
Diffstat (limited to 'matlab/mex/mexHelpFunctions.cpp')
-rw-r--r-- | matlab/mex/mexHelpFunctions.cpp | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/matlab/mex/mexHelpFunctions.cpp b/matlab/mex/mexHelpFunctions.cpp index e919dd9..9b65e77 100644 --- a/matlab/mex/mexHelpFunctions.cpp +++ b/matlab/mex/mexHelpFunctions.cpp @@ -331,28 +331,47 @@ astra::CVolumeGeometry2D* parseVolumeGeometryStruct(const mxArray* prhs) } //----------------------------------------------------------------------------------------- -// create reconstruction geometry data -mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pReconGeom) +// create 2D volume geometry struct +mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry2D* _pVolGeom) { - // temporary map to store the data for the MATLAB struct std::map<std::string, mxArray*> mGeometryInfo; - // fill up map - mGeometryInfo["GridColCount"] = mxCreateDoubleScalar(_pReconGeom->getGridColCount()); - mGeometryInfo["GridRowCount"] = mxCreateDoubleScalar(_pReconGeom->getGridRowCount()); + mGeometryInfo["GridColCount"] = mxCreateDoubleScalar(_pVolGeom->getGridColCount()); + mGeometryInfo["GridRowCount"] = mxCreateDoubleScalar(_pVolGeom->getGridRowCount()); std::map<std::string, mxArray*> mGeometryOptions; - mGeometryOptions["WindowMinX"] = mxCreateDoubleScalar(_pReconGeom->getWindowMinX()); - mGeometryOptions["WindowMaxX"] = mxCreateDoubleScalar(_pReconGeom->getWindowMaxX()); - mGeometryOptions["WindowMinY"] = mxCreateDoubleScalar(_pReconGeom->getWindowMinY()); - mGeometryOptions["WindowMaxY"] = mxCreateDoubleScalar(_pReconGeom->getWindowMaxY()); + mGeometryOptions["WindowMinX"] = mxCreateDoubleScalar(_pVolGeom->getWindowMinX()); + mGeometryOptions["WindowMaxX"] = mxCreateDoubleScalar(_pVolGeom->getWindowMaxX()); + mGeometryOptions["WindowMinY"] = mxCreateDoubleScalar(_pVolGeom->getWindowMinY()); + mGeometryOptions["WindowMaxY"] = mxCreateDoubleScalar(_pVolGeom->getWindowMaxY()); mGeometryInfo["option"] = buildStruct(mGeometryOptions); - // build and return the MATLAB struct return buildStruct(mGeometryInfo); } +//----------------------------------------------------------------------------------------- +// create 3D volume geometry struct +mxArray* createVolumeGeometryStruct(astra::CVolumeGeometry3D* _pVolGeom) +{ + std::map<std::string, mxArray*> mGeometryInfo; + + mGeometryInfo["GridColCount"] = mxCreateDoubleScalar(_pVolGeom->getGridColCount()); + mGeometryInfo["GridRowCount"] = mxCreateDoubleScalar(_pVolGeom->getGridRowCount()); + mGeometryInfo["GridSliceCount"] = mxCreateDoubleScalar(_pVolGeom->getGridRowCount()); + + std::map<std::string, mxArray*> mGeometryOptions; + mGeometryOptions["WindowMinX"] = mxCreateDoubleScalar(_pVolGeom->getWindowMinX()); + mGeometryOptions["WindowMaxX"] = mxCreateDoubleScalar(_pVolGeom->getWindowMaxX()); + mGeometryOptions["WindowMinY"] = mxCreateDoubleScalar(_pVolGeom->getWindowMinY()); + mGeometryOptions["WindowMaxY"] = mxCreateDoubleScalar(_pVolGeom->getWindowMaxY()); + mGeometryOptions["WindowMinZ"] = mxCreateDoubleScalar(_pVolGeom->getWindowMinZ()); + mGeometryOptions["WindowMaxZ"] = mxCreateDoubleScalar(_pVolGeom->getWindowMaxZ()); + + mGeometryInfo["option"] = buildStruct(mGeometryOptions); + + return buildStruct(mGeometryInfo); +} //----------------------------------------------------------------------------------------- string matlab2string(const mxArray* pField) |