topology-tool-kit / ttk

TTK - Topological Data Analysis and Visualization - Source Code
https://topology-tool-kit.github.io/
Other
413 stars 122 forks source link

ttkExtract should provide a new mode where one can extract cells of a specified dimension #398

Open JonasLukasczyk opened 4 years ago

JonasLukasczyk commented 4 years ago

This thread describes a way to extract cells of a given type via the programmable filter by first storing the types as cell data, and then thresholding a specific type:

od = self.GetOutput() od.ShallowCopy(self.GetInput()) cta = vtk.vtkIntArray() cta.SetName("cell types") cta.SetNumberOfComponents(1) cta.SetNumberOfTuples(od.GetNumberOfCells()) od.GetCellData().AddArray(cta) for x in range(0,od.GetNumberOfCells()): cta.SetValue(x,od.GetCell(x).GetCellType())

So the question becomes if we should still add this functionality to the ttkExtract filter. What do you think @julien-tierny ?

julien-tierny commented 4 years ago

So the question becomes if we should still add this functionality to the ttkExtract filter. I think so, yes. programmable filters are for advanced users. having it in ttkExtract would be very handy, for everyone.

cheers, -- Dr Julien Tierny CNRS Researcher Sorbonne Universite http://lip6.fr/Julien.Tierny

On Wednesday, 1 July 2020 00:05:42 CEST Jonas Lukasczyk wrote:

This thread describes a way to extract cells of a given type via the programmable filter by first storing the types as cell data, and then thresholding a specific type:

od = self.GetOutput() od.ShallowCopy(self.GetInput()) cta = vtk.vtkIntArray() cta.SetName("cell types") cta.SetNumberOfComponents(1) cta.SetNumberOfTuples(od.GetNumberOfCells()) od.GetCellData().AddArray(cta) for x in range(0,od.GetNumberOfCells()): cta.SetValue(x,od.GetCell(x).GetCellType())

So the question becomes if we should still add this functionality to the ttkExtract filter. What do you think @julien-tierny ?