<div>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<span style="font-size:12px;line-height:12px"> </span>add with AddSpecifiedRegion? </div>
<div><br></div><div>Right now, if I run <a href="http://pastie.org/3920656">this code</a> 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.</div>
<div><br></div><div>Do you know how can I extract a variable number of regions?</div><div><br></div><div>Thanks,</div><div><br></div><div>Federico</div><div><br></div>
<div><br></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#55ff55"><br></font></pre></div><div class="gmail_quote">On Tue, May 15, 2012 at 4:54 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Tue, May 15, 2012 at 3:46 PM, Federico Milano <<a href="mailto:fmilano@gmail.com" target="_blank">fmilano@gmail.com</a>> wrote:<br>
> Hi. This is probably very simple but I'm not seeing it. How can I extract<br>
> the polydata that correspond to the different regions found by<br>
> the vtkPolyDataConnectivityFilter? I can render the output of this filter<br>
> with colors and the regions are there, but I don't find a way to extract a<br>
> different polydata for each regions.<br>
><br>
> I would really appreciate any hint.<br>
><br>
> Thanks in advance,<br>
><br>
> Federico<br>
<br>
</div></div>You can either extract the region directly with the<br>
vtkPolyDataConnectivityFilter like this:<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/vtkPolyDataConnectivityFilter_SpecifiedRegion" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/vtkPolyDataConnectivityFilter_SpecifiedRegion</a><br>
<br>
or later you can extract the RegionId array from the PointData and use<br>
it to threshold the data, using something like this:<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/ExtractSelectedThresholds" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/ExtractSelectedThresholds</a><br>
<span><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br>