Hello,
I want to read a .vtu file and clip it so that I can work with the necessary data only. To do so the .vtu contains CellData with a tag which I can use to clip by scalars. After some searching I came to the following code but it seems that clip.GetOutput( ) is empty. Can you help me?
I tried a lot but since I am new to VTK I can’t find a solution.
#file path
filename = ‘test.vtu’
#read vtk returns vtkreader (a function I wrote in an other module)
file = f.readData( filename )
#clip only necessary data
tags = file.GetOutput( ).GetCellData( ).GetArray( ‘Tag’ )
file.GetOutput( ).GetCellData( ).SetScalars( tags )
clip = vtk.vtkClipDataSet( )
clip.SetInputData( file.GetOutput( ) )
clip.SetValue( 100 )
clip.SetInsideOut( True )
clip.Update( )