[vtkusers] Delete object from vtkPolyDataConnectivityFilter(C++)

hao chen harry1994128 at gmail.com
Thu Jul 12 09:26:26 EDT 2018


Hello, I want to delete one object in vtkTriangleFilter, have some question
about origin CellId after I do vtkPolyDataConnectivityFilter.

Part of my code:

vtkSmartPointer<vtkDICOMImageReader> DicomImageReader =
vtkSmartPointer<vtkDICOMImageReader>::New();
DicomImageReader->SetDirectoryName("E:\\offline_3Ddata\\2017042402");
DicomImageReader->Update();
In my part of code:
vtkSmartPointer<vtkContourFilter> filter =
vtkSmartPointer<vtkContourFilter>::New();
filter->SetInputConnection(DicomImageReader->GetOutputPort());
filter->SetValue(0, 9000);  
filter->Update();

vtkSmartPointer<vtkTriangleFilter> triangleFilter =
vtkSmartPointer<vtkTriangleFilter>::New();
triangleFilter->SetInputConnection(filter->GetOutputPort());
triangleFilter->Update();

vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter =
vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();  
connectivityFilter->SetInput(triangleFilter->GetOutput());  
connectivityFilter->SetExtractionModeToCellSeededRegions(); 
connectivityFilter->AddSeed(1000); 
connectivityFilter->Update(); 

----------------------------------------------------------------------------------------------------------------------
This case in triangleFilter have many objects and use connectivityFilter it
will find CellId = 1000 in triangleFilter others cell connected with CellId
= 1000.

After that connectivityFilter will have one object, and the
connectivityFilter's CellId will start with zero, but I want the original
CellId.

How can I get the original CellId in connectivityFilter? I want to delete
object in the triangleFilter.
Or have any other solution.

Sorry my poor english. Thx~

Hao



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list