[vtkusers] vtkConnectivityFilter --> source code
Michnay Balázs
michnay at freemail.hu
Mon Nov 15 11:12:20 EST 2004
Dear Goodwin Lawlor and other VTK users,
Thanks for the quick reply. Here's the source code which might be
helpful to see what's going wrong...
The code is very simple, which might be the reason of it being out of
function.
void CAnalyzeItView::OnConnectivityfilter()
{
// TODO: Add your command handler code here
CAnalyzeItDoc* pDoc = GetDocument();
//m_idataThresh is a binary vtkImageData, it's a result of a
vtkImageThreshold
pDoc->m_connectivity->SetInput(pDoc->m_idataThresh);
//Do I need this?
pDoc->m_connectivity->ScalarConnectivityOff();
pDoc->m_connectivity->ColorRegionsOn();
pDoc->m_connectivity->SetExtractionModeToAllRegions();
pDoc->m_connectivity->Update();
//This always returns 1:
AfxMessageBox(pDoc->m_connectivity->GetExtractionModeAsString());
}
I'm sure I'm not setting important member variables and might not be
calling the right methods, I'm a bit puzzled...
If I need this to get connected regions extracted from which I can build
a volume, please post a sample C++ code how to do it or if I don't
need this to get the volume built please give me some hints (source
codes would be extremely helpful).
Goodwin Lawlor, thanks for your tips I'll look into those.
Thanks for your help in advance, I really appreciate it,
All the best,
MB
More information about the vtkusers
mailing list