Alex | 25 Jun 2012 22:25
Picon
Favicon

ParaViewWeb, vtk filters python description

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 <at> 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 :)

<div><div>
<div>Hi everybody, <br>
</div>
<div>&nbsp;&nbsp; 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  <at>  http://paraview.org/Wiki/ParaView/Users_Guide/List_of_filters</div>
<div>&nbsp;&nbsp; We can use <span>"threshold = paraview.Threshold({Input:proxy,ThresholdRange:[300,600]})"</span> to applicate a threshold between 300 and 600 for an image.</div>
<div>&nbsp;&nbsp; So, my question is : where can I find the python script .py which describes the way of using vtk Filters in ParaViewWeb?</div>
<div>&nbsp;&nbsp; <br>
</div>
<div>&nbsp;&nbsp; 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?<br>
</div>
<div>&nbsp;&nbsp; I mean : def ImageThreshold(proxy,ThresholdRange......) or something like that?</div>
<div>&nbsp; <br>
</div>
<div>&nbsp;&nbsp; Thank you very much for your reply.</div>
<div>&nbsp;&nbsp; Good day everybody :)</div>
<div><br></div>
</div></div>
Sebastien Jourdain | 25 Jun 2012 23:08
Favicon
Gravatar

Re: 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
>  <at>  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
>
Alex | 25 Jun 2012 23:47
Picon
Favicon

Re: ParaViewWeb, vtk filters python description

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
> <at> 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
>


<div><div>
<div><span>Hi seb, thank you for your quick reply. <br></span></div>
<div>
<span>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 </span>threshold = paraview.Threshold({Input:proxy,ThresholdRange:[300,600]}).</div>
<div>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.</div>
<div>I did succeed in doing a ParaViewWeb plugin.</div>
<div>I used your advice to define something as following :</div>
<div>def SimpleImageThreshold(proxy)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; servermanager.Activeconnection.Modules.filter.SimpleImageThreshold(proxy)</div>
<div><br></div>
<div>Now if I want my plugin to take ThresholdRange=[300,600] as
 input like the original Threshold of ParaView, is that possible?</div>
<div>If yes, how can we define this?</div>
<div>Thank you very much indeed</div>
<div><br></div>
<div><br></div>
<div><br></div>  <div> <div> <div dir="ltr">  <span>From:</span> Sebastien Jourdain &lt;sebastien.jourdain <at> kitware.com&gt;<br><span>To:</span> Alex &lt;tuanha_it0306 <at> yahoo.com&gt; <br><span>Cc:</span> "paraview <at> paraview.org" &lt;paraview <at> paraview.org&gt; <br><span>Sent:</span> Monday, June 25, 2012 11:08 PM<br><span>Subject:</span> Re: [Paraview] ParaViewWeb, vtk filters python description<br> </div> <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 <a target="_blank" href="http://pwsimple.py/">pwsimple.py</a> which is an<br>extension of the <a target="_blank" href="http://simple.py/">simple.py</a> 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 PWServer ?<br><br>Seb<br><br>On Mon, Jun 25, 2012 at 4:25 PM, Alex &lt;<a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a>&gt; wrote:<br>&gt; Hi everybody,<br>&gt; &nbsp;&nbsp; Well, I found that
 using vtk Filter (Threshold, Clip, etc.) is simple<br>&gt; within ParaViewWeb, we have a list of filters so that we can use the filters<br>&gt;  <at>  http://paraview.org/Wiki/ParaView/Users_Guide/List_of_filters<br>&gt; &nbsp;&nbsp; We can use "threshold =<br>&gt; paraview.Threshold({Input:proxy,ThresholdRange:[300,600]})" to applicate a<br>&gt; threshold between 300 and 600 for an image.<br>&gt; &nbsp;&nbsp; So, my question is : where can I find the python script .py which<br>&gt; describes the way of using vtk Filters in ParaViewWeb?<br>&gt;<br>&gt; &nbsp;&nbsp; If there isn't any file python script like that, how can we define a<br>&gt; function that take in value as described above? How can we tell the<br>&gt; ParaViewWeb to take in different type of variable?<br>&gt; &nbsp;&nbsp; I mean : def ImageThreshold(proxy,ThresholdRange......) or something like<br>&gt; that?<br>&gt;<br>&gt; &nbsp;&nbsp; Thank you very much for your reply.<br>&gt; &nbsp;&nbsp;
 Good day everybody :)<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Powered by <a target="_blank" href="http://www.kitware.com/">www.kitware.com</a><br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; http://www.kitware.com/opensource/opensource.html<br>&gt;<br>&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>&gt; http://paraview.org/Wiki/ParaView<br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; http://www.paraview.org/mailman/listinfo/paraview<br>&gt;<br><br><br>
