<html><head><style> body {height: 100%; color:#000000; font-size:12pt; font-family:Times New Roman;}</style></head><body>To use vtk we have to add from "paraview import vtk" ?<br><span> </span><br><br>----- Original Message -----<br>From: Sebastien Jourdain <sebastien.jourdain@kitware.com><br>To: Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr><br>Cc: paraview@paraview.org<br>Sent: Mon, 14 May 2012 15:22:55 +0200 (CEST)<br>Subject: Re: [Paraview] JavaScript API - ParaViewWeb - how to call function<br><br>For that you will need to know the name of the ParaView Proxy. You can<br>find-out by using ParaView and the trace function.<br>Then by referring to<br>http://www.paraview.org/Wiki/What_is_the_full_JavaScript_API , you<br>should be able to convert the Python trace to a JavaScript code.<br>Moreover, if you use directly the JavaScript console of Firebug or<br>Chrome, you have the completions on the ParaView object.<br><br>I think in your case you should write your code as follow:<br><br>p = paraview();<br>var reader = plugin.load('myFile.mhd');<br>filter = p.Threshold( {proxy:reader} ); // The arg is optional as the<br>reader is currently active<br>representation = p.Show()<br>p.Render()<br><br>Seb<br><br>On Mon, May 14, 2012 at 5:27 AM, Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr> wrote:<br>> Hi everybody,<br>> I have a question about the using of JavaScript API in ParaViewWeb.<br>> I succeeded in loading a file using OpenDataFile via a plugin.<br>><br>> And now I want to apply a filter to my files.<br>> When I tried to call, for example ImageThreshold<br>><br>> p = paraview();<br>> var reader = plugin.load('myFile.mhd'); //I succeeded in loading this<br>> file<br>> reader = p.ImageThreshold(reader); // it's here I want<br>> to apply a filter, but I have the followed error : Object #<paraview> has no<br>> method 'ImageThreshold' I also tried with reader = p.vtkImageThreshold but<br>> the same error.<br>><br>> So I want to know how to call a ParaView function in JavaScript Terminal<br>> of PWConsole?<br>> Thank in advance<br>><br>><br>><br>><br>><br>><br>> _______________________________________________<br>> Powered by www.kitware.com<br>><br>> Visit other Kitware open-source projects at<br>> http://www.kitware.com/opensource/opensource.html<br>><br>> Please keep messages on-topic and check the ParaView Wiki at:<br>> http://paraview.org/Wiki/ParaView<br>><br>> Follow this link to subscribe/unsubscribe:<br>> http://www.paraview.org/mailman/listinfo/paraview<br>><br><br></paraview></tuan-ha.tran@insa-lyon.fr></body></html>