ViPEr, a Visual programming Environment for Python · Michel F. SANNER TSRI 2002 ViPEr, a Visual...
Transcript of ViPEr, a Visual programming Environment for Python · Michel F. SANNER TSRI 2002 ViPEr, a Visual...
Michel F. SANNER TSRI 2002
ViPErViPEr, a Visual, a Visualprogramming Environmentprogramming Environment
for Pythonfor Python
Michel F. Sanner, Daniel Stoffler
The Scripps Research InstituteLa Jolla, California
The Molecular Graphics Laboratory
SciPy’02
CalTech Pasadena CA. Sept. 2002
SciPy’02, © M.Sanner, TSRI
AcknowledgmentAcknowledgmento NIH - NBCR (Peter Arzberger)
? 5 NCRR representedo NBCR (SDSC)o NCMI (Baylor college)o Computer Graphics Lab (UCSF)o MMTSB (TSRI)o MMMB
o Camera men: Art Olson, Chenglong Lio Enthought: Eric Jones, Travis Vaughto Michael Aivasis, CalTech
SciPy’02, © M.Sanner, TSRI
SCHEDULESCHEDULE
o I –AVSo II – ViPEr
? Basics, Architecture, Libraries
? Nodes, Execution Flow, Widgets, Data Types
o III - Demos
o IV - Conclusion
SciPy’02, © M.Sanner, TSRI
AVS-5: AVS-5: Advanced Visualization System Inc.Advanced Visualization System Inc.
Enabling scientists (non-programmers)to build computational networksEnabling scientists (non-programmers)to build computational networks
SciPy’02, © M.Sanner, TSRI
Lessons learn from AVS-5Lessons learn from AVS-5o GOOD:
? Modularity / extensibility / code-reuse? Enabling scientists (non-programmers) to
build computational networkso BAD:
? Application centric? Lack of programmability? Limited sets of data types? Hard to add new nodes
SciPy’02, © M.Sanner, TSRI
Python to the rescuePython to the rescue
High level language as a scripting environmentHigh level language as a scripting environment
MolecularSurfaces
Molecular
MolecularSurfaces
Surfaces
Molecules
Molecules
Molecules
DataBase
DataDataBaseBaseElectrostatics
Electrostatics
Electrostatics
DelaunayDelaunayDelaunay
Homology
Homology
HomologyCSGCSGCSG
3DViewer
3D3DViewerViewer
MM-MDMM-MDMM-MD
NewMethod
NewNewMethodMethod
Your
MethodYourYour
MethodMethod
SciPy’02, © M.Sanner, TSRI
ViPErViPEr: almost AVS-5: almost AVS-5
SciPy’02, © M.Sanner, TSRI
ViPErViPEr: NOT AVS-5: NOT AVS-5
SciPy’02, © M.Sanner, TSRI
Demo 1Demo 1
SciPy’02, © M.Sanner, TSRI
Architecture OverviewArchitecture Overview
NetworEditor
ViPEr
SciPy’02, © M.Sanner, TSRI
LibrariesLibraries
Standard 3D Viewer Misc.MolKitSymServerImageLibCCP4…
DejaVu
MolKitsymservPIL
ViPER Libraries Python Packages
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNode
MyNode
Input PortName: inPort1Type: StringRequired: 1
Output Portname: outPort1Type: None
‘myfile.dat’ ‘file1.dat’
[myfile.dat’, ‘file1.dat’]
def doit(self, inPort1): out =[] for n in names: out.append( read(n)) self.outputData(outPort1=out)
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
SciPy’02, © M.Sanner, TSRI
class ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
NetworkNodeNetworkNode
SubclassNetworkNode
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
Doc string:will serve as the tooltipin the nodes library
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
This node will N0Tbe editable by a user
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
Input ports description: required arguments: name: string optional arguments: required: (0,1) datatype: type ballons: string noWidgetValue: value
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
Output ports description: required arguments: name: string optional arguments: datatype: type ballons: string noWidgetValue: value
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
Widgets description: Key: port name values: class: widget class master: ‘node’ or None widget specific name:value pairs
SciPy’02, © M.Sanner, TSRI
NetworkNodeNetworkNodeclass ReadImage(NetworkNode): """based on the Image.open function. Reads an image file Input: filename (string) Output: Image""" def __init__(self, name='Read Image'): NetworkNode.__init__(self, name=name) self.readOnly = 1 self.inputPortsDescr.append( {'name':'filename', 'datatype':‘string’} ) self.outputPortsDescr.append( {'name':'image', 'datatype':’image’ } )
self.widgetDescr['filename'] = {'class':NEEntryWithFileBrowser, 'master':'node', 'filetypes': [('all', '*')], 'title':'read image’, 'width':10 } code = """def doit(self, filename): import Image im = Image.open(filename) if im: self.outputData(image=im)\n""" self.setFunction(code)
Computational function: defined as a string set dynamically
SciPy’02, © M.Sanner, TSRI
Node EditorNode Editor
Demo 2
SciPy’02, © M.Sanner, TSRI
Node Libraries, data typesNode Libraries, data types
newlib = NodeLibrary(‘mylibrary’, ‘#AAEECC’)newlib.addNode(ReadImage, ‘Read Image’, ‘input’)
class ImageType(AnyType): def __init__(self): self.name = ‘image’ self.color = ‘#995699’ self.shape = ‘rect1’ def validate(self, data): import Image return isinstance(data, Image.Image)
newlib.typesTable.append( ImageType() )
Create a NodeLibraryObjectcalled ‘mylibrary’ andwith a specific color
SciPy’02, © M.Sanner, TSRI
Node Libraries, data typesNode Libraries, data types
newlib = NodeLibrary(‘mylibrary’, ‘#AAEECC’)newlib.addNode(ReadImage, ‘Read Image’, ‘input’)
class ImageType(AnyType): def __init__(self): self.name = ‘image’ self.color = ‘#995699’ self.shape = ‘rect1’ def validate(self, data): import Image return isinstance(data, Image.Image)
newlib.typesTable.append( ImageType() )
Add a node to the library: (Class, Name, Category)
SciPy’02, © M.Sanner, TSRI
class ImageType(AnyType): def __init__(self): self.name = ‘image’ self.color = ‘#995699’ self.shape = ‘rect1’ def validate(self, data): import Image return isinstance(data, Image.Image)
newlib.typesTable.append( ImageType() )
Node Libraries, data typesNode Libraries, data types
newlib = NodeLibrary(‘mylibrary’, ‘#AAEECC’)newlib.addNode(ReadImage, ‘Read Image’, ‘input’)
Define a new type bysubclassing AnyType.A type object providesat least a name, a colorand a shape.I can also provide avalidation function.
SciPy’02, © M.Sanner, TSRI
Node Libraries, data typesNode Libraries, data types
newlib = NodeLibrary(‘mylibrary’, ‘#AAEECC’)newlib.addNode(ReadImage, ‘Read Image’, ‘input’)
class ImageType(AnyType): def __init__(self): self.name = ‘image’ self.color = ‘#995699’ self.shape = ‘rect1’ def validate(self, data): import Image return isinstance(data, Image.Image)
newlib.typesTable.append( ImageType() )
Add a type to alibrary of nodes.When this library isloaded the type willbe registered
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImagenode0 = ReadImage(name='Read Image’)masterNet.addNode(node0,103,57)widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(‘lena.jpg’,0)## saving node Show Imagefrom ViPEr.pillib import ShowImagenode1 = ShowImage(name='Show Image')masterNet.addNode(node1, 84, 116)
## saving connections for network Network 0masterNet.connectNodes(node0, node1,0,0)
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImagenode0 = ReadImage(name='Read Image’)masterNet.addNode(node0,103,57)widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(‘lena.jpg’,0)## saving node Show Imagefrom ViPEr.pillib import ShowImagenode1 = ShowImage(name='Show Image')masterNet.addNode(node1, 84, 116)
## saving connections for network Network 0masterNet.connectNodes(node0, node1,0,0)
Create a NodeLibraryObjectcalled ‘mylibrary’ andwith a specific color
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImagenode0 = ReadImage(name='Read Image’)masterNet.addNode(node0,103,57)widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(‘lena.jpg’,0)## saving node Show Imagefrom ViPEr.pillib import ShowImagenode1 = ShowImage(name='Show Image')masterNet.addNode(node1, 84, 116)
## saving connections for network Network 0masterNet.connectNodes(node0, node1,0,0)
Get a handle to the widgetConfigure he widgetSet the Widget’s value
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImagenode0 = ReadImage(name='Read Image’)masterNet.addNode(node0,103,57)widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(‘lena.jpg’,0)## saving node Show Imagefrom ViPEr.pillib import ShowImagenode1 = ShowImage(name='Show Image')masterNet.addNode(node1, 84, 116)
## saving connections for network Network 0masterNet.connectNodes(node0, node1,0,0)
Create second node
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImagenode0 = ReadImage(name='Read Image’)masterNet.addNode(node0,103,57)widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(‘lena.jpg’,0)## saving node Show Imagefrom ViPEr.pillib import ShowImagenode1 = ShowImage(name='Show Image')masterNet.addNode(node1, 84, 116)
## saving connections for network Network 0masterNet.connectNodes(node0, node1,0,0)
Create Connectionfrom node0’s output port 0to node1’s input port 0
SciPy’02, © M.Sanner, TSRI
Saving edited nodesSaving edited nodes
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
Subclass originalReadImage node
from ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage})
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
Define modifiedcomputationalfunction
code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code)
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
Describe portsand widgets
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
Create an instance ofNewNode.Remember it does notcome from a library.Add it to the network.
node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
Get a handle to widgetand configure it
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)
SciPy’02, © M.Sanner, TSRI
Saving NetworksSaving Networks## Network: Network 0## file written by viper## saving node Read Imagefrom ViPEr.pillib import ReadImageclass NewNode(ReadImage): def __init__(self, name='Read Image'): apply( ReadImage.__init__, (self,), {'name':name,'originalClass':ReadImage}) code = """def doit(self, filename): print 'Reading file:', filename if filename: im = Image.open(filename)
if im: self.outputData(image=im)""" if code: self.setFunction(code) self.inputPortsDescr=[] self.outputPortsDescr=[] self.widgetDescr = {} self.inputPortsDescr.append( {'validateSrc': None, 'name': 'filename', 'balloons': None, 'required': 1, 'noWidgetValue': '', 'datatype': 'string'})
self.outputPortsDescr.append( {'balloons': None, 'name': 'image', 'datatype': 'image'}) self.widgetDescr['filename'] = { 'class': 'NEEntryWithFileBrowser', 'master': 'node'}node0 = NewNode(name='Read Image')node0.modified=1masterNet.addNode(node0,95,65)
widget = node0.inputPorts[0].widgetcfg = {}apply( widget.configure, (), cfg)if restoreWidgetValues: widget.set(”lena,jpg",0)...
Restore the widget’svalue only if therestoreWidgetValueoption is enabled.
if restoreWidgetValues: widget.set(”lena,jpg",0)
SciPy’02, © M.Sanner, TSRI
MacrosMacros
SciPy’02, © M.Sanner, TSRI
WidgetsWidgets
SciPy’02, © M.Sanner, TSRI
Example 1:Example 1: Tomographic Tomographic reconstructionreconstruction
Image by Daniel Stoffler
SciPy’02, © M.Sanner, TSRI
Example 2:Example 2: symmetry server symmetry server
SciPy’02, © M.Sanner, TSRI
Future DirectionsFuture Directionso Still needs a lot of work :)
? optimization, documentation, addingfeatures
o Multi-threaded execution schedulingo Layered networkso Become Tkinter independent ?o More nodes and libraries, Web repositoryo Integration into PMVo Open Source
Michel F. SANNER TSRI 2002
ConclusionConclusion
o General Purpose VisualProgramming Environment
o Lightweight nodes / code reuseo Dynamically extensibleo Scriptable
o Used on real scientific problems
SciPy’02, © M.Sanner, TSRI
Availability: the Availability: the packagerpackager
http://www.scripps.edu/~sanner/python
SciPy’02, © M.Sanner, TSRI
AcknowledgmentsAcknowledgments
o Molecular Graphics Lab. at TSRIo NIH (NBCR RR08605)o Swiss National Science Foundationo Garrett M. Morris
? (“if > 5” network design)
http://www.scripps.edu/~sanner/python