Difference between revisions of "AHM2012-Slicer-Python"

From NAMIC Wiki
Jump to: navigation, search
(Created page with ' == What is accessible via python== Interfaces are build with [http://pythonqt.sourceforge.net/ PythonQt] which exposes most of the [http://qt.nokia.com Qt] interface so that so…')
 
Line 4: Line 4:
 
Interfaces are build with [http://pythonqt.sourceforge.net/ PythonQt] which exposes most of the [http://qt.nokia.com Qt] interface so that sophisticated interfaces can be easily created.
 
Interfaces are build with [http://pythonqt.sourceforge.net/ PythonQt] which exposes most of the [http://qt.nokia.com Qt] interface so that sophisticated interfaces can be easily created.
  
 +
[[Image:SlicerQT-real 174.png|thumb|300px|right|Run-time query of all Qt widgets in the application]]
 
See widgetTree.py example
 
See widgetTree.py example
  

Revision as of 22:48, 7 January 2012

Home < AHM2012-Slicer-Python

What is accessible via python

Interfaces are build with PythonQt which exposes most of the Qt interface so that sophisticated interfaces can be easily created.

Run-time query of all Qt widgets in the application

See widgetTree.py example

It is possible to implement the logic of the effect using VTK Python binding. You can get ideas of what is possible from the VTK tutorials.

Slicer also comes bundled with numpy so many interesting array operations are easy to perform on image data.

It is also possible to invoke slicer command line modules from python. These can be written in any language, but often rely on ITK for processing. In the near future SimpleITK should be available directly inside slicer. See the Slicer4 Python page for examples.

Using the console

(See J2's excellent demo video)

Writing a Scripted Module

      • PythonQt interface
      • Logic with vtk/vtkITK/CLI Modules
      • Accessing MRML Data via numpy

Refining the code and UI with slicerrc

Limitations of python