[vtkusers] Splitting PolyData with vtkPolyDataConnectivityFilter

Rene Tschirley pooh at cs.tu-berlin.de
Tue Sep 3 14:52:39 EDT 2002


Dear VTK experts,


My application visualizes medical data (CT). After reading the slices and
creating an isosurface with vtkImageMarchingCubes (e.g. bone surface) I'd
like to drop all small regions which do not have at least 1% of the
overall polygon number. vtkPolyDataConnectivity is able to do this, but 
my algorithm is terribly slow and I'd like to know if there's a better
way for my purpose:


 vtkPolyDataConnectivityFilter *connectFilter = vtkPolyDataConnectivityFilter::New();

 connectFilter->SetInput(mesh);
 connectFilter->SetExtractionModeToAllRegions();
 connectFilter->Update();
 connectFilter->SetExtractionModeToSpecifiedRegions();

 for (int i=0; i<connectFilter->GetNumberOfExtractedRegions(); i++)
   {
     connectFilter->AddSpecifiedRegion(i);
     connectFilter->Update();

     cerr << "Region " << i << " has " << connectFilter->GetOutput()->GetNumberOfPolys() << " polys.\n";
     // if region shall be dropped
     if (1) connectFilter->DeleteSpecifiedRegion(i);
   }


Creating an isosurface with level 1200 on the head of the visible human
female dataset creates about 170 regions. The speed of the code makes
me believe that the ConnectivityFilter doesn't cache the connectivity
information and neither checks if the input data has changed (and it has
to recalculate the connectivities) nor if a change of the extraction mode
makes recalculation neccessary. That would save me about 170 times the
single calculation speed and would be great!

Is there a way of creating a bunch of vtkPolyData objects, one for each
objects, with a single cycle?


Best regards,
	René

-- 
Dipl.-Inform. René Tschirley              http://www.cs.tu-berlin.de/~pooh
TU Berlin, Computer Graphics and Computer Assisted Medicine research group
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020903/145c6ca1/attachment.pgp>


More information about the vtkusers mailing list