</div> </div>  </div></div>
Sebastien Jourdain | 26 Jun 2012 00:03
Favicon
Gravatar

Re: 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
>>  <at>  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
>>
>
>
Alex | 26 Jun 2012 00:24
Picon
Favicon

Re: 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
>> <at> 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
>>
>
>


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

Re: ParaViewWeb, vtk filters python description

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
>> <at> 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


<div><div>
<div><span>In fact, <br></span></div>
<div>
<span>&nbsp;&nbsp; I call directly MyImageThreshold with threshold=paraview.MyImageThreshold({Input:reader, ...}) and I receive Uncaught Type</span><span>Error : Object #&lt;ParaView&gt; has no method 'MyImageThreshold'</span>
</div>
<div><span>&nbsp;&nbsp; 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>&nbsp; <br></span></div>
<div><span>&nbsp;&nbsp; Alex<br></span></div>
<div><br></div>  <div> <div> <div dir="ltr">  <span>From:</span> Alex &lt;tuanha_it0306 <at> yahoo.com&gt;<br><span>To:</span> Sebastien Jourdain &lt;sebastien.jourdain <at> kitware.com&gt; <br><span>Cc:</span> "paraview <at> paraview.org" &lt;paraview <at> paraview.org&gt; <br><span>Sent:</span> Tuesday, June 26, 2012 12:24 AM<br><span>Subject:</span> Re: [Paraview] ParaViewWeb, vtk filters python description<br> </div> <br><div><div><div>
<div><span>Thank you Seb,</span></div>
<div><span>&nbsp;&nbsp; You mean the ParaView plugin at startup? Indeed, I copied the dynamique library .so in <span>/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>&nbsp;&nbsp; However, I doubt that I can use the plugin directly in ParaViewWeb without loading it.</span></div>
<div><span>&nbsp;&nbsp; For exemple, I have a MyImageThresholdSMPlugin.so, also the plugin's name is MyImageThreshold. I called it sucessfully in Python Shell directly with <span>reader2=MyImageThreshold(reader,ThresholdRange=[300,600]);</span> (the values are given for
 exemple).</span></div>
