<html><head><style> body {height: 100%; color:#000000; font-size:12pt; font-family:Times New Roman;}</style></head><body>Thank you Seb,<br><span>I tried to use OpenDataFile() in the simple.py but I think that it's not the right reader to use (it weird because the comment say that OpenDataFile will search for the right reader).</span><br><span>Now I want to use MetaFileSeriesReader('fileName'), a reader of VTK.</span><br><span>So I write a loadFile.py as followed</span><br><span> </span><br><br><strong><em>from paraview.simple import *</em></strong><br><strong><em>from paraview import vtk</em></strong><br><strong><em><br></em></strong><br><strong><em>def MetaImageReader(file):</em></strong><br><strong><em> return vtk.vtkMetaFileSeriesReader('/home/thtran/'+file);</em></strong><span><br><span>I tried <strong>return vtk.vtkMetaFileSeriesReader ...</strong> as well as <strong>return vtk.MetaFilSeriesReader</strong></span><strong><em> </em></strong></span><br>but always <span style="color: #ff0000; font-family: 'dejavu sans mono', monospace; font-size: 11px; line-height: 12px; white-space: pre-wrap; ">Uncaught 'module' object has no attribute 'MetaFileSeriesReader'</span><br><br><span>I think that the proxy I provided is wrong. but I don't have any idea about how it'll be.</span><br><span>Do you have any idea?</span><br><span>Thank you in advance</span><br><br><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: Tue, 15 May 2012 13:56:09 +0200 (CEST)<br>Subject: Re: [Paraview] JavaScript API - ParaViewWeb - how to call function<br><br>Hi Tuan,<br><br>The 'missing' documentation that you are looking for is inside the<br>appendix of http://paraview.org/Wiki/ParaView/Users_Guide/Table_Of_Contents<br>under "List of ...".<br>Those API's are defined by some XML files that describe all the<br>ParaView proxies. ParaView does not use VTK class directly but instead<br>use Proxy to abstract the location and distribution of the real VTK<br>class instance.<br><br>Regarding the plugin part, I was talking about ParaViewWeb plugin<br>(Python), not ParaView plugin (XML/C++) but in any case you can use<br>both if you need to.<br><br>Moreover, depending on what you are doing you shouldn't need to use<br>VTK classes directly and you should stick to the ParaView proxy<br>paradigm.<br><br>Seb<br><br>On Tue, May 15, 2012 at 4:31 AM, Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr> wrote:<br>> Thank you very much Seb,<br>> I have another question : I read the simple.py and certainly, I found all<br>> the function about rendering, read file, etc. but I didn't find out anything<br>> about all the filters.<br>> So if a want to use these filter, in python and after, in javascript. Where<br>> can I find the header (to know how to use these functions - some files like<br>> simple.py)? Do I have to import the vtk Library or something like that so we<br>> can use them in ParaViewWeb?<br>> About the plugin, I (suppose) write a plugin, with the .xml and .cxx file<br>> (as instructed in the Wiki page), write .py file and place it into the<br>> folder plugins of working-directory.<br>> So, in the PWConsole, I suppose to load the plugin so it can be use in<br>> PWConsole? I wonder if i'm right.<br>> Thank you once more.<br>><br>><br>><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 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<br>>> want<br>>> to apply a filter, but I have the followed error : Object # has no<br>><br>>> method 'ImageThreshold' I also tried with reader = p.vtkImageThreshold<br>>> 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><br></tuan-ha.tran@insa-lyon.fr></sebastien.jourdain@kitware.com></tuan-ha.tran@insa-lyon.fr></body></html>