[Paraview] Fw: How do we get the indexes and IDs from the extracted selections to be seen in the Trace?

Favre Jean jfavre at cscs.ch
Wed Jun 6 10:55:13 EDT 2018


The indices of the points selected are in a field called "vtkOriginalPointIds". It is a field with a special meaning and is hidden in some cases.

if you write the selected data to disk, it will show up as field "vtkOriginalPointIds"

Consider the pvpython code below:

from paraview.simple import *

w = Wavelet()
w.UpdatePipeline()

selection=SelectPoints()
selection.QueryString="RTData <= 40"
selection.FieldType = 'POINT'
selection.UpdatePipelineInformation()

# create a new 'Extract Selection'
mySelection = ExtractSelection(Input=w, Selection=selection)
mySelection.UpdatePipeline()
SaveData("foo.vtk", mySelection)

and inspect the contents of foo.vtk, you will find your ids.

if you need more, I simply use a Python Calculator to rename the field and I can then access the array

passthru = PythonCalculator(Input = mySelection)
passthru.Expression = 'inputs[0].PointData["vtkOriginalPointIds"]'
passthru.ArrayAssociation = "Point Data"
passthru.ArrayName = 'ids'
passthru.UpdatePipeline()

passthru.GetPointDataInformation().GetArray("ids").GetName()

HTH
Jean





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180606/66eca906/attachment-0001.html>


More information about the ParaView mailing list