Difference between revisions of "Documentation/Nightly/Developers/FAQ/Python Scripting"

From Slicer Wiki
Jump to: navigation, search
(Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887)
Line 1: Line 1:
={{#titleparts: {{PAGENAME}} | | -1 }}=</noinclude><includeonly>
={{#titleparts: {{PAGENAME}} | | -1 }}=</noinclude><includeonly>

Revision as of 07:55, 14 June 2013

Home < Documentation < Nightly < Developers < FAQ < Python Scripting

For the latest Slicer documentation, visit the read-the-docs.

Python Scripting

How to save an image/volume using python ?

The module slicer.util provides methods allowing to save either a node or an entire scene:

  • saveNode
  • saveScene

For more details see:

How to assign a volume to a Slice view ?

Assuming the MRHead sample data has been loaded, you could do the following:

red_logic = slicer.app.layoutManager().sliceWidget("Red").sliceLogic()
red_cn = red_logic.GetSliceCompositeNode()

Discussion: http://slicer-devel.65872.n3.nabble.com/Assign-volumes-to-views-tt4028694.html