Difference between revisions of "User:Inorton/Slicer4:Python"

From NAMIC Wiki
Jump to: navigation, search
m (Blanked the page)
 
Line 1: Line 1:
==Notes==
 
*Uses a CMake-enabled fork of pythonqt.. not sure which version, but it doesn't import as PyQt4. Use:
 
<pre>import PythonQt</pre>
 
  
*PythonQt wraps vtk objects with array arguments:
 
<pre>
 
>>>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]
 
</pre>
 
 
==Links==
 
*http://zetcode.com/tutorials/pyqt4/introduction/
 

Latest revision as of 20:16, 13 July 2018