File Exchange

image thumbnail

Visualization Toolkit (VTK) mex interface

version 1.0 (6.5 KB) by

Files describing how to interface MATLAB with VTK via mex

11 Downloads

Updated

View License

The code in this submission describes how to download and install the Visualization Toolkit (VTK, www.vtk.org) and create a MATLAB mex file to interface with it.

An example C++ mex file and code to build and run the mex file are included.

Comments and Ratings (7)

Mimi

Mimi (view profile)

here is my new version with vtk 6.1, but i used windows: http://de.mathworks.com/matlabcentral/fileexchange/48948-vtk-6-1-mex-interface-windows

code is not very pretty, but i already wasted so much time with installing vtk :-/

Haung

Haung (view profile)

Can give a new version with VTK6.1.0 ?

it seems different..

marc

marc (view profile)

Mark T

Mark T (view profile)

Thanks Phil. Good instructions - worked out fine (slight deviation in selecting build options in cmake...and VC2008 took about 30 minutes to compile on a 2.0GHz Pentium).
However, when running 'vtkPolyDataRenderer.mexw32' with 'runDemoVTKmexfile.m' I get *random crashes upon calling*.
Could there be a memory leak floating around?

Got it installed on my Opensuse 11.1 with Matlab 2007b. There was one ' bug' due to GLIBCXX inconsistencies, I'd to remove the files libstdc++.so.6 and libgcc_s.so.1 from the matlab/sys/os/glnxa64 directory (64 bit pc).

For the "closing" bug, a work-around exists: type 'q' in the VTK window, and the VTK-window will close as it should do while keeping Matlab alive.

Fredrik Viksten

The openGL shutting down matlab is a well-known ... limitation(?) of the classic openGL implementation. There is an old lngjmp ugly-hackish-fix to get around it but a much better way is to use freeglut which already can handle this.

Abhishek Banerjee

its good but i tested on my Fedora 9 with gcc-4.3 . But when i closed the openGL window my matlab also shutting down ..i dont know why ..

MATLAB Release
MATLAB 7.6 (R2008a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video