[Paraview-developers] Slice Animation

Sanaz Ghodousi sanaz.ghodousi at gmail.com
Sun Jun 5 10:00:55 EDT 2016


Hi developers,

I want to use pvbatch and python scripting to visualize a specific region
of data (similar to slice filter).

When I consider using slice filter as follows for the selected region, the
saved animation shows the slice values only for the first timestep. Is it
related to "getanimationtrack()"? If yes, please let me know how to define
it to get the slice data animation of all timesteps.

data.MeshRegions=['internalMesh']
data.CellArrays=['T']
#considering bounds of data as selection region
(xmin,xmax,ymin,ymax,zmin,zmax)=di.GetBounds()
selectionRegion=[(xmax-abs(xmin))/2,(ymax-abs(ymin))/2,(zmax-abs(zmin))/2]
# create a new 'Slice'
slice1 = paraview.simple.Slice(Input=data)
slice1.SliceType = 'Plane'

# init the 'Plane' selected for 'SliceType'
slice1.SliceType.Origin =selectionRegion
slice1.SliceType.Normal = [1.0, 0.0, 0.0]

slice1Display = Show(slice1, renderView1)
slice1Display.ColorArrayName = ['CELLS', 'T']

SetActiveSource(slice1)
Hide(data, renderView1)
renderView1.ResetCamera()

animationScene1 = GetAnimationScene()

animationScene1.UpdateAnimationUsingDataTimeSteps()

animationScene1.Play()

WriteAnimation('/OpenData/test.tiff', Magnification=1, FrameRate=5.0,
Compression=True)

Also I like to know if there is a more general approach to select and
visualize the specific cells (cell data array like "T") inside the
selection region (to get the animation of cell data similar to slice
output).
I look for a way to extract cells inside the selection region based on
possible application of bounds of each cell and finding their relation to
the bounds of selection region. Is there any specific method for defining
this type of selection or should be implemented?

dataBlock=paraview.simple.MergeBlocks(data)
dataFetch = paraview.servermanager.Fetch(dataBlock)
for i in range(dataFetch.GetCellData().GetArray("T").GetSize()):
print str(dataFetch.GetCell(i).GetBounds())

Final question is that how can I find python wrapper source of
openfoamreader? (couldn't check out the definition of data descriptors such
as "Meshregions" in "vtkOpenFOAMReader.cxx")

Best,
Sanaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160605/7c23e818/attachment.html>


More information about the Paraview-developers mailing list