<div><span>&nbsp;&nbsp; In ParaViewWeb, can I use it directly by calling <span>var reader2=paraview.MyImageThreshold({Input:reader, ThresholdRange:[300,600]});</span> ?</span></div>
<div><span>&nbsp;&nbsp; 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>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>&nbsp;&nbsp; <br></span></div>
<div><span>&nbsp;&nbsp; Alex<br></span></div>
<div><br></div>  <div> <div> <div dir="ltr">  <span>From:</span> Sebastien Jourdain &lt;sebastien.jourdain <at> kitware.com&gt;<br><span>To:</span> Alex &lt;tuanha_it0306 <at> yahoo.com&gt; <br><span>Cc:</span> "paraview <at> paraview.org" &lt;paraview <at> paraview.org&gt; <br><span>Sent:</span> Tuesday, June 26, 2012 12:03 AM<br><span>Subject:</span> Re: [Paraview] ParaViewWeb, vtk filters python description<br> </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 &lt;<a rel="nofollow" ymailto="mailto:tuanha_it0306 <at> yahoo.com" target="_blank" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a>&gt; wrote:<br>&gt; Hi seb, thank you for your quick reply.<br>&gt; I found that I can
 use vtk Filter like Threshold,
 Clip, etc. in ParaViewWeb<br>&gt; by enter the arguments like I cited in my email. Like threshold =<br>&gt; paraview.Threshold({Input:proxy,ThresholdRange:[300,600]}).<br>&gt; 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>&gt; can ParaViewWeb can use a Plugin. I search for all the .py file in ParaView<br>&gt; and I can't find something like that.<br>&gt; I did succeed in doing a ParaViewWeb plugin.<br>&gt; I used your advice to define something as following :<br>&gt; def SimpleImageThreshold(proxy)<br>&gt;<br>&gt; servermanager.Activeconnection.Modules.filter.SimpleImageThreshold(proxy)<br>&gt;<br>&gt; Now if I want my plugin to take ThresholdRange=[300,600] as input like the<br>&gt; original Threshold of ParaView, is that possible?<br>&gt; If yes, how can we define this?<br>&gt; Thank you very much indeed<br>&gt;<br>&gt;<br>&gt;<br>&gt;
 ________________________________<br>&gt; From: Sebastien Jourdain &lt;<a rel="nofollow" ymailto="mailto:sebastien.jourdain <at> kitware.com" target="_blank" href="mailto:sebastien.jourdain <at> kitware.com">sebastien.jourdain <at> kitware.com</a>&gt;<br>&gt; To: Alex &lt;<a rel="nofollow" ymailto="mailto:tuanha_it0306 <at> yahoo.com" target="_blank" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a>&gt;<br>&gt; Cc: "<a rel="nofollow" ymailto="mailto:paraview <at> paraview.org" target="_blank" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a>" &lt;<a rel="nofollow" ymailto="mailto:paraview <at> paraview.org" target="_blank" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a>&gt;<br>&gt; Sent: Monday, June 25, 2012 11:08 PM<br>&gt; Subject: Re: [Paraview] ParaViewWeb, vtk filters python description<br>&gt;<br>&gt; I'm not sure I understand what you mean by "Where is the python file<br>&gt; which describes the way of using vtk Filters in
 ParaViewWeb?"<br>&gt;<br>&gt; The one that is imported by default is the pwsimple.py which is an<br>&gt; extension of the simple.py of
 regular ParaView.<br>&gt;<br>&gt; But having said that, you can't easily mix VTK filter and ParaView<br>&gt; proxy together, unless you just want to do some data processing<br>&gt; without rendering.<br>&gt; But as I remember, you did a ParaView plugin for that, so normally,<br>&gt; once loaded you should be able to use it.<br>&gt;<br>&gt; Did you try to load that plugin at startup with the extra argument of<br>&gt; PWServer ?<br>&gt;<br>&gt; Seb<br>&gt;<br>&gt; On Mon, Jun 25, 2012 at 4:25 PM, Alex &lt;<a rel="nofollow" ymailto="mailto:tuanha_it0306 <at> yahoo.com" target="_blank" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a>&gt; wrote:<br>&gt;&gt; Hi everybody,<br>&gt;&gt; &nbsp;&nbsp; Well, I found that using vtk Filter (Threshold, Clip, etc.) is simple<br>&gt;&gt; within ParaViewWeb, we have a list of filters so that we can use the<br>&gt;&gt; filters<br>&gt;&gt;  <at> 
 http://paraview.org/Wiki/ParaView/Users_Guide/List_of_filters<br>&gt;&gt; &nbsp;&nbsp; We can use
 "threshold =<br>&gt;&gt; paraview.Threshold({Input:proxy,ThresholdRange:[300,600]})" to applicate a<br>&gt;&gt; threshold between 300 and 600 for an image.<br>&gt;&gt; &nbsp;&nbsp; So, my question is : where can I find the python script .py which<br>&gt;&gt; describes the way of using vtk Filters in ParaViewWeb?<br>&gt;&gt;<br>&gt;&gt; &nbsp;&nbsp; If there isn't any file python script like that, how can we define a<br>&gt;&gt; function that take in value as described above? How can we tell the<br>&gt;&gt; ParaViewWeb to take in different type of variable?<br>&gt;&gt; &nbsp;&nbsp; I mean : def ImageThreshold(proxy,ThresholdRange......) or something<br>&gt;&gt; like<br>&gt;&gt; that?<br>&gt;&gt;<br>&gt;&gt; &nbsp;&nbsp; Thank you very much for your reply.<br>&gt;&gt; &nbsp;&nbsp; Good day everybody :)<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Powered by www.kitware.com<br>&gt;&gt;<br>&gt;&gt; Visit
 other Kitware open-source projects at<br>&gt;&gt; http://www.kitware.com/opensource/opensource.html<br>&gt;&gt;<br>&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>&gt;&gt; http://paraview.org/Wiki/ParaView<br>&gt;&gt;<br>&gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt;&gt; http://www.paraview.org/mailman/listinfo/paraview<br>&gt;&gt;<br>&gt;<br>&gt;<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></div>
Sebastien Jourdain | 26 Jun 2012 00:48
Favicon
Gravatar

Re: ParaViewWeb, vtk filters python description

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
>>>  <at>  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
>
>
Alex | 26 Jun 2012 00:52
Picon
Favicon

Re: ParaViewWeb, vtk filters python description

I think that is the problem too (plugin is properly loaded for PWServer). But .... which initialization script are you talking about? XML or .py?


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:48 AM
Subject: Re: [Paraview] ParaViewWeb, vtk filters python description

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
>>> <at> 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
>
>


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

Re: ParaViewWeb, vtk filters python description

Please read that:

