Re: [Paraview] animation: files, pgmable source

2017-12-09 Thread Utkarsh Ayachit
Randy,

Here's how I'd proceed.

1. Create a programmable source to read a file series as a temporal
dataset. (you have this already).
2. Let the users use ParaView to save animation or screenshots once
they are satisfied.
3. You can put the "Extract TimeSteps" filter after your reader
(before any of the other pipeline) and make it filter timesteps. It
allows filtering over a range of timesteps with an arbitrary interval.
So your users can change this to choose which subset they are
interested in. I'd also point to the "Time INspector" so user can see
what timesteps ParaView is taking into consideration.

Utkarsh



On Fri, Dec 8, 2017 at 3:29 PM, Heiland, Randy  wrote:
> Have a user read in a state file to experiment with a pipeline/filters on a 
> single data file, e.g. they may have 1000 files and they want to initially  
> look at the last one. When they’re content with the vis on a single file, 
> they’d like to view an animation in PV on all (or mod N) files. When they’re 
> happy with that, they’d like to save .png’s - preferably batch/offscreen, but 
> whatever.
>
> Randy
>
>
>> On Dec 8, 2017, at 3:07 PM, Utkarsh Ayachit  
>> wrote:
>>
>> Randy,
>>
>> Mind explaining to me what;s your ultimate goal? The way I see it,
>> there are two options:
>>
>> 1. Provide your users with a state file that they load in ParaView UI
>> and then use the UI to save animation or images. Use the UI to move
>> back and forth through the timesteps, etc.
>> 2. Provide your users with a Python script that they run using
>> pvpython to save out screenshots or animations based on command line
>> arguments.
>>
>> Which one are you aiming for? Or is it something else?
>>
>> Utkarsh
>>
>>
>>
>> On Fri, Dec 8, 2017 at 11:22 AM, Heiland, Randy  wrote:
>>> No, no, I’m sure it’s *me* who’s confused.  I’m not sure I understand what 
>>> you’re saying. Are you suggesting keeping the (full) range of timesteps in 
>>> my script and then, somehow, only render the one of interest? If so, that 
>>> would be great, except the way things are currently working for me, after 
>>> loading the .pvsm initially, it renders the first requested tilmestep, but 
>>> I cannot just enter a desired timestep value into the “Time” widget field. 
>>> I can only single step through them via the up/down arrow widget.
>>>
>>> Not sure if it’s related, but after loading the state file, in the Output 
>>> Messages, I get the following error/warning, even though it does render the 
>>> first one properly:
>>>
>>> Traceback (most recent call last):
>>>  File "", line 20, in 
>>>  File "", line 34, in RequestInformation
>>> TypeError: arguments do not match any overloaded methods
>>> --- time=  100.0
>>> fname= 
>>> /Users/heiland/git/PhysiCell/run2_cancer_immune/output0100_cells_physicell
>>> num_cells_possible = 38080
>>> num_cells = 38080
>>>
>>> I’ve attached my Programmable Source Script and Script(RequestInfo), fwiw. 
>>> Line 34 of RequestInfo is the very last line in that script.
>>> output.GetInformation().Set(output.DATA_TIME_STEP(), req_time)
>>>
>>>
>>> thanks!
>>> Randy
>
___
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


Re: [Paraview] animation: files, pgmable source

2017-12-08 Thread Heiland, Randy
Have a user read in a state file to experiment with a pipeline/filters on a 
single data file, e.g. they may have 1000 files and they want to initially  
look at the last one. When they’re content with the vis on a single file, 
they’d like to view an animation in PV on all (or mod N) files. When they’re 
happy with that, they’d like to save .png’s - preferably batch/offscreen, but 
whatever.

Randy


