Difference between revisions of "Documentation/Nightly/Developers/Tutorials/ExportToMaya"

From Slicer Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
[[File:OBJtracts.png|300px|Fiber tracts in the Slicer 3D View]]  
 
[[File:OBJtracts.png|300px|Fiber tracts in the Slicer 3D View]]  
  
Python code to capture the contents of the 3D View and export to an OBJ file called 'tracts'
+
Python code to capture the contents of the 3D View and export to an OBJ file called ''tracts''
  
 
     exporter = vtk.vtkOBJExporter()
 
     exporter = vtk.vtkOBJExporter()
Line 11: Line 11:
  
  
This code created two files ''tracts.obj'' and ''tracts.mtl'' which are available in [[Media:OBJtracts.tar OBJtracts.tar]].
+
This code created two files ''tracts.obj'' and ''tracts.mtl'' which are available in [[Media:OBJtracts.tar|OBJtracts.tar]].

Latest revision as of 13:26, 18 December 2013

Home < Documentation < Nightly < Developers < Tutorials < ExportToMaya

Fiber tracts in the Slicer 3D View

Python code to capture the contents of the 3D View and export to an OBJ file called tracts

   exporter = vtk.vtkOBJExporter()
   exporter.SetFilePrefix('/tmp/tracts')
   layoutManager = slicer.app.layoutManager()
   view = layoutManager.threeDWidget(0).threeDView()
   exporter.SetRenderWindow(view.renderWindow())
   exporter.Write()


This code created two files tracts.obj and tracts.mtl which are available in OBJtracts.tar.