[Paraview] Custom Filter with Input to pipe to Programmable Filter

Cory Quammen cory.quammen at kitware.com
Wed Apr 18 09:21:25 EDT 2018


On Wed, Apr 18, 2018 at 8:21 AM, David E DeMarle <dave.demarle at kitware.com>
wrote:

> good news:
> programmable source/filter has a property called Parameters that lets you
> pass in arbitrary values.
> See an example of its use in the standard benchmark here:
> https://gitlab.kitware.com/paraview/paraview/blob/master/Wra
> pping/Python/paraview/benchmark/manyspheres.py#L168
>
> bad news:
> To my knowledge we have never exposed that property to the end user in the
> Qt parts of the GUI. If someone can provide a good example of a qt plugin
> or otherwise that exposes parameters to the end user, please advise on this
> thread.
>

You can do what is described in this blog post to package your programmable
source nicely with modifiable attributes. See https://blog.kitware.com/e
asy-customization-of-the-paraview-python-programmable-filter-property-panel/
for details (it is 5 years old, but still applicable to ParaView 5.5).

You may also be interested in this project by Shuhao Wu on GitHub:
https://github.com/shuhaowu/pvpyfilter. I haven't used it yet, but it looks
handy.

Thanks,
Cory


>
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
> On Wed, Apr 18, 2018 at 4:41 AM, Arno Mayrhofer <
> arno.mayrhofer at dcs-computing.com> wrote:
>
>> Hi all,
>>
>> I have made a small Programmable Filter that converts my input data. Now
>> I have one parameter (resolution) that I would like to be modifiable by the
>> user. My script currently looks as follows:
>>
>> resolution = 20
>> val = {'resolution': resolution, 'self': self}
>>
>> execfile('/path/to/filter.py', val)
>>
>>
>> Ideally I want my users to not have to replace the 20 by whatever value
>> they desire, but instead make a Custom Filter with either a text input
>> field or a slider that will pipe its value to the Programmable Filter. Is
>> something like this possible at all?
>>
>> Thanks in advance for your help,
>> Arno
>>
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> https://public.kitware.com/mailman/listinfo/paraview
>>
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/paraview
>
>


-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180418/6052194e/attachment.html>


More information about the ParaView mailing list