diff options
author | Wim van Aarle <wimvanaarle@gmail.com> | 2015-05-26 15:43:08 +0200 |
---|---|---|
committer | Wim van Aarle <wimvanaarle@gmail.com> | 2015-05-26 15:43:08 +0200 |
commit | 3117c7a61a83ca28ba00211d1eb65eaf13a7307a (patch) | |
tree | 4851ae878cf499deb2ae2f77575b3c48ecaf5d04 /matlab/mex/mexInitFunctions.cpp | |
parent | 9e884e760b71be354c08892f6bce2efe723917b3 (diff) | |
parent | 57668bcdd086145eb14598e32fd5d0dca711865c (diff) | |
download | astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.gz astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.bz2 astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.xz astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.zip |
Merge remote-tracking branch 'upstream/master' into parallel_vec
Conflicts:
astra_vc11.vcxproj.filters
python/astra/functions.py
src/ParallelBeamBlobKernelProjector2D.cpp
src/ProjectionGeometry2D.cpp
Diffstat (limited to 'matlab/mex/mexInitFunctions.cpp')
-rw-r--r-- | matlab/mex/mexInitFunctions.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/matlab/mex/mexInitFunctions.cpp b/matlab/mex/mexInitFunctions.cpp new file mode 100644 index 0000000..d8a50d7 --- /dev/null +++ b/matlab/mex/mexInitFunctions.cpp @@ -0,0 +1,24 @@ +#include <mex.h> +#include "astra/Logging.h" + +bool mexIsInitialized=false; + +/** + * Callback to print log message to Matlab window. + * + */ +void logCallBack(const char *msg, size_t len){ + mexPrintf(msg); +} + +/** + * Initialize mex functions. + * + */ +void initASTRAMex(){ + if(mexIsInitialized) return; + if(!astra::CLogger::setCallbackScreen(&logCallBack)){ + mexErrMsgTxt("Error initializing mex functions."); + } + mexIsInitialized=true; +} |