Hi Paul,
Very likely the problem is that the binary installer of NiftyRec is for Windows 32 bit, while your Windows installation is 64 bit. Keep reading to figure it out.
Matlab functions can be defined in two ways: as an .m file, containing matlab code, or as a mex file. The mex file is nothing but a dynamic library (.dll) renamed right after compilation with the extension .mex32 (that is under Windows 32; Matlab by convention uses different extension names in different operating systems, e.g. .mexa64 under Linux 64 bit). To cut short, such library exposes an interface that lets Matlab recognise it as an extension and make use of it.
When you invoke a function with name foo, Matlab looks for foo.m and, if it doesn't find it, for foo.mex32 (assuming Windows 32 bit).
Therefore when you invoke a function Matlab, under the hood, may execute the code contained in .m file or is a mex file, without you knowing.
As a naming convention, NiftyRec appends '_mex' to all the mex extensions, so that you recognise them in the Matlab workspace.
All the functions of the NiftyRec Matlab toolkit API are .m files, however many of them are wrappers of a corresponding mex file whose name is obtained by appending '_mex'. Edit for example et_project.m and you will see that there are only a few lines of code; these check the input parameters and then call et_project_mex.
When you type et_project(..) then Matlab launches et_project.m and subsequently the mex file et_project_mex.mex32.
The mex file, in order to be found, just like any other library, has to be in the current working directory or in the system path.
The .m files and the mex files of NiftyRec are all in the same folder. Since in your case Matlab can find the .m files, I guess that it does not find the mex files because they have the wrong extension for your operating system (e.g. mismatching architecture 64 vs 32 bit).
I am looking to automate the building of NiftyRec on a few platforms, in the meantime the solution is to compile NiftyRec from source. See the instructions on the Wiki.
I hope this helps,
Stefano
|