[Paraview] ParaViewWeb, vtk filters python description

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Jun 25 18:48:59 EDT 2012


I don't believe the plugin is properly loaded for PWServer... Did you
write the proper initialization script ?

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


More information about the ParaView mailing list