GetOutputPolyDataConnection() not working

Operating system:Windows 10
Slicer version:4.8.1
Expected behavior:I’m tryinng to write .ply file using python interactor but i think because of this error(GetOutputPolyDataConnection() ) it is not generating the output though plywriter.write() returns 1
Actual behavior: showing error this attribute is not part of some vtk class

can you please give me a code which is use for exporting obj also…

thanks…

Please see below (and in future, please copy/link the code you are running and output, to give people here enough context to explain errors).

AttributeError: ‘vtkCommonCorePython.vtkMRMLScalarVolumeDisplayNode’ object has no attribute ‘GetOutputPolyDataConnection’

Sorry , but this is the actual error , and i’m using same code that you have referred , still no luck…

Volume nodes don’t store polydata (surface mesh), but an image volume. You can create mesh from volume by segmenting it, for example by using Segment Editor module.

2 Likes

Ohh, okay. So i have to get segment data first…
Thanks for the support…
is it possible to export obj rather than .ply file??

Yes, you can save geometry of the model as .obj file.

1 Like