[Paraview] Python array data into Paraview with simultaneous manipulation by Programmable Filter

Cory Quammen cory.quammen at kitware.com
Tue Oct 27 13:29:20 EDT 2015


>
> Is there a way to conduct this procedure all in one fell swoop in the
> Python Shell?


Yes. You may want to write your Python script in a text file that you can
run in ParaView's Python Shell via the "Run Script" button.


> The main things I am curious about are 1) whether I can load a data from a
> Python array into Paraview as x, y, and z coordinates and


Yes. Do you have your data in numpy arrays? If so, see this series of blog
posts on Numpy and ParaView for more info:
http://www.kitware.com/blog/home/post/709


> 2) whether there’s a way to control the creation of a Programmable Filter
> from the Python shell.
>

Yes.

programmableSource1 = ProgrammableSource()
programmableSource1.Script = 'import vtk'
programmableSource1.ScriptRequestInformation = ''
programmableSource1.PythonPath = ''

Note that this requires you to write the Python script for the Programmable
Source as a string in your main Python script. Of course, you can also load
it from a file or some other source you may have.

HTH,
Cory


>
>
> --
> Eli Medvescek
> Duke University '17 | Biomedical Engineering
> 520.780.6888
> eli.medvescek at duke.edu
>
>
>
> _______________________________________________
> 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:
> http://public.kitware.com/mailman/listinfo/paraview
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151027/148a409b/attachment.html>


More information about the ParaView mailing list