[vtkusers] Extract different vtkPolyData from vtkPolyDataConnectivityFilter

David Doria daviddoria at gmail.com
Wed May 16 11:30:03 EDT 2012


On Wed, May 16, 2012 at 11:23 AM, Federico Milano <fmilano at gmail.com> wrote:
> Thanks David. The first approach is what I'm looking for. The thing is that
> I want to extract all the regions to different vtkPolyData. How do I know
> the number of regionIds I can add with AddSpecifiedRegion?


I'm not very familiar with this filter, but it essentially has two
modes of operation - labeling (SetExtractionModeToAllRegions) and
extracting (the others). The former will result in output that is
identical to the input, but each point will have a label indicating
its membership. You will then be responsible for actually breaking it
up into separate polydata's manually.

> Right now, if I run this code I get 40 in numberOfRegions and 1 in
> numberOfOutputs. But if I render the colored output, I see only 2 regions
> These 2 regions are, in fact, what I'm expecting, but this does not match
> with numberOfRegions or with numberOfOutputs.

My guess is that there are 38 very small regions that you are either
not noticing or are inside a larger region. I'd suggest using Paraview
to do some thresholding on the RegionId array to see what is going on.

David



More information about the vtkusers mailing list