> On Dec 8, 2017, at 3:07 PM, Utkarsh Ayachit  
> wrote:
> 
> Randy,
> 
> Mind explaining to me what;s your ultimate goal? The way I see it,
> there are two options:
> 
> 1. Provide your users with a state file that they load in ParaView UI
> and then use the UI to save animation or images. Use the UI to move
> back and forth through the timesteps, etc.
> 2. Provide your users with a Python script that they run using
> pvpython to save out screenshots or animations based on command line
> arguments.
> 
> Which one are you aiming for? Or is it something else?
> 
> Utkarsh
> 
> 
> 
> On Fri, Dec 8, 2017 at 11:22 AM, Heiland, Randy  wrote:
>> No, no, I’m sure it’s *me* who’s confused.  I’m not sure I understand what 
>> you’re saying. Are you suggesting keeping the (full) range of timesteps in 
>> my script and then, somehow, only render the one of interest? If so, that 
>> would be great, except the way things are currently working for me, after 
>> loading the .pvsm initially, it renders the first requested tilmestep, but I 
>> cannot just enter a desired timestep value into the “Time” widget field. I 
>> can only single step through them via the up/down arrow widget.
>> 
>> Not sure if it’s related, but after loading the state file, in the Output 
>> Messages, I get the following error/warning, even though it does render the 
>> first one properly:
>> 
>> Traceback (most recent call last):
>>  File "", line 20, in 
>>  File "", line 34, in RequestInformation
>> TypeError: arguments do not match any overloaded methods
>> --- time=  100.0
>> fname= 
>> /Users/heiland/git/PhysiCell/run2_cancer_immune/output0100_cells_physicell
>> num_cells_possible = 38080
>> num_cells = 38080
>> 
>> I’ve attached my Programmable Source Script and Script(RequestInfo), fwiw. 
>> Line 34 of RequestInfo is the very last line in that script.
>> output.GetInformation().Set(output.DATA_TIME_STEP(), req_time)
>> 
>> 
>> thanks!
>> Randy

___
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


Re: [Paraview] animation: files, pgmable source

2017-12-08 Thread Utkarsh Ayachit
Randy,

Mind explaining to me what;s your ultimate goal? The way I see it,
there are two options:

1. Provide your users with a state file that they load in ParaView UI
and then use the UI to save animation or images. Use the UI to move
back and forth through the timesteps, etc.
2. Provide your users with a Python script that they run using
pvpython to save out screenshots or animations based on command line
arguments.

Which one are you aiming for? Or is it something else?

Utkarsh



On Fri, Dec 8, 2017 at 11:22 AM, Heiland, Randy  wrote:
> No, no, I’m sure it’s *me* who’s confused.  I’m not sure I understand what 
> you’re saying. Are you suggesting keeping the (full) range of timesteps in my 
> script and then, somehow, only render the one of interest? If so, that would 
> be great, except the way things are currently working for me, after loading 
> the .pvsm initially, it renders the first requested tilmestep, but I cannot 
> just enter a desired timestep value into the “Time” widget field. I can only 
> single step through them via the up/down arrow widget.
>
> Not sure if it’s related, but after loading the state file, in the Output 
> Messages, I get the following error/warning, even though it does render the 
> first one properly:
>
> Traceback (most recent call last):
>   File "", line 20, in 
>   File "", line 34, in RequestInformation
> TypeError: arguments do not match any overloaded methods
> --- time=  100.0
> fname= 
> /Users/heiland/git/PhysiCell/run2_cancer_immune/output0100_cells_physicell
> num_cells_possible = 38080
> num_cells = 38080
>
> I’ve attached my Programmable Source Script and Script(RequestInfo), fwiw. 
> Line 34 of RequestInfo is the very last line in that script.
> output.GetInformation().Set(output.DATA_TIME_STEP(), req_time)
>
>
> thanks!
> Randy
___
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


Re: [Paraview] animation: files, pgmable source

2017-12-08 Thread Heiland, Randy
No, no, I’m sure it’s *me* who’s confused.  I’m not sure I understand what 
you’re saying. Are you suggesting keeping the (full) range of timesteps in my 
script and then, somehow, only render the one of interest? If so, that would be 
great, except the way things are currently working for me, after loading the 
.pvsm initially, it renders the first requested tilmestep, but I cannot just 
enter a desired timestep value into the “Time” widget field. I can only single 
step through them via the up/down arrow widget.

Not sure if it’s related, but after loading the state file, in the Output 
Messages, I get the following error/warning, even though it does render the 
first one properly:

Traceback (most recent call last):
  File "", line 20, in 
  File "", line 34, in RequestInformation
