f



VTK - Java - Matlab

Hi everyone!

Despite there are very few threads related to this topic
(VTK-Java-Matlab integration), it seems that someone is using VTK for
demanding 3D renderings.
So I decided to try it.

I successfully compiled VTK (with Java wrapping) as a stand alone
toolbox and I can run and interact with all the included examples, so
I suppose that everything is in its place.

But, when I try to use vtk in my Matlab scripts, it seems that
something is going wrong: for example, when I run the usual Cone1
example, the rendering window is created, the cone spins, but then
Matlab crashes.
Probably the "usual" code flow (the one common to all the examples
included in the vtk package) is not suitable for being executed from
within Matlab, or maybe I'm still missing something...

So, the question is: is there anyone who is actually using VTK in
his/her Matlab programs (creating a renderWindow, interacting with
its contents, exchanging data from and to Matlab like it was a
"usual" GUI window)?
Has anyone have some working vtk-Matlab code?

Thanks in advance for any suggestion!

Paolo Bertolo
0
maccube (2)
9/10/2005 11:12:28 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

2 Replies
228 Views

Similar Articles

[PageSpeed] 41

Hi,

I would like to see some vtk-matlab example code :-)


Paolo Bertolo wrote:

> Hi everyone!
> 
> Despite there are very few threads related to this topic
> (VTK-Java-Matlab integration), it seems that someone is using VTK
> for demanding 3D renderings.
> So I decided to try it.
> 
> I successfully compiled VTK (with Java wrapping) as a stand alone
> toolbox and I can run and interact with all the included examples,
> so I suppose that everything is in its place.
> 
> But, when I try to use vtk in my Matlab scripts, it seems that
> something is going wrong: for example, when I run the usual Cone1
> example, the rendering window is created, the cone spins, but then
> Matlab crashes.
> Probably the "usual" code flow (the one common to all the examples
> included in the vtk package) is not suitable for being executed from
> within Matlab, or maybe I'm still missing something...
> 
> So, the question is: is there anyone who is actually using VTK in
> his/her Matlab programs (creating a renderWindow, interacting with
> its contents, exchanging data from and to Matlab like it was a
> "usual" GUI window)?
> Has anyone have some working vtk-Matlab code?
> 
> Thanks in advance for any suggestion!
> 
> Paolo Bertolo

-- 
Greetings!
Fabian
0
9/11/2005 4:01:44 PM
> Hi,
>
> I would like to see some vtk-matlab example code :-)

I received this very interesting contribute from the VTK mailing
list.
By the way, if you are using VTK-Java, you can call all the vtk
classes as you usually do with any other java class.
The point is having Matlab actively controlling VTK, which seems to
be quite tricky.

Paolo Bertolo

> VTK mailing list contribute:

May be as an alternative you would consider using Octave ( <http://www.octave.org>
 ? It emulates Matlab syntax, is an open-source project and has a vtk
interface built by Dragan Tubic ( <http://octaviz.sourceforge.net/> ) .
The problem, I think, is not a VTK's but rather Matlab's one. Matlab
have to keep track of two connections/sockets - the first is its
command line (shell) and the second is X connection opened by VTK. If
wrapping application (in your case this is Matlab) is not instructed
to look at the two connection at once (through polling) one of them
seems "freezed" to the end user (the input or output to one of them
is not processed). It may be solved in Matlab but this require some
knowledge of its internals but due to closed-source nature of Matlab
is hard to implement IMHO.
Good luck!
0
maccube (2)
9/11/2005 4:37:26 PM
Reply: