[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    Re: [vtkusers] VTK Time support
From:       Dan Lipsa <dan.lipsa () kitware ! com>
Date:       2015-05-22 21:01:27
Message-ID: CADwGrVoFOYWBS5YeLA0W7yNb-dkjKPq6qi5A-j7KksYs5_oV+Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Evan,
Probably the easiest route is to directly use ParaView from python, instead
of trying to replicate ParaView behavior using VTK.

Checkout
http://www.paraview.org/paraview-guide/

You'll have to use pvpython so checkout all sections that mention this in
their title. For instance section 2.2.1 deals with temporal file series.

Dan



On Fri, May 22, 2015 at 4:17 PM, Evan Kao <tossin@gmail.com> wrote:

> Hello Dan,
>
> Thanks for the info.  In this case, the VTK counterparts seem to be
> straightforward, but I think there might be something going on in Paraview
> behind the scenes that I don't understand, especially since not all readers
> seem to be able to handle time-dependent data.
>
> For instance, reading in time-dependent EnSight data into ParaView and
> applying the Temporal Interpolator filter is pretty trivial.  But I can't
> figure out how to replicate this in VTK using the related filters
> vtkGenericEnSightReader and vtkTemporalInterpolator, since the former
> doesn't seem to innately read time series (it will can 1 timepoint at a
> time).
>
> I'm specifically wondering if I can there is a reader and corresponding
> data format that exists that would allow me to simply use its output as the
> input to a streaming filter like:
>
> reader = vtk.vtkSomeReader()
> reader.SetFileName(filename)
> ti = vtk.vtkTemporalInterpolator()
> ti.SetInputConnection(reader.GetOutputPort())
> ti.Update()
>
> But it seems like I probably can't avoid learning the VTK Pipeline and
> using vtkPythonAlgorithm or vtkProgrammableSource/Filter.
>
>
> On a related note, in my attempts to emulate some Paraview features, I've
> tried playing around with some of Paraview-specific VTK classes by
> importing from paraview.pvvtkextensions, but I get a TypeError ("method
> requires a VTK object") when I attempt to mix and match VTK objects that
> were created using another VTK library, e.g.:
>
> import paraview.pvvvtkextensions as pvvtk
> import vtk
>
> a = pvvtk.vtkPGenericEnsightReader()
> b = vtk.vtkTemporalInterpolator()
> b.SetInputConnection(a.GetOutputPort())
>
> TypeError: SetInputData argument 1: method requires a VTK object
>
> I noticed this occurs when I try to mix and match VTK versions (e.g. 6.1
> and 5.10), but in this case, both versions of VTK are the same (6.1).
> Paraview and VTK were both installed using binaries.  Why does this occur,
> and is there a way to avoid this?
>
> Thanks,
> Evan Kao
>
> On Fri, May 22, 2015 at 7:07 AM, Dan Lipsa <dan.lipsa@kitware.com> wrote:
>
>> You can see the vtk class used by a particular ParaView filter in
>> ./ParaViewCore/ServerManager/SMApplication/Resources/filters.xml
>>
>> Search for the filter name in name="..." attribute, the class will be
>> specified in class="...".
>> There is also a readers.xml file in the same folder to look for readers.
>>
>> Dan
>>
>>
>>
>> On Thu, May 21, 2015 at 6:45 PM, Evan Kao <tossin@gmail.com> wrote:
>>
>>> Thanks for the explanation.  I had another related question when it
>>> comes to reading (and possibly writing) data as a time series.  Is it
>>> possible to emulate in VTK say a very simple Paraview pipeline, where I
>>> basically just apply 2 classes, a reader and a streaming filter e.g. the
>>> equivalent of File > Open, Filters > Temporal Interpolator in Paraview?
>>> And if so, which readers/file formats could work?
>>>
>>
>>
>

[Attachment #5 (text/html)]

<div dir="ltr">Evan,<div>Probably the easiest route is to directly use ParaView from \
python, instead of trying to replicate ParaView behavior using \
VTK.</div><div><br></div><div>Checkout  </div><div><a \
href="http://www.paraview.org/paraview-guide/">http://www.paraview.org/paraview-guide/</a><br></div><div><br></div><div>You&#39;ll \
have to use pvpython so checkout all sections that mention this in their title. For \
instance section 2.2.1 deals with temporal file \
series.</div><div><br></div><div>Dan</div><div><br></div><div><br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, May 22, 2015 at 4:17 PM, \
Evan Kao <span dir="ltr">&lt;<a href="mailto:tossin@gmail.com" \
target="_blank">tossin@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div><div>Hello Dan,<br><br></div>Thanks for \
the info.   In this case, the VTK counterparts seem to be straightforward, but I \
think there might be something going on in Paraview behind the scenes that I \
don&#39;t understand, especially since not all readers seem to be able to handle \
time-dependent data.<br><br></div><div>For instance, reading in time-dependent \
EnSight data into ParaView and applying the Temporal Interpolator filter is pretty \
trivial.   But I can&#39;t figure out how to replicate this in VTK using the related \
filters vtkGenericEnSightReader and vtkTemporalInterpolator, since the former \
doesn&#39;t seem to innately read time series (it will can 1 timepoint at a \
time).<br></div><div><br>I&#39;m specifically wondering if I can there is a reader \
and corresponding data format that exists that would allow me to simply use its \
output as the input to a streaming filter like:<br><br></div><div><font \
size="2"><span style="font-family:monospace,monospace">reader = \
vtk.vtkSomeReader()<br></span></font></div><div><font size="2"><span \
style="font-family:monospace,monospace">reader.SetFileName(filename)<br>ti = \
vtk.vtkTemporalInterpolator()<br>ti.SetInputConnection(reader.GetOutputPort())<br></span></font></div><div><font \
size="2"><span style="font-family:monospace,monospace">ti.Update()</span></font><br></div><div><br></div><div>But \
it seems like I probably can&#39;t avoid learning the VTK Pipeline and using \
vtkPythonAlgorithm or vtkProgrammableSource/Filter.<br><br><br></div><div>On a \
related note, in my attempts to emulate some Paraview features, I&#39;ve tried \
playing around with some of Paraview-specific VTK classes by importing from \
paraview.pvvtkextensions, but I get a TypeError (&quot;method requires a VTK \
object&quot;) when I attempt to mix and match VTK objects that were created using \
another VTK library, e.g.:<br><span \
style="font-family:monospace,monospace"><br></span></div><div><span \
style="font-family:monospace,monospace">import paraview.pvvvtkextensions as \
pvvtk<br></span></div><div><span style="font-family:monospace,monospace">import \
vtk<br><br></span></div><div><span style="font-family:monospace,monospace">a = \
pvvtk.vtkPGenericEnsightReader()<br></span></div><div><span \
style="font-family:monospace,monospace">b = \
vtk.vtkTemporalInterpolator()<br></span></div><div><span \
style="font-family:monospace,monospace">b.SetInputConnection(a.GetOutputPort())<br></span></div><div><span \
style="font-family:monospace,monospace"><br><span \
style="color:rgb(255,0,0)">TypeError: SetInputData argument 1: method requires a VTK \
object</span></span><br><br>I noticed this occurs when I try to mix and match VTK \
versions (e.g. 6.1 and 5.10), but in this case, both versions of VTK are the same \
(6.1).   Paraview and VTK were both installed using binaries.   Why does this occur, \
and is there a way to avoid this?<br><br></div><div>Thanks,<br></div><div>Evan \
Kao<br></div></div><div class="HOEnZb"><div class="h5"><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, May 22, 2015 at 7:07 AM, Dan \
Lipsa <span dir="ltr">&lt;<a href="mailto:dan.lipsa@kitware.com" \
target="_blank">dan.lipsa@kitware.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">You can see the vtk class used by a particular \
ParaView filter in<div>./ParaViewCore/ServerManager/SMApplication/Resources/filters.xml<br></div><div><br></div><div>Search \
for the filter name in name=&quot;...&quot; attribute, the class will be specified in \
class=&quot;...&quot;.</div><div>There is also a readers.xml file in the same folder \
to look for readers.</div><span><font \
color="#888888"><div><br></div><div>Dan</div><div><br></div><div><br></div></font></span></div><div><div><div \
class="gmail_extra"><br><div class="gmail_quote">On Thu, May 21, 2015 at 6:45 PM, \
Evan Kao <span dir="ltr">&lt;<a href="mailto:tossin@gmail.com" \
target="_blank">tossin@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div>Thanks for the explanation.   I had \
another related question when it comes to reading (and possibly writing) data as a \
time series.   Is it possible to emulate in VTK say a very simple Paraview pipeline, \
where I basically just apply 2 classes, a reader and a streaming filter e.g. the \
equivalent of File &gt; Open, Filters &gt; Temporal Interpolator in Paraview?   And \
if so, which readers/file formats could work?</div></div> \
</blockquote></div><br></div> </div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>



_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic