[vtkusers] Delete object from vtkPolyDataConnectivityFilter(C++)
kenichiro yoshimi
rccm.kyoshimi at gmail.com
Sat Jul 14 06:20:20 EDT 2018
Hi Hao,
Beforehand you can make a numbering of cell ids using vtkIdFilter
before applying connectivityFilter.
See: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PointCellIds/
Regards
2018年7月12日(木) 22:26 hao chen <harry1994128 at gmail.com>:
>
> 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
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list