TypeError: arguments do not match any overloaded methods
--- time=  100.0
fname= 
/Users/heiland/git/PhysiCell/run2_cancer_immune/output0100_cells_physicell
num_cells_possible = 38080
num_cells = 38080

I’ve attached my Programmable Source Script and Script(RequestInfo), fwiw. Line 
34 of RequestInfo is the very last line in that script.
output.GetInformation().Set(output.DATA_TIME_STEP(), req_time)


thanks!
Randy
import scipy
from scipy import io
import math

outInfo = self.GetOutputInformation(0)
if outInfo.Has(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP()):
  time = outInfo.Get(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP())
  fname = "output%08d_cells_physicell" % time
else:
  time = 0
  fname = "output%08d_cells_physicell" % time 
print "--- time= ",time 

cells_dict = {} 

  # fix file pathname for cross-platform?
dir = "/Users/heiland/git/PhysiCell"
dir += "/run2_cancer_immune/"

print "fname=",dir+fname 
scipy.io.loadmat(dir + fname, cells_dict)
val = cells_dict['cells']

  # Get a vtk.PolyData object for the output
pdo = self.GetPolyDataOutput()

  # Get number of cells
num_cells_possible = val.shape[1]
print "num_cells_possible =",num_cells_possible

  # Create points (cells' centers)
newPts = vtk.vtkPoints()

  # We will create two scalar fields:
  #   cell_color_ID = integers that get mapped to colors (for cell types)
  #   cell_diam = floating point values of cell diameters
cell_color_ID = vtk.vtkIntArray()
cell_diam = vtk.vtkFloatArray()
cell_color_ID.SetName('cell_color_ID')
cell_diam.SetName('cell_diameter')

  #kdx=6
  #if (kdx == 5):
#  scalars.SetName('cell_type')
  #elif (kdx == 6):
  #  scalars.SetName('cycle_model')
  #elif (kdx == 7):
  #  scalars.SetName('current_phase')

  # This is a temporary hack to correct
  # for a shortcoming in ParaView's OSPRay
  # sphere scaling. Basically, we need to
  # move all cells closer to the origin.
first_pass = False
if (first_pass):
  maxDist = 0.0
else:
  maxDist = 4.0  # ~3.90

num_cells = 0
for idx in range(0, num_cells_possible):   # loop over all (possible) cells
# rf. PhysiCell User Guide for interpretation of these array indices
x = val[1,idx]
y = -val[2,idx]  # invert Y (points down)
z = val[3,idx]
if (math.fabs(x) > 1): # avoid bogus data
  print idx," skip x =", x
  continue
elif (math.fabs(y) > 1):
  print idx," skip y =", y
  continue
elif (math.fabs(z) > 1):
  print idx," skip z =", z
  continue

# If reading a new .mat data file
# of unknown spatial size, do this:
if (first_pass):
  dist = math.sqrt(x*x + y*y + z*z)
  if dist > maxDist:
maxDist = dist

# insert new (only if valid) point
# temporary hack: move cell centers closer to origin
newPts.InsertPoint(num_cells, x/maxDist,y/maxDist,z/maxDist)
num_cells += 1

# The following lines assign an integer to represent
# a color, defined in a Color Map.
sval = 0   # immune cells are black?
if val[5,idx] == 1:  # [5]=cell_type
  sval = 1   # lime green
if (val[6,idx] == 6) or (val[6,idx] == 7):
  sval = 0
if val[7,idx] == 100:  # [7]=current_phase
  sval = 3   # apoptotic: red
if val[7,idx] > 100 and val[7,idx] < 104:
  sval = 2   # necrotic: brownish

cell_color_ID.InsertNextValue(sval)

# This is where we create another scalar field that
# will determine how cells (spheres) are scaled.
# V=(4/3)pi*r^3 -> r^3 = v*0.75/pi
diam = (val[4,idx]*0.2387)**0.333 * 2.0
cell_diam.InsertNextValue(diam)

  # If doing a 1st-pass to determine max distance
  # of a cell from the origin:
  #print 'maxDist = ',maxDist

  # Add the points and the scalar arrays to the vtkPolyData object.