http://www.paraview.org/Wiki/ParaViewWeb_Manta_setting

Then forget Manta and do your own "manta-init.py" file that will only
load your plugin... And that's it... (You can rename the file, just
make sure you keep the consistency.)

Seb

On Mon, Jun 25, 2012 at 6:52 PM, Alex <tuanha_it0306 <at> yahoo.com> wrote:
> I think that is the problem too (plugin is properly loaded for PWServer).
> But .... which initialization script are you talking about? XML or .py?
>
>
> ________________________________
> 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:48 AM
>
> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description
>
> 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
>>>>  <at>  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
>>
>>
>
>
Alex | 26 Jun 2012 15:29
Picon
Favicon

Re: ParaViewWeb, vtk filters python description

Thank Seb,
   I'm sorry if I forget one step. But I have always Uncaught TypeError: Object #<Paraview> has no method 'ImageThresholdPFE'
I did as follow:

File ImageThreshold.py 
import paraview

paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',False)
paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',True) 

My JavaScript
$ p = paraview; var reader = p.OpenDataFile('/home/.../myfile.mhd');
$ p.loadPlugins();
$ threshold = p.ImageThresholdPFE({Input:reader, ThresholdRange:[1000,1150]});
$ threshold = p.ImageThreshold();
$ var threshold = p.ImageThresholdPFE({Input:reader, ThresholdRange:[1000,1150]});

All the 3 ways have the same error  Uncaught TypeError: Object #<Paraview> has no method 'ImageThreshold'


In fact, I used your advice with 
def ImageThreshold(proxy,a,b):
servermanager.ActiveConnection.Modules.filters.ImageThreshold(proxy,ThresholdRange=[a,b])

but each time I called
$ var threshold = p.ImageThreshold([reader],1000,1150);
 ParaViewWeb planted and I have to use kill - 9 to escape. Do you have any clue?
 Thank you very much Seb


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 2:20 PM
Subject: Re: [Paraview] ParaViewWeb, vtk filters python description

Please read that:

http://www.paraview.org/Wiki/ParaViewWeb_Manta_setting

Then forget Manta and do your own "manta-init.py" file that will only
load your plugin... And that's it... (You can rename the file, just
make sure you keep the consistency.)

Seb

On Mon, Jun 25, 2012 at 6:52 PM, Alex <tuanha_it0306 <at> yahoo.com> wrote:
> I think that is the problem too (plugin is properly loaded for PWServer).
> But .... which initialization script are you talking about? XML or .py?
>
>
> ________________________________
> 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:48 AM
>
> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description
>
> 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
>>>> <at> 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
>>
>>
>
>


<div><div>
<div><span>Thank Seb,</span></div>
<div>
<span>&nbsp; &nbsp;I'm sorry if I forget one step. But I have always&nbsp;</span><span>Uncaught TypeError: Object #&lt;Paraview&gt; has no method 'ImageThresholdPFE'</span>
</div>
<div>
<span>  </span><span>I did as follow:</span>
</div>
<div><span><br></span></div>
<div><span>File ImageThreshold.py&nbsp;</span></div>
<div>
<div><span>import paraview</span></div>
<div><span><br></span></div>
<div><span>paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',False)</span></div>
<div><span>paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',True)&nbsp;</span></div>
<div><br></div>
</div>
<div>My JavaScript</div>
<div>
<div>$ p = paraview; var reader = p.OpenDataFile('/home/.../myfile.mhd');<div></div>
</div>
<div>$ p.loadPlugins();<div></div>
</div>
<div>$ threshold = p.ImageThresholdPFE({Input:reader, ThresholdRange:[1000,1150]});</div>
<div><div></div></div>
<div>$ threshold =
 p.ImageThreshold();</div>
<div><div></div></div>
<div>$ var threshold = p.ImageThresholdPFE({Input:reader, ThresholdRange:[1000,1150]});</div>
</div>  <div> <div> <div dir="ltr"><br></div>
<div dir="ltr"> All the 3 ways have the same error&nbsp;<span>&nbsp;</span><span>Uncaught TypeError: Object #&lt;Paraview&gt; has no method 'ImageThreshold'</span>
</div>
<div dir="ltr"><span><br></span></div>
<div dir="ltr"><span><br></span></div>
<div dir="ltr"><span><span>In fact, I used your advice with&nbsp;</span><br></span></div>
<div dir="ltr"><span><div dir="ltr"><span>def ImageThreshold(proxy,a,b):</span></div>
<div dir="ltr"><span><span class="Apple-tab-span">	</span>servermanager.ActiveConnection.Modules.filters.ImageThreshold(proxy,ThresholdRange=[a,b])</span></div>
<div dir="ltr"><span><br></span></div>
<div dir="ltr"><span>but each time I called</span></div>
<div dir="ltr"><span><span>$ var threshold =
 p.ImageThreshold([reader],1000,1150);</span><br></span></div>
