[vtkusers] vtkThreshold

David Thompson dcthomp at sandia.gov
Tue Feb 8 13:47:21 EST 2011


> I’m wondering how I can use the vtkThreshold filter to return the  
> number of cells in the structure above a certain scalar value.
> The threshold filter seems to do this, but I can’t see where the  
> number of scalars could be returned from.

This:
   vtkThreshold* thresh;
   double cellCountRatio = thresh->GetInput()->GetNumberOfCells() /  
(double) thresh->GetOutput()->GetNumberOfCells();
doesn't work?

> I have an unstructured grid and I want to see how many of the cells  
> are above a certain scalar value, so that I can determine the  
> volumetric percentage of grid that is above the threshold?

If you want the volume ratio, then you must compute the volume of the  
input and output datasets. You might be able to use the vtkMeshQuality  
filter to do this (but it will only compute volume of tetrahedra and  
hexahedra, so you would have to tetrahedralize other cells before  
passing the mesh to this filter).

You might also ask that the vtkIntegrateAttributes be moved from  
ParaView to VTK.

	David



More information about the vtkusers mailing list