Search code examples
pythonc++vtkdicomparaview

Selecting distinct, separate polydata in VTK


Using VTK I managed to slice a volume and get contours of three coronary blood vessels with vtkFeatureEdges. Contours of blood vessels

Is there a VTK way of selecting one of these? What I'm after is a polyData with slice of one vessel only (somewhat similar to scipy label). I could do this manually by recreating points connectivity from cells but maybe there is a ready-to-use filter that I don't know about?

I'm using Python bindings but I think C++ answer would be helpful too.


Solution

    • Use Connectivity filter to generate a RegionID array for each vessel
    • Use Edit->FindData to create a selection based on the RegionID array
    • use Extract Selection filter to extract it.

    This is a ParaView answer as you tagged the question as ParaView. But all these filter and selection mechanism are available in VTK as well.