<div dir="ltr"><span><span>&nbsp;ParaViewWeb planted and I have to use kill - 9 to escape. Do you have any clue?</span><br></span></div>
<div dir="ltr"><span><span>&nbsp;Thank you very much Seb</span></span></div>
<div><br></div></span></div>
<div dir="ltr">
<span><br></span><span>From:</span><span> Sebastien Jourdain &lt;sebastien.jourdain <at> kitware.com&gt;</span><br><span>To:</span><span> Alex &lt;tuanha_it0306 <at> yahoo.com&gt; </span><br><span>Cc:</span><span> "paraview <at> paraview.org" &lt;paraview <at> paraview.org&gt; </span><br><span>Sent:</span><span> Tuesday, June 26, 2012 2:20 PM</span><br><span>Subject:</span><span> Re: [Paraview] ParaViewWeb, vtk filters python description</span><br> </div> <br><span>
Please read that:</span><br><br><span>http://www.paraview.org/Wiki/ParaViewWeb_Manta_setting</span><br><br><span>Then forget Manta and do your own "</span><a target="_blank" href="http://manta-init.py/">manta-init.py</a><span>" file that will only</span><br><span>load your plugin... And that's it... (You can rename the file, just</span><br><span>make sure you keep the consistency.)</span><br><br><span>Seb</span><br><br><span>On Mon, Jun 25, 2012 at 6:52 PM, Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt;
 wrote:</span><br><span>&gt; I think that is the problem too (plugin is properly loaded for PWServer).</span><br><span>&gt; But .... which initialization script are you talking about? XML or .py?</span><br><span>&gt;</span><br><span>&gt;</span><br><span>&gt; ________________________________</span><br><span>&gt; From: Sebastien Jourdain &lt;</span><a ymailto="mailto:sebastien.jourdain <at> kitware.com" href="mailto:sebastien.jourdain <at> kitware.com">sebastien.jourdain <at> kitware.com</a><span>&gt;</span><br><span>&gt; To: Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt;</span><br><span>&gt; Cc: "</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>" &lt;</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>&gt;</span><br><span>&gt; Sent: Tuesday, June 26, 2012 12:48 AM</span><br><span>&gt;</span><br><span>&gt; Subject: Re: [Paraview] ParaViewWeb, vtk filters python description</span><br><span>&gt;</span><br><span>&gt; I don't believe the plugin is
 properly loaded for PWServer... Did you</span><br><span>&gt; write the proper initialization script ?</span><br><span>&gt;</span><br><span>&gt; On Mon, Jun 25, 2012 at 6:36 PM, Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt; wrote:</span><br><span>&gt;&gt; In fact,</span><br><span>&gt;&gt; &nbsp;&nbsp; I call directly MyImageThreshold with</span><br><span>&gt;&gt; threshold=paraview.MyImageThreshold({Input:reader, ...}) and I receive</span><br><span>&gt;&gt; Uncaught TypeError : Object #&lt;ParaView&gt; has no method 'MyImageThreshold'</span><br><span>&gt;&gt;
 &nbsp;&nbsp; when I use threshold = paravie.Threshold(....) (origin threshold of</span><br><span>&gt;&gt; ParaView) then it works. That why I think that we have to use some kind of</span><br><span>&gt;&gt; descriptor?</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; &nbsp;&nbsp; Alex</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; ________________________________</span><br><span>&gt;&gt; From: Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt;</span><br><span>&gt;&gt; To: Sebastien Jourdain &lt;</span><a ymailto="mailto:sebastien.jourdain <at> kitware.com" href="mailto:sebastien.jourdain <at> kitware.com">sebastien.jourdain <at> kitware.com</a><span>&gt;</span><br><span>&gt;&gt; Cc: "</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>" &lt;</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>&gt;</span><br><span>&gt;&gt; Sent: Tuesday, June 26, 2012 12:24 AM</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; Subject: Re: [Paraview] ParaViewWeb, vtk filters python
 description</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; Thank you Seb,</span><br><span>&gt;&gt; &nbsp;&nbsp; You mean the ParaView plugin at startup? Indeed, I copied the dynamique</span><br><span>&gt;&gt; library .so in /install/lib/paraview-3.14/plugins and the plugin is loaded</span><br><span>&gt;&gt; automatically into ParaView. It is then usable immediately in Python</span><br><span>&gt;&gt; Shell.</span><br><span>&gt;&gt; &nbsp;&nbsp; However, I doubt that I can use the plugin directly in ParaViewWeb</span><br><span>&gt;&gt; without loading it.</span><br><span>&gt;&gt; &nbsp;&nbsp; For exemple, I have a MyImageThresholdSMPlugin.so, also the plugin's</span><br><span>&gt;&gt; name</span><br><span>&gt;&gt; is MyImageThreshold. I called it sucessfully in Python Shell directly with</span><br><span>&gt;&gt; reader2=MyImageThreshold(reader,ThresholdRange=[300,600]); (the values are</span><br><span>&gt;&gt; given for exemple).</span><br><span>&gt;&gt; &nbsp;&nbsp; In ParaViewWeb, can I use it directly by calling var</span><br><span>&gt;&gt; reader2=paraview.MyImageThreshold({Input:reader,</span><br><span>&gt;&gt; ThresholdRange:[300,600]});</span><br><span>&gt;&gt; ?</span><br><span>&gt;&gt; &nbsp;&nbsp; In your previous reply, I have to load a Plugin by LoadPlugin command</span><br><span>&gt;&gt; from </span><a target="_blank" href="http://simple.py/">simple.py</a><span>. And then define a function that call the</span><br><span>&gt;&gt; servermanager.Activeconnection.Modules.filters.MyImageThreshold(proxy) I</span><br><span>&gt;&gt; wonder if they are the same thing? That why I ask if we have to write a</span><br><span>&gt;&gt; MyImageThreshold.py so that our plugin is usable in ParaViewWeb.</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; &nbsp;&nbsp; Alex</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; ________________________________</span><br><span>&gt;&gt; From: Sebastien Jourdain &lt;</span><a ymailto="mailto:sebastien.jourdain <at> kitware.com" href="mailto:sebastien.jourdain <at> kitware.com">sebastien.jourdain <at> kitware.com</a><span>&gt;</span><br><span>&gt;&gt; To: Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt;</span><br><span>&gt;&gt; Cc: "</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>" &lt;</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>&gt;</span><br><span>&gt;&gt; Sent: Tuesday, June 26,
 2012 12:03 AM</span><br><span>&gt;&gt; Subject: Re: [Paraview] ParaViewWeb, vtk filters python description</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; If you managed to load your plugin (the C++ ParaView one) at startup,</span><br><span>&gt;&gt; then you will be able to use your filter as any other filter in</span><br><span>&gt;&gt; ParaViewWeb without using any ParaViewWeb plugin. Otherwise, the</span><br><span>&gt;&gt; python file that you are missing is in fact an XML file that list the</span><br><span>&gt;&gt; properties for each filters and sources inside ParaView.</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; PARAVIEW_src/ParaViewCore/ServerImplementation/resources/filter.xml</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; The labels without space are used as filter name and properties for</span><br><span>&gt;&gt; creating and controlling those filters...</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; Otherwise inside your ParaViewWeb plugin, you can provide a dictionary</span><br><span>&gt;&gt; as argument and just loop through its entry and set them in python.</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; Seb</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; On Mon, Jun 25, 2012 at 5:47 PM, Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt; wrote:</span><br><span>&gt;&gt;&gt; Hi seb, thank you for your quick reply.</span><br><span>&gt;&gt;&gt; I found that I can use vtk Filter like Threshold, Clip, etc. in</span><br><span>&gt;&gt;&gt; ParaViewWeb</span><br><span>&gt;&gt;&gt; by enter the arguments like I cited in my email. Like threshold =</span><br><span>&gt;&gt;&gt; paraview.Threshold({Input:proxy,ThresholdRange:[300,600]}).</span><br><span>&gt;&gt;&gt; So I think there are perhaps some files like pwsimple.py that describe</span><br><span>&gt;&gt;&gt; how</span><br><span>&gt;&gt;&gt; can ParaViewWeb can use a Plugin. I search for all the .py file in</span><br><span>&gt;&gt;&gt; ParaView</span><br><span>&gt;&gt;&gt; and I can't find something like that.</span><br><span>&gt;&gt;&gt; I did succeed in doing a ParaViewWeb plugin.</span><br><span>&gt;&gt;&gt; I used your advice to define something as following :</span><br><span>&gt;&gt;&gt; def SimpleImageThreshold(proxy)</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; servermanager.Activeconnection.Modules.filter.SimpleImageThreshold(proxy)</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; Now if I want my plugin to take ThresholdRange=[300,600] as input like</span><br><span>&gt;&gt;&gt; the</span><br><span>&gt;&gt;&gt; original Threshold of ParaView, is that possible?</span><br><span>&gt;&gt;&gt; If yes, how can we define
 this?</span><br><span>&gt;&gt;&gt; Thank you very much indeed</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; ________________________________</span><br><span>&gt;&gt;&gt; From: Sebastien Jourdain &lt;</span><a ymailto="mailto:sebastien.jourdain <at> kitware.com" href="mailto:sebastien.jourdain <at> kitware.com">sebastien.jourdain <at> kitware.com</a><span>&gt;</span><br><span>&gt;&gt;&gt; To: Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt;</span><br><span>&gt;&gt;&gt; Cc: "</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>" &lt;</span><a ymailto="mailto:paraview <at> paraview.org" href="mailto:paraview <at> paraview.org">paraview <at> paraview.org</a><span>&gt;</span><br><span>&gt;&gt;&gt; Sent: Monday, June 25, 2012 11:08 PM</span><br><span>&gt;&gt;&gt; Subject: Re: [Paraview] ParaViewWeb, vtk filters python description</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; I'm not sure I understand what you mean by "Where is the python file</span><br><span>&gt;&gt;&gt; which describes the way of using vtk Filters in ParaViewWeb?"</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; The one that is imported by default is the pwsimple.py which is an</span><br><span>&gt;&gt;&gt; extension of the simple.py of regular ParaView.</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; But having said that, you can't easily mix VTK filter and ParaView</span><br><span>&gt;&gt;&gt; proxy together, unless you just want to do some data processing</span><br><span>&gt;&gt;&gt; without rendering.</span><br><span>&gt;&gt;&gt; But as I remember, you did a ParaView plugin for that, so normally,</span><br><span>&gt;&gt;&gt; once loaded you should be able to use it.</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; Did you try to load that plugin at startup with the extra argument of</span><br><span>&gt;&gt;&gt; PWServer ?</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; Seb</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt; On Mon, Jun 25, 2012 at 4:25 PM, Alex &lt;</span><a ymailto="mailto:tuanha_it0306 <at> yahoo.com" href="mailto:tuanha_it0306 <at> yahoo.com">tuanha_it0306 <at> yahoo.com</a><span>&gt; wrote:</span><br><span>&gt;&gt;&gt;&gt; Hi everybody,</span><br><span>&gt;&gt;&gt;&gt; &nbsp;&nbsp; Well, I found that using vtk Filter (Threshold, Clip, etc.) is simple</span><br><span>&gt;&gt;&gt;&gt; within ParaViewWeb, we have a list of filters so that we can use the</span><br><span>&gt;&gt;&gt;&gt; filters</span><br><span>&gt;&gt;&gt;&gt;  <at>  </span><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><span>&gt;&gt;&gt;&gt; &nbsp;&nbsp; We can use "threshold =</span><br><span>&gt;&gt;&gt;&gt; paraview.Threshold({Input:proxy,ThresholdRange:[300,600]})" to applicate</span><br><span>&gt;&gt;&gt;&gt; a</span><br><span>&gt;&gt;&gt;&gt; threshold between 300 and 600 for an image.</span><br><span>&gt;&gt;&gt;&gt; &nbsp;&nbsp; So, my question is : where can I
 find the python script .py which</span><br><span>&gt;&gt;&gt;&gt; describes the way of using vtk Filters in ParaViewWeb?</span><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt; &nbsp;&nbsp; If there isn't any file python script like that, how can we define a</span><br><span>&gt;&gt;&gt;&gt; function that take in value as described above? How can we tell the</span><br><span>&gt;&gt;&gt;&gt; ParaViewWeb to take in different type of variable?</span><br><span>&gt;&gt;&gt;&gt; &nbsp;&nbsp; I mean : def ImageThreshold(proxy,ThresholdRange......) or something</span><br><span>&gt;&gt;&gt;&gt; like</span><br><span>&gt;&gt;&gt;&gt; that?</span><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt;
 &nbsp;&nbsp; Thank you very much for your reply.</span><br><span>&gt;&gt;&gt;&gt; &nbsp;&nbsp; Good day everybody :)</span><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt; _______________________________________________</span><br><span>&gt;&gt;&gt;&gt; Powered by www.kitware.com</span><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt; Visit other Kitware open-source projects at</span><br><span>&gt;&gt;&gt;&gt; </span><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:</span><br><span>&gt;&gt;&gt;&gt; </span><a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:</span><br><span>&gt;&gt;&gt;&gt; </span><a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br><span>&gt;&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;&gt;</span><br><span>&gt;&gt;</span><br><span>&gt;&gt;</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; _______________________________________________</span><br><span>&gt;&gt; Powered by www.kitware.com</span><br><span>&gt;&gt;</span><br><span>&gt;&gt; Visit other Kitware open-source projects at</span><br><span>&gt;&gt; </span><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><span>&gt;&gt;</span><br><span>&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:</span><br><span>&gt;&gt; </span><a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br><span>&gt;&gt;</span><br><span>&gt;&gt; Follow this link to subscribe/unsubscribe:</span><br><span>&gt;&gt; </span><a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br><span>&gt;&gt;</span><br><span>&gt;&gt;</span><br><span>&gt;</span><br><span>&gt;</span><br><br><br>
