Thank you both.
I tried out vtkExtractCellsByType but it got nothing to output. The output is a PNG but it turned out to be empty at all. Did I miss anything essential?
Codes here: