Hi,
I have been trying to set up nifty_rec to work with MATLAB, but so far unsuccessfully.
1) After installing the binaries I tried to run some of the demos (I am running Windows 7 64-bit but I have 32-bit MATLAB) but I get the following error:
------------------------------------------------------------------------------------------------------
>> tt_demo_mlem_parallel
Invalid MEX-file 'C:\Program Files (x86)\NiftyRec\niftyrec\matlab\et_rotate_mex.mexw32': The application has failed to start because its side-by-side configuration is incorrect.
Please see the application event log or use the command-line sxstrace.exe tool for more detail.
Error in et_rotate (line 58)
out_image = et_rotate_mex(in_image, rotation, center, use_gpu, background);
Error in tt_demo_mlem_parallel (line 27)
phantom_attenuation = mask.*et_rotate(attenuation_128,[pi/2,0,0],[64.5,64.5,64.5],1,0)*1e-5;
------------------------------------------------------------------------------------------------------
Looking in the event log and around the Internet it seems that this is related to MS Visual C++ Redistributable packages that may or may not be correctly referenced. I have uninstalled and re-installed all MSVC++ Redistributable (2005, 2008, 2010, including service packs) but the problem persists.
Has anyone else experienced this problem or have any other ideas?
2) In a parallel attempt to get things working, I have also tried to build the binaries myself using Cmake and Visual Studio. I am assuming that in this case I should build the mexw32 files from within MATLAB. However when I try to run mex, I get the following error:
>> mex -v _et_rotate_mex.cpp
***************************************************************************
Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require
the use of -largeArrayDims and remove the -compatibleArrayDims
option. For more information, see:
http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html
****************************************************************************
-> Default options filename found in C:\Users\nly17915\AppData\Roaming\MathWorks\MATLAB\R2012b
----------------------------------------------------------------
-> Options file = C:\Users\nly17915\AppData\Roaming\MathWorks\MATLAB\R2012b\mexopts.bat
MATLAB = C:\Program Files (x86)\MATLAB\R2012b
-> COMPILER = lcc
-> Compiler flags:
COMPFLAGS = -c -I"C:\Program Files (x86)\MATLAB\R2012b\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup
OPTIMFLAGS = -DNDEBUG
DEBUGFLAGS = -g4
arguments =
Name switch = -Fo
-> Pre-linking commands =
-> LINKER = lcclnk
-> Link directives:
LINKFLAGS = -tmpdir "." -dll "C:\Program Files (x86)\MATLAB\R2012b\extern\lib\win32\lcc\mexFunction.def" -L"C:\Program Files (x86)\MATLAB\R2012b\sys\lcc\lib" -libpath "C:\Program Files (x86)\MATLAB\R2012b\extern\lib\win32\lcc" "C:\Users\nly17915\AppData\Local\Temp\mex_R9lSua\templib2.obj"
LINKDEBUGFLAGS =
LINKFLAGSPOST = libmx.lib libmex.lib libmat.lib
Name directive = -o "_et_rotate_mex.mexw32"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = lrc -I"C:\Program Files (x86)\MATLAB\R2012b\sys\lcc\include" -noregistrylookup -fo"mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> lcc -c -I"C:\Program Files (x86)\MATLAB\R2012b\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup -FoC:\Users\nly17915\AppData\Local\Temp\mex_R9lSua\_et_rotate_mex.obj -I"C:\Program Files (x86)\MATLAB\R2012b\extern\include" -I"C:\Program Files (x86)\MATLAB\R2012b\simulink\include" -DNDEBUG -DMX_COMPAT_32 _et_rotate_mex.cpp
lcc preprocessor error: _et_rotate_mex.cpp:12 Could not find include file "_et_array_interface.h"
lcc preprocessor error: _et_rotate_mex.cpp:14 Could not find include file <limits>
lcc preprocessor error: _et_rotate_mex.cpp:17 Could not find include file <cmath>
Error _et_rotate_mex.cpp: 29 illegal statement termination
Error _et_rotate_mex.cpp: 29 skipping `const'
Error _et_rotate_mex.cpp: 29 illegal use of type name `mxClassID'
Warning _et_rotate_mex.cpp: 29 Statement has no effect
Error _et_rotate_mex.cpp: 29 syntax error; found `cid_image' expecting `;'
Error _et_rotate_mex.cpp: 29 undeclared identifier `cid_image'
Error _et_rotate_mex.cpp: 30 illegal statement termination
Error _et_rotate_mex.cpp: 30 skipping `const' `int'
Error _et_rotate_mex.cpp: 30 undeclared identifier `dim_image'
Error _et_rotate_mex.cpp: 32 illegal statement termination
Error _et_rotate_mex.cpp: 32 skipping `const'
Error _et_rotate_mex.cpp: 32 illegal use of type name `mxClassID'
Warning _et_rotate_mex.cpp: 32 Statement has no effect
Error _et_rotate_mex.cpp: 32 syntax error; found `cid_rotation' expecting `;'
Error _et_rotate_mex.cpp: 32 undeclared identifier `cid_rotation'
Error _et_rotate_mex.cpp: 33 illegal statement termination
Error _et_rotate_mex.cpp: 33 skipping `const' `int'
Error _et_rotate_mex.cpp: 33 undeclared identifier `dim_rotation'
Error _et_rotate_mex.cpp: 35 illegal statement termination
Error _et_rotate_mex.cpp: 35 too many errors
C:\PROGRA~2\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of '_et_rotate_mex.cpp' failed.
Error using mex (line 206)
Unable to complete successfully.
---------------------------------------------------------------- ----------------------------------------------------------------
It seems that it cannot find some header files, although I have added the entire nifty_rec directory to the path. In fact, I can just open the file _et_array_interface.h in the MATLAB editor, yet somehow mex doesn't see it...
Any help will be much appreciated.
Chrysi
|