<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>I think that is the problem too (plugin is properly loaded for PWServer). But .... which initialization script are you talking about? XML or .py?</span></div><div><span><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:48
AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Paraview] ParaViewWeb, vtk filters python description<br> </font> </div> <br>
I don't believe the plugin is properly loaded for PWServer... Did you<br>write the proper initialization script ?<br><br>On Mon, Jun 25, 2012 at 6:36 PM, Alex <<a ymailto="mailto:tuanha_it0306@yahoo.com" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>> wrote:<br>> In fact,<br>> I call directly MyImageThreshold with<br>> threshold=paraview.MyImageThreshold({Input:reader, ...}) and I receive<br>> Uncaught TypeError : Object #<ParaView> has no method 'MyImageThreshold'<br>> when I use threshold = paravie.Threshold(....) (origin threshold of<br>> ParaView) then it works. That why I think that we have to use some kind of<br>> descriptor?<br>><br>> Alex<br>><br>> ________________________________<br>> From: Alex <<a ymailto="mailto:tuanha_it0306@yahoo.com" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>><br>> To: Sebastien Jourdain
<<a ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>> Cc: "<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>> Sent: Tuesday, June 26, 2012 12:24 AM<br>><br>> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description<br>><br>> Thank you Seb,<br>> You mean the ParaView plugin at startup? Indeed, I copied the dynamique<br>> library .so in /install/lib/paraview-3.14/plugins and the plugin is loaded<br>> automatically into ParaView. It is then usable immediately in Python Shell.<br>> However, I doubt that I can use the plugin directly in ParaViewWeb<br>> without loading it.<br>> For exemple, I have a
MyImageThresholdSMPlugin.so, also the plugin's name<br>> is MyImageThreshold. I called it sucessfully in Python Shell directly with<br>> reader2=MyImageThreshold(reader,ThresholdRange=[300,600]); (the values are<br>> given for exemple).<br>> In ParaViewWeb, can I use it directly by calling var<br>> reader2=paraview.MyImageThreshold({Input:reader, ThresholdRange:[300,600]});<br>> ?<br>> In your previous reply, I have to load a Plugin by LoadPlugin command<br>> from <a target="_blank" href="http://simple.py/">simple.py</a>. And then define a function that call the<br>> servermanager.Activeconnection.Modules.filters.MyImageThreshold(proxy) I<br>> wonder if they are the same thing? That why I ask if we have to write a<br>> MyImageThreshold.py so that our plugin is usable in ParaViewWeb.<br>><br>> Alex<br>><br>> ________________________________<br>> From: Sebastien
Jourdain <<a ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>> To: Alex <<a ymailto="mailto:tuanha_it0306@yahoo.com" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>><br>> Cc: "<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>> Sent: Tuesday, June 26, 2012 12:03 AM<br>> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description<br>><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 ymailto="mailto:tuanha_it0306@yahoo.com" 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<br>>> 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 pwsimple.py that describe how<br>>> can ParaViewWeb can use a Plugin. I search for all the .py file in<br>>> 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 ymailto="mailto:sebastien.jourdain@kitware.com"
href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>>> To: Alex <<a ymailto="mailto:tuanha_it0306@yahoo.com" href="mailto:tuanha_it0306@yahoo.com">tuanha_it0306@yahoo.com</a>><br>>> Cc: "<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a ymailto="mailto:paraview@paraview.org" 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 ymailto="mailto:tuanha_it0306@yahoo.com" 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>>>> @ <a href="http://paraview.org/Wiki/ParaView/Users_Guide/List_of_filters"
target="_blank">http://paraview.org/Wiki/ParaView/Users_Guide/List_of_filters</a><br>>>> We can use "threshold =<br>>>> paraview.Threshold({Input:proxy,ThresholdRange:[300,600]})" to applicate<br>>>> 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>>>> <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:<br>>>> <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>>><br>><br>><br>><br>>
_______________________________________________<br>> Powered by www.kitware.com<br>><br>> Visit other Kitware open-source projects at<br>> <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:<br>> <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><br><br> </div> </div> </div></body></html>