[vtkusers] vtkPolyDataConnectivityFilter to add spatial constraints to KMeans output

Sara Rolfe smrolfe at u.washington.edu
Thu Jun 14 18:46:41 EDT 2012


Hello,

I have figured out some of my issues with the vtkPolyDataConnectivity  
filter but I still have a few questions about how it works.  I want to  
extract all regions that share both spatial and scalar connectivity.   
Before I was trying to turn on both SetExtractionModeToAllRegions and  
ScalarConnectivityOn, but now I realize that I can only extract  
regions of scalar connectivity one scalar range at a time.  Now I am  
able to extract one connected region per scalar range.

My question is, how can I extract the rest of the regions in that  
scalar range?  When I try turning on SetExtractionModeToAllRegions,  
the output is 39930 regions with what looks like random region  
separation.  I'm still not understanding this output.

Any advice about this filter and using scalar connectivity would be  
appreciated.

Thanks,
Sara

On Jun 10, 2012, at 9:25 PM, Sara Rolfe wrote:

> Hello,
>
> I am using vtkPolyDataConnectivityFilter to separate spatially  
> disconnected kmeans regions.  The kmeans cluster numbers are in the  
> "Scalers" array of the polydata.  If I understand correctly, my code  
> should give each of the connected regions sharing a kmeans cluster  
> number a unique region id.  However, my polydata with 95670 points  
> and 7 kmeans clusters produces 39930 connected regions.  The kmeans  
> output does not appear to be noisy, so I don't think this could be  
> right.  My code to set up the filter is is below and I would  
> appreciate any comments.
>
> Or, is there a better way to accomplish this task?
>
> Thanks for your advice,
> Sara
>
> 	vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter =  
> vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();
> 	connectivityFilter->SetInputConnection(labelReader->GetOutputPort());
> 	connectivityFilter->SetExtractionModeToAllRegions();
> 	connectivityFilter->ScalarConnectivityOn();
> 	connectivityFilter->ColorRegionsOn();
> 	connectivityFilter->Update();
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120614/0b06a5f9/attachment.htm>


More information about the vtkusers mailing list