</div> </div>  </div></div>
Sebastien Jourdain | 26 Jun 2012 16:10
Favicon
Gravatar

Re: ParaViewWeb, vtk filters python description

What I'm talking about is a "--batch-file" not a ParaViewWeb plugin.
But never mind, if you really want to use a ParaViewWeb plugin you are
stuck by the fact that your ParaView object in JavaScript will NEVER
have your custom filter definition available. Which is NORMAL, and
that's why you get those errors.

The only way you can overcome that issue is to work directly on the
sever side using ParaViewWeb plugins. Which is what you basically do
now...

But your JavaScript should look like that (based on what you did.)

p = paraview;
var reader = p.OpenDataFile('/home/.../myfile.mhd');
p.loadPlugins();
p.plugins.ImageThreshold.ImageThreshold(reader, 1000,1150);

/// Here is the explanation of how the call is made:
// => p.plugins.${python file name}.${method name in your python
file}( the arguments of your methods )

But once AGAIN, if you start PWServer with the --batch-file argument
and a script that LOAD the ParaView plugin, then you will be able to
do that:

p = paraview;
var reader = p.OpenDataFile('/home/.../myfile.mhd');
p.ImageThreshold({proxy: reader,ThresholdRange:[a,b]})

Here is an example on what that batch-file should look like:

