[vtkusers] How to find range of data in Cell Scalar Array?

scotsman60 doug at beachmailing.com
Mon Dec 18 21:07:39 EST 2017

Cory, Andras,

Thanks for these suggestions. 

Cory - I use numpy to set up the data for the vtkUnstructuredGrid.... for

    from vtk.util import numpy_support, keys
    self.mesh.SetCells(vtkCellTypes, vtkOffsets, self.cells)

But I haven't had to use it on the output side..... which as you pointed out
is trivially easy using 'vtk_to-numpy'

    pr = numpy_support.vtk_to_numpy(self.mesh.GetCellData().GetArray('PID'))


Thanks for the GetRange() suggestion - it also works well

        pid_range = self.mesh.GetCellData().GetArray('PID').GetRange()

It turned out that I didn't actually need the unique ID's so I ended up
using the GetRange() method in this case.


Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html

More information about the vtkusers mailing list