[vtkusers] Threshold

Benedikt Birkenbach birkenbach at rrz.uni-koeln.de
Thu Apr 27 08:27:19 EDT 2006


So,

I finaly solved it by my own.
After every assignment like a = b, I have to call the Update(), like

  cout << sg->GetNumberOfPoints() << endl;
  ug = cut(sg);
ug->Update();

  cout << ug->GetNumberOfPoints() << endl;


Regards bene

Benedikt Birkenbach wrote:
> Dear readers,
> 
> I want to use the threshhold-algorithm to get rid of some points in my
> dataset, which are not needed. These Points have the z-posistions -99
> and the datavalue -99. So I use the function shown below.
> 
> vtkUnstructuredGrid * cut(vtkStructuredGrid * grid)
> {
>     vtkThreshold * nn_source = vtkThreshold::New();
>     nn_source->ThresholdByUpper(-98);
>     nn_source->SetInput(grid);
>     return nn_source->GetOutput();
> }
> 
> Ok, the structuredGrid is now an unstructured, but all points seem to be
> away. The result of the Code
> 
> // sg is my vtkStructuredGrid, ug is an unstructured one, cut as above
> 
> cout << sg->GetNumberOfPoints() << endl;
> ug = cut(sg);
> cout << ug->GetNumberOfPoints() << endl;
> 
> is
> 
> 806
> 0
> 
> although there are definitly points left, because if I visualize the
> result (ug) everything is fine (all the not wanted points are away).
> But if I try to use the ICP-algorithm, I get the error
> 
> ERROR: VTK/Hybrid/vtkIterativeClosestPointTransform.cxx, line 274
> vtkIterativeClosestPointTransform (0x93995a0): Can't execute with NULL
> or empty input
> 
> If I use ICP without threshold everything works (but the dataset is
> wrong, because those -99 should not be used).
> The use of "blanking" to skip the points results in
> 
> Generic Warning: In /tmp/Downloads/VTK/Common/vtkMath.cxx, line 604
> vtkMath::Jacobi: Error extracting eigenfunctions
> 
> when using ICP and I am not sure, what effect this will have.
> Any tips or hints are welcome,
> 
> regards
> 
> Benedikt
> 
> 
> 


-- 
  ____  ____  ____  _  ________________________________________
/ __ \/ __ \|__  || |/ /  Benedikt Birkenbach                 |
|  __/|  __/  / / |   /   RRZK/ZAIK der Universitaet zu Koeln |
| | \ | | \  / /_ |   \                                       |
|_|\_\|_|\_\|____||_|\_\  http://www.uni-koeln.de/RRZK/       |
______________________________________________________________/



More information about the vtkusers mailing list