[vtkusers] vtkConnectivityFilter --> Correction

Michnay Balázs michnay at freemail.hu
Tue Nov 16 07:54:12 EST 2004


Dear Goodwin Lawlor and other VTK Users,
Yes, your're right, the code I posted was incorrect,  of course
GetExtractionModeAsString();
doesn't return 1, the corrected code is:

void CAnalyzeItView::OnConnectivityfilter()
{
// TODO: Add your command handler code here

	CAnalyzeItDoc* pDoc = GetDocument();


	pDoc->m_connectivity->SetInput(pDoc->m_idataThresh);	

	pDoc->m_connectivity->ColorRegionsOn();
	
//Do I need this?
	pDoc->m_connectivity->ScalarConnectivityOff();


	pDoc->m_connectivity->SetExtractionModeToAllRegions();


	pDoc->m_connectivity->Update();
        //GetNumberOfExtractedRegions(); always returns 1
	int i = pDoc->m_connectivity->GetNumberOfExtractedRegions();
}

Thanks for the tips and source code, I'll try to do it the
way you recommended (if I choose your solution I don't need
to use vtkConnectivityFilter to get all the connected
regions extracted, right?)
Thanks again, you've been very helpful.

Regards,

  MB



More information about the vtkusers mailing list