pdo.SetPoints(newPts)
pdo.GetPointData().AddArray(cell_color_ID)
pdo.GetPointData().AddArray(cell_diam)

verts = vtk.vtkCellArray()
print "num_cells =",num_cells

for idx in range(0, num_cells):
verts.InsertNextCell(1)
verts.InsertCellPoint(idx)

pdo.SetVerts(verts)
def setOutputTimesteps (algorithm , timesteps):
  # "helper routine to set timestep information"
  executive = algorithm.GetExecutive()
  outInfo = 

Re: [Paraview] animation: files, pgmable source

2017-12-08 Thread Utkarsh Ayachit
Oops. I meant to say -- "I am a little confused here" :).

On Fri, Dec 8, 2017 at 10:10 AM, Utkarsh Ayachit
 wrote:
> Hmm, little confused here? Why not keep the timesteps in the reader
> unchanged and explcitly do the timestep of interest and save
> screenshot?
>
> On Thu, Dec 7, 2017 at 10:51 AM, Heiland, Randy  wrote:
>> Utkarsh,
>>
>> Thanks very much for that!  Yes, after some fiddling, I got it to work, 
>> i.e., I can save .png files for an animation! So now that I’m using the 
>> Programmable Source(RequestInfo) script to accomplish the animation, how do 
>> I, during a PV session, *easily* switch back to render a single file?
>>
>> For example, I can do:
>> frames = range(0,801,100)   #  render every 100th frame, including 800
>> setOutputTimesteps (self, frames)
>>
>> or, I can explicitly list specific frames:
>> frames = [100,101]
>>
>> so, I thought this would do a single file, but it doesn’t (my previous 
>> frames are still there):
>> frames = [600,]
>>
>> -Randy
>>
>>
>>
>>> On Dec 6, 2017, at 10:44 PM, Utkarsh Ayachit  
>>> wrote:
>>>
>>> Randy,
>>>
>>> You attempting to mix the Python scripting for data processing and
>>> Python scripting for batch scripting. The two environments are
>>> separate. Here's how I'd tackle it.
>>>
>>> 1. Make your "Programmable Source" become a temporal source i.e.
>>> report to ParaView that it can produce timesteps matching the files
>>> your file series. See [i]. If you get this right, you shuold be able
>>> to render through all the files by hitting "Play" in the VCR control
>>> in the UI.
>>> 2. Now you can write a batch script that either loads the predefined
>>> pvsm state file or builds up the pipeline in Python itself and the
>>> either uses `SaveScreenshot` or `SaveAnimation` to save out the
>>> animation.
>>>
>>> You can then mix in camera animations too. You can always use the
>>> Python tracing in UI to figure out how to save images and/or animation
>>> in the batch scripting environment.
>>>
>>> Hope that helps.
>>> Utkarsh
>>>
>>> [i] 
>>> https://blog.kitware.com/defining-time-varying-sources-with-paraviews-programmable-source/
>>>
>>> On Wed, Dec 6, 2017 at 11:15 AM, Heiland, Randy  wrote:
 I’m probably missing a basic concept and hoping someone can enlighten me. I
 have a pipeline with a Programmable Source that reads in a (non-VTK
 formatted) file, I process it and then I have filters in my pipeline that
 act on that data. I want to be able to feed multiple files to the pipeline,
 save images and/or create animations. I naively created a Python function 
 in
 the Pgmable Source, then save the PV State to a Python script, thinking I
 could call the function from the end of that script. Doesn’t seem to be
 possible. And I confess I’ve not given this deep thought - it’s easier to
 ask the experts :-)  Bottom line, we want to make this as dead simple for
 our own users.

 Fwiw, I’ve zipped up 2 files - a .pvsm and a sample data file here:
 http://pages.iu.edu/~heiland/physicell/pv_pcell.zip . You’d need to edit 
 the
 “dir” path in the Pgmable Source.

 Initially, I just want to save images/animation (over multiple files) with 
 a
 fixed camera view; later, it’d be nice to have simultaneous camera 
 movement.

 thanks, Randy

 ___
 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

>>
___
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


Re: [Paraview] animation: files, pgmable source

