<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
On 07/18/2015 05:17 PM, Berk Geveci wrote:<br>
</div>
<blockquote
cite="mid:CAE32kpXDT5cq51PBged+9HF=pFcpEMJeZq9oJGaC6Mmqx2coSA@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">To elaborate on what Andy said, you can stick your
entire VTK script in side the programmable source. Which you can
use in batch mode as well. If you want to keep your VTK script
as a reusable code, I recommend making it a module that you
import from the programmable source.</div>
</blockquote>
<br>
So if the last thing my VTK script does is set up a vtkImageImport
object should that work as a programmable source (I tried but
ParaView didn't get any bounds or scalar field name even though I
set them up)? If not, what else do I need to do? Thanks.<br>
<br>
-jeff<br>
<br>
<blockquote
cite="mid:CAE32kpXDT5cq51PBged+9HF=pFcpEMJeZq9oJGaC6Mmqx2coSA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Best,</div>
<div>-berk</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jul 14, 2015 at 3:43 PM, Jeff
Becker <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:jeffrey.c.becker@nasa.gov" target="_blank">jeffrey.c.becker@nasa.gov</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<div>On 07/14/2015 12:20 PM, Andy Bauer wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">ParaView's Python Programmable Filter
and Python Programmable Source use VTK Python
wrapping to do the work while making it available in
Paraview. Check out <a moz-do-not-send="true"
href="http://www.paraview.org/Wiki/Python_Programmable_Filter"
target="_blank">http://www.paraview.org/Wiki/Python_Programmable_Filter</a>.<br>
</div>
</blockquote>
<br>
</span> Thanks. That's pretty neat, but what I'd really
like is a standalone script I can run in batch mode (no
interaction) to generate one png file per timestep for all
the timesteps in the data set. Essentially I'd like a way
to construct a pipeline between the vtk.vtkImageImport()
object and the ParaView renderView1.<span class="HOEnZb"><font
color="#888888"><br>
<br>
-jeff</font></span>
<div>
<div class="h5"><br>
<blockquote type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jul 14, 2015 at
2:59 PM, Jeff Becker <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:jeffrey.c.becker@nasa.gov"
target="_blank">jeffrey.c.becker@nasa.gov</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">Hi.<br>
<br>
As a proof of concept, I have a vtk script
that reads some binary data, and produces a
vti file. I then have a second script that I
generated using ParaView's tracing facility
while viewing the data. Now I'd like to
combine them, so as to eliminate the
intermediate file, i.e., go from binary data
directly to rendering. To be specific, my vtk
script ends like this:<br>
<br>
steinbmag = steinbmag.reshape(nx,ny,nz).T<br>
<br>
vtkImporter = vtk.vtkImageImport()<br>
vtkImporter.CopyImportVoidPointer(steinbmag,
steinbmag.nbytes)<br>
<br>
vtkImporter.SetDataScalarTypeToFloat()<br>
vtkImporter.SetNumberOfScalarComponents(1)<br>
vtkImporter.SetDataExtent(0, nx-1, 0, ny-1, 0,
nz-1)<br>
vtkImporter.SetWholeExtent(0, nx-1, 0, ny-1,
0, nz-1)<br>
vtkImporter.SetScalarArrayName('B field
magnitude')<br>
<br>
writer=vtk.vtkXMLImageDataWriter()<br>
writer.SetFileName(out_fname)<br>
writer.SetInputConnection(vtkImporter.GetOutputPort())<br>
writer.Write()<br>
<br>
and the ParaView script starts like this:<br>
<br>
from paraview.simple import *<br>
<br>
paraview.simple._DisableFirstRenderCameraReset()<br>
<br>
filepfx = '/nobackup/jcbecker/steinBmag_0'<br>
infile = filepfx+'.vti'<br>
# create a new 'XML Image Data Reader'<br>
steinBmag_ =
XMLImageDataReader(FileName=infile)<br>
steinBmag_.CellArrayStatus = []<br>
steinBmag_.PointArrayStatus = ['B field
magnitude']<br>
<br>
# get animation scene<br>
animationScene1 = GetAnimationScene()<br>
<br>
# update animation scene based on data
timesteps<br>
animationScene1.UpdateAnimationUsingDataTimeSteps()<br>
<br>
# get active view<br>
renderView1 =
GetActiveViewOrCreate('RenderView')<br>
# uncomment following to set a specific view
size<br>
renderView1.ViewSize = [1090, 761]<br>
<br>
I'm looking at the VTK examples and pvpython
documentation, but any help is appreciated.<br>
<br>
Thanks.<br>
<br>
-jeff<br>
_______________________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com"
rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the
ParaView Wiki at: <a moz-do-not-send="true"
href="http://paraview.org/Wiki/ParaView"
rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a
moz-do-not-send="true"
href="http://markmail.org/search/?q=ParaView"
rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/paraview"
rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" rel="noreferrer"
target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki
at: <a moz-do-not-send="true"
href="http://paraview.org/Wiki/ParaView" rel="noreferrer"
target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a moz-do-not-send="true"
href="http://markmail.org/search/?q=ParaView"
rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/paraview"
rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>