[vtkusers] Re: isosurface extraction question

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Oct 5 07:28:13 EDT 2006


kdsfinger at gmail.com wrote:
> hi, all
> Assuming I have two neighboring regions, marked as 1 and 2 and the
> background is 0. I want to find the contour surface of each region.
> How can I get the contour surface of the region marked as 1? When I
> use the surface extraction or marching cube methods, I always get the
> contour of (1 And 2) when I tried to find the contour of region marked
> as 1. There is no problem to get the contour of region marked as 2.
> Thanks for comments.
> zl2k

The answer to that was from the old frog example, still here on the web: 
http://dit.lbl.gov/VTK/GlCache/vtk.cache/examplesTcl/frog/segmented8.tcl

You threshold the segmentation mask to give you a new binary (as in b&w) 
volume containing only the region you want to isocontour. For example:

vtkImageThreshold selectTissue
     selectTissue ThresholdBetween $TISSUE $TISSUE
     selectTissue SetInValue 255
     selectTissue SetOutValue 0

To extract a region of value 1, just set TISSUE to 1. Marching cubes 
then extracts your surface with a value of 127.5

Its worth looking at the full example above.

hth

Goodwin




More information about the vtkusers mailing list