2017-12-08 Thread Utkarsh Ayachit
Hmm, little confused here? Why not keep the timesteps in the reader
unchanged and explcitly do the timestep of interest and save
screenshot?

On Thu, Dec 7, 2017 at 10:51 AM, Heiland, Randy  wrote:
> Utkarsh,
>
> Thanks very much for that!  Yes, after some fiddling, I got it to work, i.e., 
> I can save .png files for an animation! So now that I’m using the 
> Programmable Source(RequestInfo) script to accomplish the animation, how do 
> I, during a PV session, *easily* switch back to render a single file?
>
> For example, I can do:
> frames = range(0,801,100)   #  render every 100th frame, including 800
> setOutputTimesteps (self, frames)
>
> or, I can explicitly list specific frames:
> frames = [100,101]
>
> so, I thought this would do a single file, but it doesn’t (my previous frames 
> are still there):
> frames = [600,]
>
> -Randy
>
>
>
>> On Dec 6, 2017, at 10:44 PM, Utkarsh Ayachit  
>> wrote:
>>
>> Randy,
>>
>> You attempting to mix the Python scripting for data processing and
>> Python scripting for batch scripting. The two environments are
>> separate. Here's how I'd tackle it.
>>
>> 1. Make your "Programmable Source" become a temporal source i.e.
>> report to ParaView that it can produce timesteps matching the files
>> your file series. See [i]. If you get this right, you shuold be able
>> to render through all the files by hitting "Play" in the VCR control
>> in the UI.
>> 2. Now you can write a batch script that either loads the predefined
>> pvsm state file or builds up the pipeline in Python itself and the
>> either uses `SaveScreenshot` or `SaveAnimation` to save out the
>> animation.
>>
>> You can then mix in camera animations too. You can always use the
>> Python tracing in UI to figure out how to save images and/or animation
>> in the batch scripting environment.
>>
>> Hope that helps.
>> Utkarsh
>>
>> [i] 
>> https://blog.kitware.com/defining-time-varying-sources-with-paraviews-programmable-source/
>>
>> On Wed, Dec 6, 2017 at 11:15 AM, Heiland, Randy  wrote:
>>> I’m probably missing a basic concept and hoping someone can enlighten me. I
>>> have a pipeline with a Programmable Source that reads in a (non-VTK
>>> formatted) file, I process it and then I have filters in my pipeline that
>>> act on that data. I want to be able to feed multiple files to the pipeline,
>>> save images and/or create animations. I naively created a Python function in
>>> the Pgmable Source, then save the PV State to a Python script, thinking I
>>> could call the function from the end of that script. Doesn’t seem to be
>>> possible. And I confess I’ve not given this deep thought - it’s easier to
>>> ask the experts :-)  Bottom line, we want to make this as dead simple for
>>> our own users.
>>>
>>> Fwiw, I’ve zipped up 2 files - a .pvsm and a sample data file here:
>>> http://pages.iu.edu/~heiland/physicell/pv_pcell.zip . You’d need to edit the
>>> “dir” path in the Pgmable Source.
>>>
>>> Initially, I just want to save images/animation (over multiple files) with a
>>> fixed camera view; later, it’d be nice to have simultaneous camera movement.
>>>
>>> thanks, Randy
>>>
>>> ___
>>> 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
>>>
>
___
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


Re: [Paraview] animation: files, pgmable source

2017-12-07 Thread Heiland, Randy
Utkarsh,

Thanks very much for that!  Yes, after some fiddling, I got it to work, i.e., I 
can save .png files for an animation! So now that I’m using the Programmable 
Source(RequestInfo) script to accomplish the animation, how do I, during a PV 
session, *easily* switch back to render a single file?

For example, I can do:
frames = range(0,801,100)   #  render every 100th frame, including 800
setOutputTimesteps (self, frames)

or, I can explicitly list specific frames:
frames = [100,101]

so, I thought this would do a single file, but it doesn’t (my previous frames 
are still there):
frames = [600,]

-Randy