## init.py
import paraview
paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',False)
paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',True)

On Tue, Jun 26, 2012 at 9:29 AM, Alex <tuanha_it0306 <at> yahoo.com> wrote:
> Thank Seb,
>    I'm sorry if I forget one step. But I have always Uncaught TypeError:
> Object #<Paraview> has no method 'ImageThresholdPFE'
> I did as follow:
>
> File ImageThreshold.py
> import paraview
>
> paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',False)
> paraview.simple.LoadPlugin('/home/.../vtkImageThreshold/bin/libImageThresholdSMPlugin.so',True)
>
> My JavaScript
> $ p = paraview; var reader = p.OpenDataFile('/home/.../myfile.mhd');
> $ p.loadPlugins();
> $ threshold = p.ImageThresholdPFE({Input:reader,
> ThresholdRange:[1000,1150]});
> $ threshold = p.ImageThreshold();
> $ var threshold = p.ImageThresholdPFE({Input:reader,
> ThresholdRange:[1000,1150]});
>
> All the 3 ways have the same error  Uncaught TypeError: Object #<Paraview>
> has no method 'ImageThreshold'
>
>
> In fact, I used your advice with
> def ImageThreshold(proxy,a,b):
> servermanager.ActiveConnection.Modules.filters.ImageThreshold(proxy,ThresholdRange=[a,b])
>
> but each time I called
> $ var threshold = p.ImageThreshold([reader],1000,1150);
>  ParaViewWeb planted and I have to use kill - 9 to escape. Do you have any
> clue?
>  Thank you very much Seb
>
>
> ________________________________
> 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 2:20 PM
>
> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description
>
> Please read that:
>
> http://www.paraview.org/Wiki/ParaViewWeb_Manta_setting
>
> Then forget Manta and do your own "manta-init.py" file that will only
> load your plugin... And that's it... (You can rename the file, just
> make sure you keep the consistency.)
>
> Seb
>
> On Mon, Jun 25, 2012 at 6:52 PM, Alex <tuanha_it0306 <at> yahoo.com> wrote:
>> I think that is the problem too (plugin is properly loaded for PWServer).
>> But .... which initialization script are you talking about? XML or .py?
>>
>>
>> ________________________________
>> 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:48 AM
>>
>> Subject: Re: [Paraview] ParaViewWeb, vtk filters python description
>>
>> 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
>>>>>  <at>  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
>>>
>>>
>>
>>
>
>

Gmane