[vtkusers] vtkThreshold

Robbie Banks robbie.banks at gmail.com
Tue Feb 8 13:54:54 EST 2011


Hi David,

Yep, thanks for your input. I did a little digging and the first example
will work perfectly for 2D datasets.

I think I can use the vtkThresholdPoints for the 2D stuff, as it will work
of the polygonal output from the unstructured grids quicker.

As you say, for the 3D stuff I'll have to use the vtkThreshold filter and
examine the volume of each of the grids and sum them, then run each grid
through the filter to get the number of points or cells within the filter
range.

Thanks
Robbie

-----Original Message-----
From: David Thompson [mailto:dcthomp at sandia.gov] 
Sent: Tuesday, February 08, 2011 10:47 AM
To: Robbie Banks
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkThreshold

> 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