[vtkusers] connectivity information

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Feb 2 16:21:55 EST 2005


I am using marching cubes to do some isocontouring of medical image CT
data.  Some colleagues would me to help them export the geometry to
feed to a computational fluid dynamics program they have to model CSF
flow in the brain.  I know how to connect the marching cubes to the
vtkPolyDataConnectivityFilter, and use SetExtractionMode combined with
AddSpecifiedRegion to get my hands on the polydata in a certain
region, eg


    mc = vtk.vtkMarchingCubes()
    mc.SetInput(imageData)
    ...set other params...

    connect = vtk.vtkPolyDataConnectivityFilter()
    connect.SetInput(mc.GetOutput())
    
    ....
    print 'number of regions', connect.GetNumberOfExtractedRegions()
    connect.AddSpecifiedRegion(someid)
    connect.SetExtractionModeToSpecifiedRegions()
    poly = connect.GetOutput()

and then feed this to a vtkDataSetWriter to get the poly data for that
region.  This seems to be working OK.

What I need, in addition to the polydata, though, is some of the
internal connectivity data within that connected polygon dataset.  Eg,
that two polygons share a point or an edge, and so on.  Presumably
this information is available to the connectivity filter while it is
working.  Is it stored or otherwise available?  Or should I feed this
poly data set to some other VTK filter to get that info?

What is this best way to get this information?  Ultimately I'll need
to send it to a file for my colleagues to use.  I've been reading over
the VTK file format section of "The Visualization Toolkit" text, but
don't see anything for this kind of information.

Suggestions, pointers much appreciated!

Thanks,
JDH

VTK 4.4



More information about the vtkusers mailing list