[Paraview] Scripting Paraview.

Mike Jackson imikejackson at gmail.com
Fri Jul 21 12:46:16 EDT 2006


Bingo.. that is exactly what I needed. So replaced the top part of a
trace file with:

set kw(vtkTemp2) [$Application GetMainWindow]
set kw(vtkTemp1015) [[$Application GetMainWindow] GetCurrentPVSource]

and now all I have to do is load up my .vti file (from a very specific
simulation run, the one with 600 data sets) and the pipeline is
applied and I get my mesh. Hurray....

Now, on to figure out how to do the animation with out crashing.

Thanks to everyone that helped.

Mike Jackson

On 7/21/06, shawn mckenzie <shawn.mcknezie at gmail.com> wrote:
> Not sure if this is what you need....
>
> # If you want the currently selected object in the menu
> set currentlyViewedObject [[$application GetMainWindow] GetCurrentPVSource]
>
> # Or loop through all menu objects applying your pipeline
> set sources [[$application GetMainWindow] GetSourceList Sources]
> set num [$sources GetNumberOfItems]
>
> for {set i 0} {$i < $num} {incr i} {
>      set eachObject [$sources GetItemAsObject $i]
>
>      # run your pipeline on the eachObject obtained from the list
> }
>
> Shawn
>
>
>
> On 7/20/06, Mike Jackson < imikejackson at gmail.com> wrote:
> > No wait,
> > we are missing my point. My point is that I have an existing Pipeline
> > defined. I want to be able to apply that pipeline to any dataset that
> > is loaded up in paraview. Right now I have .vti files of the data. I
> > also have a program that will convert those .vti files into surface
> > meshes (Actually, it takes data from an HDF5 file and creates the Mesh
> > using VTK as the pipeline.) I started dumping VTI files during the
> > process when I figured out Paraview could read them.
> >
> > If there was a way the tcl could get the "currently opened dataset",
> > then the remainder is cake. But from what I am hearing from this list
> > is that there isn't a way for the TCL scripting to get at the
> > currently opened dataset. It must start from a data file on disk. Is
> > that right?
> >
> > Mike Jackson
> >
> > On 7/20/06, Berk Geveci < berk.geveci at gmail.com> wrote:
> > > This requires writing a state and then editing it. The state is a Tcl
> script
> > > so it should be relatively easy to put a loop around it. Just  a
> warning,
> > > creating 600 pipeline objects in a loop might not work well
> > > performance-wise. I would recommend deleting the pipeline objects at the
> end
> > > of each iteration.
> > > Also, working with trace as opposed to state might be easier. Trace does
> not
> > > save out as much info as state.
> > >
> > > -Berk
> > >
> > >
> > > On 7/20/06, Mike Jackson < imikejackson at gmail.com> wrote:
> > > > What I want to be able to do is load up one of these data sets and
> > > > just apply the pipeline to it. The end result is a Triangle Surface
> > > > mesh for 3D viewing and saving.
> > > >
> > > > I actually already have a program written with VTK that does just
> > > > this. Except that the program is on one machine and Paraview is on
> > > > another. I was hoping that if I could just have the pipeline ready in
> > > > a script file, the scientists could bring me their .vti file, and then
> > > > I can just apply the script and out pops my triangle mesh complete
> > > > with proper coloring and all that.
> > > >
> > > > Also, Time animation is something that we would like to look at doing.
> > > > I fiddled with some of it over the weekend but not ready to go much
> > > > further with it right now.
> > > >
> > > > I was just hoping to be able to apply a script to an already loaded
> > > dataset.
> > > >
> > > > Mike Jackson
> > > >
> > > > On 7/20/06, Andy Cedilnik <andy.cedilnik at kitware.com> wrote:
> > > > > Hi Mike,
> > > > >
> > > > > You can write a script that will generate 600 states.
> > > > >
> > > > > What is really your end result? Do you want to animate? If so, just
> > > > > click on timesteps and generate a time series out of your dataset.
> > > > >
> > > > >        Andy
> > > > >
> > > > > Mike Jackson wrote:
> > > > > > Hello,
> > > > > >    I have a pipeline that was developed (Thanks Andy) in paraview
> for
> > > > > > a given data set. I now have about 600 of those datasets. I see
> that I
> > > > > > can save a session state from paraview and reload it when I
> relaunch
> > > > > > Paraview. But the session state seems to be really tied to the
> > > > > > datafile on disk. What I really want is to be able to load one of
> > > > > > those data sets, then load up a script that acts on that dataset,
> not
> > > > > > the original dataset from the disk.
> > > > > >   How would I best accomplish this.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > ------
> > > > > > Mike Jackson
> > > > > > Senior Research Engineer/New Visualization Engineer
> > > > > > mike.jackson at imts.us
> > > > > >
> > > > > >
> > > > > > _______________________________________________
> > > > > > ParaView mailing list
> > > > > > ParaView at paraview.org
> > > > > > http://www.paraview.org/mailman/listinfo/paraview
> > > > >
> > > > >
> > > > > --
> > > > > Andy Cedilnik
> > > > > Kitware Inc.
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Mike Jackson
> > > > imikejackson _at_ gee-mail dot com
> > > > _______________________________________________
> > > > ParaView mailing list
> > > > ParaView at paraview.org
> > > > http://www.paraview.org/mailman/listinfo/paraview
> > > >
> > >
> > >
> >
> >
> > --
> > Mike Jackson
> > imikejackson _at_ gee-mail dot com
> > _______________________________________________
> > ParaView mailing list
> > ParaView at paraview.org
> > http://www.paraview.org/mailman/listinfo/paraview
> >
>
>


-- 
Mike Jackson
imikejackson _at_ gee-mail dot com


More information about the ParaView mailing list