I applied the marching cubes algorithm on a volume. The output is a vtkAlgorithmOutput (output_port variable) as shown by the following code. I want to extract the actual points (locations inside the volume coordinates) of the different iso-surfaces obtained by the marching cubes algorithms. Could you please help me as I want to apply some processing on these iso-surfaces? Any language is acceptable.
surface = vtkMarchingCubes()
output_port = surface.GetOutputPort()
vtkMarchingCubes is a
vtkPolyDataAlorithm subclass: https://vtk.org/doc/nightly/html/classvtkPolyDataAlgorithm.html . Hence, it has a
GetOutput() method which returns a pointer to an usable
GetOutputPort() is just a plug to make up processing pipelines by joining several algorithms and filters.
Thank you, Paulo,
I was able to save the vtkPolyData object using vtkXMLPolyDataWriter to make some processing on the iso-surfaces. Is there a better way to save the data?
Better in what sense? I mean, if you seek portability, saving to XML is a good choice. If you want to minimize file size, you can use
vtkPolyDataWriter which persists objects in a proprietary binary or ASCII format (