[vtkusers] VTK and MATLAB mex files

Phil Goddard philgoddard at telus.net
Thu Apr 17 12:26:03 EDT 2008


I'm wondering if anyone can give me some details regarding creating MATLAB
mex files to interface with VTK.
(I'm working on Windows XP and if possible, for various reasons, would
prefer using MS Visual Studio.)

I am a very experienced MATLAB programmer, and the MATLAB side of the
equation isn't where I'm stuck.
I am very new to VTK (I've only been looking at the app and the archive for
this group for a few hours) and this is where I'm seeking assistance.
And although there are various examples of mex files listed in the archive,
all very useful, they don't address some very basic questions that I have:

I believe that I need to compile the VTK source code down to shared
libraries myself.
Is cmake essential for this?
If so, are there any examples of what the CMakeLists.txt file looks like?

>From my understanding cmake is a utility for creating things like Visual
Studio projects, or gcc make files, that will do the actual build (and hence
isn't essential for the build step).
Can anyone give an example of either generating a VS project, or send me a
copy of a pre-generated project that I might look at and/or use?
If I have the Project (or gcc make file) as my starting point do I still
need cmake?

I've looked at the example http://www.vtk.org/Wiki/VTK/VTKMatlab
It indicates that within VTK a shared library has a dot.a extension.
Why is that?  Why not a standard dot.lib extension?

If I try to make the mex file from the above example I get a compiler
message about vtkConfigure.h not beng found.
There is a vtkConfigure.h.in
What is the dot.in extension for?
If I (mindlessly) change this to a standard dot.h file (is that sensible?)
then I get errors related to not knowing what to do with #cmakedefine.
Which gets me back to wondering if cmake is essential.

Any tips for a beginner would be appreciated.

Phil.






More information about the vtkusers mailing list