<div dir="ltr"><div><div>Dear vtk users,<br><br></div>I have a similar problem: how can I get *each* connected component as a separate vtkPolyData object? Is there something like a GetRegion(k) method that gives me the k-th connected component? There is only AddSpecifiedRegion() but when I use it and then call GetOutput() the result is always the same no matter what id I have passed to AddSpecifiedRegion(). All official kitware examples on the web are about the largest connected component. But how to get all of them? I cannot believe that this is so difficult to find out based on the documentation... After all, this is the very basic functionality of this filter, isn't it?<br><br></div>Thank you.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 3, 2017 at 4:30 PM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Apply vtkCleanPolyData first. The triangles in that data have points that are coincindent, but none are actually shared across neighboring edges. Clean will merge the coicident points for you.<br></div><div class="gmail_extra"><br clear="all"><div><div class="m_-5177485866866365558gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: <a href="tel:(518)%20881-4909" value="+15188814909" target="_blank">518-881-4909</a></div></div>
<br><div class="gmail_quote"><div><div class="h5">On Tue, Jan 3, 2017 at 10:22 AM, Mohammadreza Babaee <span dir="ltr"><<a href="mailto:mrezababaee@gmail.com" target="_blank">mrezababaee@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">Hi <br><br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">I have a vtp file that contains a polydata. I want to extract its connected component. However, when I use<i> vtkPolyDataConnectivityFilter</i><b>, </b>and read the number of regions, it shows that the it is equal to the number of polys. But when I visualize the file I see that there are actually 4 regions.<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">I use<code><span class="m_-5177485866866365558m_5749514421171276759gmail-str"> SetExtractionModeToAllRegions to read the number of regions.</span></code><br>I have attached the file. Can you please help me to understand what the problem is<code><span class="m_-5177485866866365558m_5749514421171276759gmail-str"><br></span></code></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><code><span class="m_-5177485866866365558m_5749514421171276759gmail-str"><br>So here is my code<br><br>vtkSmartPointer<vtkPolyDataCon<wbr>nectivityFilter> connectivityFilter = vtkSmartPointer<vtkPolyDataCon<wbr>nectivityFilter>::New();<br> connectivityFilter->SetInputDa<wbr>ta(poly_in);<br> connectivityFilter->ScalarConn<wbr>ectivityOn();<br><br> connectivityFilter->SetExtract<wbr>ionModeToAllRegions();<br><br> connectivityFilter->Update();<br> int nbregions = connectivityFilter->GetNumberO<wbr>fExtractedRegions();<br><br> cout << "Number of Extracted Regions are=" << nbregions << endl;<br></span></code></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"></div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">Thanks<b><br></b></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>