> On Dec 6, 2017, at 10:44 PM, Utkarsh Ayachit  
> wrote:
> 
> Randy,
> 
> You attempting to mix the Python scripting for data processing and
> Python scripting for batch scripting. The two environments are
> separate. Here's how I'd tackle it.
> 
> 1. Make your "Programmable Source" become a temporal source i.e.
> report to ParaView that it can produce timesteps matching the files
> your file series. See [i]. If you get this right, you shuold be able
> to render through all the files by hitting "Play" in the VCR control
> in the UI.
> 2. Now you can write a batch script that either loads the predefined
> pvsm state file or builds up the pipeline in Python itself and the
> either uses `SaveScreenshot` or `SaveAnimation` to save out the
> animation.
> 
> You can then mix in camera animations too. You can always use the
> Python tracing in UI to figure out how to save images and/or animation
> in the batch scripting environment.
> 
> Hope that helps.
> Utkarsh
> 
> [i] 
> https://blog.kitware.com/defining-time-varying-sources-with-paraviews-programmable-source/
> 
> On Wed, Dec 6, 2017 at 11:15 AM, Heiland, Randy  wrote:
>> I’m probably missing a basic concept and hoping someone can enlighten me. I
>> have a pipeline with a Programmable Source that reads in a (non-VTK
>> formatted) file, I process it and then I have filters in my pipeline that
>> act on that data. I want to be able to feed multiple files to the pipeline,
>> save images and/or create animations. I naively created a Python function in
>> the Pgmable Source, then save the PV State to a Python script, thinking I
>> could call the function from the end of that script. Doesn’t seem to be
>> possible. And I confess I’ve not given this deep thought - it’s easier to
>> ask the experts :-)  Bottom line, we want to make this as dead simple for
>> our own users.
>> 
>> Fwiw, I’ve zipped up 2 files - a .pvsm and a sample data file here:
>> http://pages.iu.edu/~heiland/physicell/pv_pcell.zip . You’d need to edit the
>> “dir” path in the Pgmable Source.
>> 
>> Initially, I just want to save images/animation (over multiple files) with a
>> fixed camera view; later, it’d be nice to have simultaneous camera movement.
>> 
>> thanks, Randy
>> 
>> ___
>> 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
>> 

___
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


Re: [Paraview] animation: files, pgmable source

2017-12-06 Thread Utkarsh Ayachit
Randy,

You attempting to mix the Python scripting for data processing and
Python scripting for batch scripting. The two environments are
separate. Here's how I'd tackle it.

1. Make your "Programmable Source" become a temporal source i.e.
report to ParaView that it can produce timesteps matching the files
your file series. See [i]. If you get this right, you shuold be able
to render through all the files by hitting "Play" in the VCR control
in the UI.
2. Now you can write a batch script that either loads the predefined
pvsm state file or builds up the pipeline in Python itself and the
either uses `SaveScreenshot` or `SaveAnimation` to save out the
animation.

You can then mix in camera animations too. You can always use the
Python tracing in UI to figure out how to save images and/or animation
in the batch scripting environment.

Hope that helps.
Utkarsh

[i] 
https://blog.kitware.com/defining-time-varying-sources-with-paraviews-programmable-source/

On Wed, Dec 6, 2017 at 11:15 AM, Heiland, Randy  wrote:
> I’m probably missing a basic concept and hoping someone can enlighten me. I
> have a pipeline with a Programmable Source that reads in a (non-VTK
> formatted) file, I process it and then I have filters in my pipeline that
> act on that data. I want to be able to feed multiple files to the pipeline,
> save images and/or create animations. I naively created a Python function in
> the Pgmable Source, then save the PV State to a Python script, thinking I
> could call the function from the end of that script. Doesn’t seem to be
> possible. And I confess I’ve not given this deep thought - it’s easier to
> ask the experts :-)  Bottom line, we want to make this as dead simple for
> our own users.
>
> Fwiw, I’ve zipped up 2 files - a .pvsm and a sample data file here:
> http://pages.iu.edu/~heiland/physicell/pv_pcell.zip . You’d need to edit the
> “dir” path in the Pgmable Source.
>
> Initially, I just want to save images/animation (over multiple files) with a
> fixed camera view; later, it’d be nice to have simultaneous camera movement.
>
> thanks, Randy
>
> ___
> 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
>
___
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