<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>In fact, <br></span></div><div><span> I call directly MyImageThreshold with threshold=paraview.MyImageThreshold({Input:reader, ...}) and I receive Uncaught Type</span><span>Error : Object #<ParaView> has no method 'MyImageThreshold'</span></div><div><span> when I use threshold = paravie.Threshold(....) (origin threshold of ParaView) then it works. That why I think that we have to use some kind of descriptor?</span></div><div><span> <br></span></div><div><span> Alex<br></span></div><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span
style="font-weight:bold;">From:</span></b> Alex <tuanha_it0306@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> Sebastien Jourdain <sebastien.jourdain@kitware.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "paraview@paraview.org" <paraview@paraview.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, June 26, 2012 12:24 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Paraview] ParaViewWeb, vtk filters python description<br> </font> </div> <br>
<div id="yiv567466490"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div><span>Thank you Seb,</span></div><div><span> You mean the ParaView plugin at startup? Indeed, I copied the dynamique library .so in <span style="color:rgb(0, 0, 191);font-weight:bold;">/install/lib/paraview-3.14/plugins</span> and the plugin is loaded automatically into ParaView. It is then usable immediately in Python Shell.</span></div><div><span> However, I doubt that I can use the plugin directly in ParaViewWeb without loading it.</span></div><div><span> For exemple, I have a MyImageThresholdSMPlugin.so, also the plugin's name is MyImageThreshold. I called it sucessfully in Python Shell directly with <span style="color:rgb(0, 0, 191);font-weight:bold;">reader2=MyImageThreshold(reader,ThresholdRange=[300,600]);</span> (the values are given for
exemple).</span></div><div><span> In ParaViewWeb, can I use it directly by calling <span style="color:rgb(0, 0, 191);font-weight:bold;">var reader2=paraview.MyImageThreshold({Input:reader, ThresholdRange:[300,600]});</span> ?</span></div><div><span> In your previous reply, I have to load a Plugin by LoadPlugin command from <a target="_blank" href="http://simple.py/">simple.py</a>. And then define a function that call the <span style="color:rgb(0, 0, 191);font-weight:bold;">servermanager.Activeconnection.Modules.filters.MyImageThreshold(proxy)</span> I wonder if they are the same thing? That why I ask if we have to write a MyImageThreshold.py so that our plugin is usable in ParaViewWeb.</span></div><div><span> <br></span></div><div><span> Alex<br></span></div><div><br></div> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div style="font-family:times new roman, new york,
times, serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Sebastien Jourdain <sebastien.jourdain@kitware.com><br> <b><span style="font-weight:bold;">To:</span></b> Alex <tuanha_it0306@yahoo.com> <br><b><span style="font-weight:bold;">Cc:</span></b> "paraview@paraview.org" <paraview@paraview.org> <br> <b><span style="font-weight:bold;">Sent:</span></b> Tuesday, June 26, 2012 12:03 AM<br> <b><span style="font-weight:bold;">Subject:</span></b> Re: [Paraview] ParaViewWeb, vtk filters python description<br> </font> </div> <br>
If you managed to load your plugin (the C++ ParaView one) at startup,<br>then you will be able to use your filter as any other filter in<br>ParaViewWeb without using any ParaViewWeb plugin. Otherwise, the<br>python file that you are missing is in fact an XML file that list the<br>properties for each filters and sources inside ParaView.<br><br>PARAVIEW_src/ParaViewCore/ServerImplementation/resources/filter.xml<br><br>The labels without space are used as filter name and properties for<br>creating and controlling those filters...<br><br>Otherwise inside your ParaViewWeb plugin, you can provide a dictionary<br>as argument and just loop through its entry and set them in python.<br><br>Seb<br><br>On Mon, Jun 25, 2012 at 5:47 PM, Alex <<a rel="nofollow" ymailto="mailto:tuanha_it0306@yahoo.com" target="_blank" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>> wrote:<br>> Hi seb, thank you for your quick reply.<br>> I found that I can
use vtk Filter like Threshold,
Clip, etc. in ParaViewWeb<br>> by enter the arguments like I cited in my email. Like threshold =<br>> paraview.Threshold({Input:proxy,ThresholdRange:[300,600]}).<br>> So I think there are perhaps some files like <a rel="nofollow" target="_blank" href="http://pwsimple.py/">pwsimple.py</a> that describe how<br>> can ParaViewWeb can use a Plugin. I search for all the .py file in ParaView<br>> and I can't find something like that.<br>> I did succeed in doing a ParaViewWeb plugin.<br>> I used your advice to define something as following :<br>> def SimpleImageThreshold(proxy)<br>><br>> servermanager.Activeconnection.Modules.filter.SimpleImageThreshold(proxy)<br>><br>> Now if I want my plugin to take ThresholdRange=[300,600] as input like the<br>> original Threshold of ParaView, is that possible?<br>> If yes, how can we define this?<br>> Thank you very much indeed<br>><br>><br>><br>>
________________________________<br>> From: Sebastien Jourdain <<a rel="nofollow" ymailto="mailto:sebastien.jourdain@kitware.com" target="_blank" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>> To: Alex <<a rel="nofollow" ymailto="mailto:tuanha_it0306@yahoo.com" target="_blank" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>><br>> Cc: "<a rel="nofollow" ymailto="mailto:paraview@paraview.org" target="_blank" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a rel="nofollow" ymailto="mailto:paraview@paraview.org" target="_blank" href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>> Sent: Monday, June 25, 2012 11:08 PM<br>> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description<br>><br>> I'm not sure I understand what you mean by "Where is the python file<br>> which describes the way of using vtk Filters in
ParaViewWeb?"<br>><br>> The one that is imported by default is the pwsimple.py which is an<br>> extension of the simple.py of
regular ParaView.<br>><br>> But having said that, you can't easily mix VTK filter and ParaView<br>> proxy together, unless you just want to do some data processing<br>> without rendering.<br>> But as I remember, you did a ParaView plugin for that, so normally,<br>> once loaded you should be able to use it.<br>><br>> Did you try to load that plugin at startup with the extra argument of<br>> PWServer ?<br>><br>> Seb<br>><br>> On Mon, Jun 25, 2012 at 4:25 PM, Alex <<a rel="nofollow" ymailto="mailto:tuanha_it0306@yahoo.com" target="_blank" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>> wrote:<br>>> Hi everybody,<br>>> Well, I found that using vtk Filter (Threshold, Clip, etc.) is simple<br>>> within ParaViewWeb, we have a list of filters so that we can use the<br>>> filters<br>>> @
http://paraview.org/Wiki/ParaView/Users_Guide/List_of_filters<br>>> We can use
"threshold =<br>>> paraview.Threshold({Input:proxy,ThresholdRange:[300,600]})" to applicate a<br>>> threshold between 300 and 600 for an image.<br>>> So, my question is : where can I find the python script .py which<br>>> describes the way of using vtk Filters in ParaViewWeb?<br>>><br>>> If there isn't any file python script like that, how can we define a<br>>> function that take in value as described above? How can we tell the<br>>> ParaViewWeb to take in different type of variable?<br>>> I mean : def ImageThreshold(proxy,ThresholdRange......) or something<br>>> like<br>>> that?<br>>><br>>> Thank you very much for your reply.<br>>> Good day everybody :)<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><br><br> </div> </div> </div></div></div><br>_______________________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br><br>Follow this link to subscribe/unsubscribe:<br><a
href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br><br><br> </div> </div> </div></body></html>