User:Inorton/Slicer4:Python

From NAMIC Wiki
Jump to: navigation, search

Notes

  • Uses a CMake-enabled fork of pythonqt.. not sure which version, but it doesn't import as PyQt4. Use:
import PythonQt
  • PythonQt wraps vtk objects with array arguments:
>>>box = vtk.vtkBox
>>>bds = [0.0 for i in range(6)]
>>>box.SetBounds( scene.GetNodeByID('vtkMRMLAnnotationROINode1') )
>>>box.GetBounds(bds)
>>>bds
[-22.492652893066406, 52.710166931152344, 36.159854888916016, 36.605098724365234, 11.289838790893555, 55.752235412597656]

Links