Skip to content

Instantly share code, notes, and snippets.

@pieper
Created March 29, 2013 13:03
Show Gist options
  • Save pieper/5270696 to your computer and use it in GitHub Desktop.
Save pieper/5270696 to your computer and use it in GitHub Desktop.
Save a slicer 3D view to an obj file
>>> o = vtk.vtkOBJExporter()
>>> o.SetFilePrefix('/tmp/obj/fibers')
>>> lm = slicer.app.layoutManager()
>>> tdv = lm.threeDWidget(0).threeDView()
>>> rw = tdv.renderWindow()
>>> o.SetRenderWindow(rw)
>>> o.Write()
@anandmulay3
Copy link

error : obj files only support on renderer per window.
slicer 4.8.1
any update in this code??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment