4.0

4.0 | 3 ratings Rate this file 21 Downloads (last 30 days) File Size: 6.5 KB File ID: #19638

Visualization Toolkit (VTK) mex interface

by Phil Goddard

 

18 Apr 2008 (Updated 21 Apr 2008)

Files describing how to interface MATLAB with VTK via mex

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.6 (R2008a)
Other requirements The example uses VTK5.0, Visual Studio.Net 2003 and cmake4.0 However the generalize to other releases of MATLAB and these products.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
21 Jul 2008 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 ..

16 Oct 2008 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.

11 May 2009 Martijn Steenwijk

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.

06 Jul 2009 Mark T

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?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
external interface Phil Goddard 22 Oct 2008 09:58:21
vtk Phil Goddard 22 Oct 2008 09:58:21
mex Phil Goddard 22 Oct 2008 09:58:21
visualization toolkit Phil Goddard 22 Oct 2008 09:58:21
external code interfacing Phil Goddard 22 Oct 2008 09:58:21

Contact us at files@mathworks.com