Package Pmv :: Package VisionInterface :: Module APBSIsoContour_net
[hide private]
[frames] | no frames]

Source Code for Module Pmv.VisionInterface.APBSIsoContour_net

  1  ######################################################################## 
  2  # 
  3  #    Vision Network - Python source code - file generated by vision 
  4  #    Wednesday 11 April 2007 13:25:04  
  5  #     
  6  #       The Scripps Research Institute (TSRI) 
  7  #       Molecular Graphics Lab 
  8  #       La Jolla, CA 92037, USA 
  9  # 
 10  # Copyright: Daniel Stoffler, Michel Sanner and TSRI 
 11  #    
 12  # revision: Guillaume Vareille 
 13  #   
 14  ######################################################################### 
 15  # 
 16  # $Header: /opt/cvs/python/packages/share1.5/Pmv/VisionInterface/APBSIsoContour_net.py,v 1.35 2007/04/27 22:47:19 vareille Exp $ 
 17  # 
 18  # $Id: APBSIsoContour_net.py,v 1.35 2007/04/27 22:47:19 vareille Exp $ 
 19  # 
 20   
 21  from traceback import print_exc 
 22  ## loading libraries ## 
 23  from Pmv.VisionInterface.PmvNodes import pmvlib 
 24  masterNet.getEditor().addLibraryInstance(pmvlib,"Pmv.VisionInterface.PmvNodes", "pmvlib") 
 25   
 26  from Vision.StandardNodes import stdlib 
 27  masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib") 
 28   
 29  from Volume.VisionInterface.VolumeNodes import vollib 
 30  masterNet.getEditor().addLibraryInstance(vollib,"Volume.VisionInterface.VolumeNodes", "vollib") 
 31   
 32  from DejaVu.VisionInterface.DejaVuNodes import vizlib 
 33  masterNet.getEditor().addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib") 
 34   
 35  try: 
 36      ## saving node VolumeStats ## 
 37      from Volume.VisionInterface.VolumeNodes import VolumeStats 
 38      VolumeStats_1 = VolumeStats(constrkw = {}, name='VolumeStats', library=vollib) 
 39      masterNet.addNode(VolumeStats_1,271,173) 
 40  except: 
 41      print "WARNING: failed to restore VolumeStats named VolumeStats in network masterNet" 
 42      print_exc() 
 43      VolumeStats_1=None 
 44   
 45  try: 
 46      ## saving node GenSurf ## 
 47      from Vision.StandardNodes import Generic 
 48      GenSurf_2 = Generic(constrkw = {}, name='GenSurf', library=stdlib) 
 49      masterNet.addNode(GenSurf_2,411,235) 
 50      apply(GenSurf_2.addInputPort, (), {'name': 'value', 'cast': True, 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) 
 51      apply(GenSurf_2.addInputPort, (), {'name': 'geom1', 'cast': True, 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) 
 52      apply(GenSurf_2.addOutputPort, (), {'name': 'out0', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) 
 53      apply(GenSurf_2.addOutputPort, (), {'name': 'out1', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) 
 54      code = """def doit(self, value, geom1): 
 55       geom1.inheritMaterial = False 
 56       geom1.inheritFrontPolyMode = False 
 57  #     geom1.inheritBackPolyMode = False      
 58       from opengltk.OpenGL import GL 
 59       geom1.frontPolyMode = GL.GL_FILL 
 60  #     geom1.backPolyMode = GL.GL_FILL      
 61       R = 0. 
 62       B = 0. 
 63       if value < 0: 
 64            R = 1. 
 65       else: 
 66            B = 1 
 67       geom1.Set( depthMask = 1) 
 68       geom1.SetMaterial([(0.0,0.0,0.0,0.0),],2) 
 69       geom1.SetMaterial([(0.9,0.9,0.9,1.0),],3) 
 70       geom1.Set(materials=[(R,0.,B,0.8),]) 
 71  #     geom1.Set(culling='None') 
 72   
 73  #     if hasattr(self, 'Label') and #        hasattr(self.Label, 'viewer') and #        hasattr(self.Label.viewer, 'RemoveObject'): 
 74  #         self.Label.viewer.RemoveObject(self.Label) 
 75        
 76       from DejaVu.glfSticker import Sticker 
 77       self.Label = Sticker(name='LeftLabel',  
 78                            label=str(value)[0:7],  
 79                            position=(0, 1), 
 80                            anchor=(0, 1), 
 81                            frameSpace=(2.,.5), 
 82                            frameColor=(R,0,B,.8), 
 83                            fontColor=(1,1,1,1), 
 84                            framePolygonMode=GL.GL_FILL, 
 85                            immediateRendering=True, # just to make sure it's on top of other transparencies 
 86                            transparent=True, 
 87                            ) 
 88        
 89       self.outputData(out0=geom1, out1=self.Label) 
 90   
 91   
 92  ## to ouput data on port out1 use 
 93  ## self.outputData(out1=data) 
 94   
 95   
 96  """ 
 97      GenSurf_2.configure(function=code) 
 98  except: 
 99      print "WARNING: failed to restore Generic named GenSurf in network masterNet" 
100      print_exc() 
101      GenSurf_2=None 
102   
103  try: 
104      ## saving node GenSurf ## 
105      from Vision.StandardNodes import Generic 
106      GenSurf_3 = Generic(constrkw = {}, name='GenSurf', library=stdlib) 
107      masterNet.addNode(GenSurf_3,67,243) 
108      apply(GenSurf_3.addInputPort, (), {'name': 'value', 'cast': True, 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) 
109      apply(GenSurf_3.addInputPort, (), {'name': 'geom1', 'cast': True, 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) 
110      apply(GenSurf_3.addOutputPort, (), {'name': 'out0', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) 
111      apply(GenSurf_3.addOutputPort, (), {'name': 'out1', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) 
112      code = """def doit(self, value, geom1): 
113       geom1.inheritMaterial = False 
114       geom1.inheritFrontPolyMode = False 
115       geom1.inheritBackPolyMode = False 
116       geom1.inheritCulling = False 
117       from opengltk.OpenGL import GL 
118  #     geom1.frontPolyMode = GL.GL_FILL 
119       geom1.backPolyMode = GL.GL_FILL      
120       R = 0. 
121       B = 0. 
122       if value < 0: 
123            R = 1. 
124       else: 
125            B = 1 
126       geom1.Set( depthMask = 1) 
127       geom1.SetMaterial([(0.0,0.0,0.0,0.0),],2) 
128       geom1.SetMaterial([(0.9,0.9,0.9,1.0),],3) 
129       geom1.Set(culling='front') 
130       geom1.Set(materials=[(R,0.,B,0.8),],) 
131                       
132  #     if hasattr(self,'Label') and #        hasattr(self.Label,'viewer') and #        hasattr(self.Label.viewer,'RemoveObject'): 
133  #         self.Label.viewer.RemoveObject(self.Label) 
134   
135       from DejaVu.glfSticker import Sticker 
136       self.Label = Sticker(  name='RightLabel',  
137                              label=str(value)[0:7], 
138                              position=(1, 1), 
139                              anchor=(1, 1), 
140                              frameSpace=(2., .5), 
141                              frameColor=(R,0,B,.8), 
142                              fontColor=(1,1,1,1), 
143                              framePolygonMode=GL.GL_FILL, 
144                              immediateRendering=True, # just to make sure it's on top of other transparencies 
145                              transparent=True,  
146                              ) 
147    
148       self.outputData(out0=geom1,out1 = self.Label ) 
149   
150   
151   
152  ## to ouput data on port out1 use 
153  ## self.outputData(out1=data) 
154   
155   
156  """ 
157      GenSurf_3.configure(function=code) 
158  except: 
159      print "WARNING: failed to restore Generic named GenSurf in network masterNet" 
160      print_exc() 
161      GenSurf_3=None 
162   
163  try: 
164      ## saving node -polygons ## 
165      from DejaVu.VisionInterface.GeometryNodes import IndexedPolygonsNE 
166      _polygons_4 = IndexedPolygonsNE(constrkw = {}, name='-polygons', library=vizlib) 
167      masterNet.addNode(_polygons_4,15,105) 
168      _polygons_4.inputPortByName['name'].widget.set("", run=False) 
169  except: 
170      print "WARNING: failed to restore IndexedPolygonsNE named -polygons in network masterNet" 
171      print_exc() 
172      _polygons_4=None 
173   
174  try: 
175      ## saving node +polygons ## 
176      from DejaVu.VisionInterface.GeometryNodes import IndexedPolygonsNE 
177      _polygons_5 = IndexedPolygonsNE(constrkw = {}, name='+polygons', library=vizlib) 
178      masterNet.addNode(_polygons_5,403,124) 
179      _polygons_5.inputPortByName['name'].widget.set("", run=False) 
180  except: 
181      print "WARNING: failed to restore IndexedPolygonsNE named +polygons in network masterNet" 
182      print_exc() 
183      _polygons_5=None 
184   
185  try: 
186      ## saving node Pmv Viewer ## 
187      from Pmv.VisionInterface.PmvNodes import PmvViewer 
188      Pmv_Viewer_6 = PmvViewer(viewer=masterNet.editor.vf.GUI.VIEWER, constrkw = {'viewer': 'masterNet.editor.vf.GUI.VIEWER'}, name='Pmv Viewer', library=pmvlib) 
189      masterNet.addNode(Pmv_Viewer_6,256,312) 
190      state = {'localViewer': False, 'twoSide': 0, 'ambient': (0.20000000000000001, 0.20000000000000001, 0.20000000000000001, 1.0)} 
191      apply(Pmv_Viewer_6.vi.lightModel.Set, (), state) 
192   
193  except: 
194      print "WARNING: failed to restore PmvViewer named Pmv Viewer in network masterNet" 
195      print_exc() 
196      Pmv_Viewer_6=None 
197   
198  try: 
199      ## saving node Left_Isocontour ## 
200      from Volume.VisionInterface.VolumeNodes import Isocontour 
201      Left_Isocontour_7 = Isocontour(constrkw = {}, name='Left_Isocontour', library=vollib) 
202      masterNet.addNode(Left_Isocontour_7,35,38) 
203      apply(Left_Isocontour_7.addOutputPort, (), {'name': 'isovalue', 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) 
204      apply(Left_Isocontour_7.inputPortByName['isovalue'].widget.configure, (), {'max': 401.27560424804688, 'min': -556.299072265625}) 
205      Left_Isocontour_7.inputPortByName['isovalue'].widget.set(-1.0, run=False) 
206      Left_Isocontour_7.inputPortByName['calculatesignatures'].widget.set(1, run=False) 
207      code = """def doit(self, grid3D, isovalue=1.0,  
208  calculatesignatures=None, verbosity=None): 
209      if verbosity is not None and verbosity!=self.verbosity: 
210          isocontour.setVerboseLevel(verbosity) 
211          self.verbosity = verbosity 
212          return 
213   
214      data = grid3D.data 
215      if self.inputPortByName['grid3D'].hasNewData(): 
216          origin = Numeric.array(grid3D.origin).astype('f') 
217          stepsize = Numeric.array(grid3D.stepSize).astype('f') 
218          # add 1 dimension for time steps amd 1 for multiple variables 
219          if data.typecode()!=Numeric.Float32: 
220              print 'converting from ', data.typecode() 
221              data = data.astype('f')#Numeric.Float32) 
222   
223          self.newgrid3D = Numeric.reshape( Numeric.transpose(data), 
224                                            (1, 1)+tuple(data.shape) ) 
225   
226          # destroy the ConDataset structure 
227          if self.data: 
228              isocontour.delDatasetReg(self.data) 
229               
230          self.data = isocontour.newDatasetRegFloat3D(            self.newgrid3D, origin, stepsize) 
231          self.lastIsoVal = None 
232   
233      if (calculatesignatures == 1) and        ( self.inputPortByName['calculatesignatures'].hasNewData() or          self.inputPortByName['grid3D'].hasNewData() ): 
234          w = self.inputPortByName['isovalue'].widget 
235          if w: 
236              if grid3D is not None: 
237                  sig = [self.data.getSignature(0, 0, 0), 
238                         self.data.getSignature(0, 0, 1), 
239                         self.data.getSignature(0, 0, 2), 
240                         self.data.getSignature(0, 0, 3)] 
241                  w.widget.setSignatures(sig) 
242   
243      if self.data and isovalue!=self.lastIsoVal: 
244          self.lastIsoVal = isovalue 
245          isoc = isocontour.getContour3d(self.data, 0, 0, isovalue, 
246                                         isocontour.NO_COLOR_VARIABLE) 
247   
248          vert = Numeric.zeros((isoc.nvert,3)).astype('f') 
249          norm = Numeric.zeros((isoc.nvert,3)).astype('f') 
250          col = Numeric.zeros((isoc.nvert)).astype('f') 
251          tri = Numeric.zeros((isoc.ntri,3)).astype('i') 
252          isocontour.getContour3dData(isoc, vert, norm, col, tri, 0) 
253   
254          if grid3D.crystal: 
255              vert = grid3D.crystal.toCartesian(vert) 
256               
257          self.outputData(coords=vert, indices=tri, normals=-norm, isovalue=isovalue) 
258          #self.outputData(colors=c) 
259  ## to ouput data on port isovalue use 
260  ## self.outputData(isovalue=data) 
261   
262   
263  """ 
264      Left_Isocontour_7.configure(function=code) 
265      apply(Left_Isocontour_7.configure, (), {'autoRun': False}) 
266  except: 
267      print "WARNING: failed to restore Isocontour named Left_Isocontour in network masterNet" 
268      print_exc() 
269      Left_Isocontour_7=None 
270   
271  try: 
272      ## saving node Right_Isocontour ## 
273      from Volume.VisionInterface.VolumeNodes import Isocontour 
274      Right_Isocontour_8 = Isocontour(constrkw = {}, name='Right_Isocontour', library=vollib) 
275      masterNet.addNode(Right_Isocontour_8,517,34) 
276      apply(Right_Isocontour_8.addOutputPort, (), {'name': 'isovalue', 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) 
277      apply(Right_Isocontour_8.inputPortByName['isovalue'].widget.configure, (), {'max': 401.27560424804688, 'min': -556.299072265625}) 
278      Right_Isocontour_8.inputPortByName['isovalue'].widget.set(1.0, run=False) 
279      Right_Isocontour_8.inputPortByName['calculatesignatures'].widget.set(1, run=False) 
280      code = """def doit(self, grid3D, isovalue=1.0,  
281  calculatesignatures=None, verbosity=None): 
282      if verbosity is not None and verbosity!=self.verbosity: 
283          isocontour.setVerboseLevel(verbosity) 
284          self.verbosity = verbosity 
285          return 
286   
287      data = grid3D.data 
288      if self.inputPortByName['grid3D'].hasNewData(): 
289          origin = Numeric.array(grid3D.origin).astype('f') 
290          stepsize = Numeric.array(grid3D.stepSize).astype('f') 
291          # add 1 dimension for time steps amd 1 for multiple variables 
292          if data.typecode()!=Numeric.Float32: 
293              print 'converting from ', data.typecode() 
294              data = data.astype('f')#Numeric.Float32) 
295   
296          self.newgrid3D = Numeric.reshape( Numeric.transpose(data), 
297                                            (1, 1)+tuple(data.shape) ) 
298   
299          # destroy the ConDataset structure 
300          if self.data: 
301              isocontour.delDatasetReg(self.data) 
302               
303          self.data = isocontour.newDatasetRegFloat3D(            self.newgrid3D, origin, stepsize) 
304          self.lastIsoVal = None 
305   
306      if (calculatesignatures == 1) and        ( self.inputPortByName['calculatesignatures'].hasNewData() or          self.inputPortByName['grid3D'].hasNewData() ): 
307          w = self.inputPortByName['isovalue'].widget 
308          if w: 
309              if grid3D is not None: 
310                  sig = [self.data.getSignature(0, 0, 0), 
311                         self.data.getSignature(0, 0, 1), 
312                         self.data.getSignature(0, 0, 2), 
313                         self.data.getSignature(0, 0, 3)] 
314                  w.widget.setSignatures(sig) 
315   
316      if self.data and isovalue!=self.lastIsoVal: 
317          self.lastIsoVal = isovalue 
318          isoc = isocontour.getContour3d(self.data, 0, 0, isovalue, 
319                                         isocontour.NO_COLOR_VARIABLE) 
320   
321          vert = Numeric.zeros((isoc.nvert,3)).astype('f') 
322          norm = Numeric.zeros((isoc.nvert,3)).astype('f') 
323          col = Numeric.zeros((isoc.nvert)).astype('f') 
324          tri = Numeric.zeros((isoc.ntri,3)).astype('i') 
325          isocontour.getContour3dData(isoc, vert, norm, col, tri, 0) 
326   
327          if grid3D.crystal: 
328              vert = grid3D.crystal.toCartesian(vert) 
329               
330          self.outputData(coords=vert, indices=tri, normals=norm, isovalue=isovalue) 
331          #self.outputData(colors=c) 
332  ## to ouput data on port isovalue use 
333  ## self.outputData(isovalue=data) 
334   
335   
336   
337   
338  """ 
339      Right_Isocontour_8.configure(function=code) 
340      apply(Right_Isocontour_8.configure, (), {'autoRun': False}) 
341  except: 
342      print "WARNING: failed to restore Isocontour named Right_Isocontour in network masterNet" 
343      print_exc() 
344      Right_Isocontour_8=None 
345   
346  try: 
347      ## saving node Pmv Grids ## 
348      from Volume.VisionInterface.VolumeNodes import PmvGridChooser 
349      Pmv_Grids_9 = PmvGridChooser(constrkw = {}, name='Pmv Grids', library=vollib) 
350      masterNet.addNode(Pmv_Grids_9,200,9) 
351      Pmv_Grids_9.inputPortByName['gridName'].widget.set("1CRN.potential.dx", run=False) 
352      apply(Pmv_Grids_9.configure, (), {'expanded': True}) 
353  except: 
354      print "WARNING: failed to restore PmvGridChooser named Pmv Grids in network masterNet" 
355      print_exc() 
356      Pmv_Grids_9=None 
357   
358  masterNet.freeze() 
359   
360  ## saving connections for network APBSIsoContour ## 
361  if GenSurf_2 is not None and Pmv_Viewer_6 is not None: 
362      try: 
363          masterNet.connectNodes( 
364              GenSurf_2, Pmv_Viewer_6, "out0", "geometries", blocking=True) 
365      except: 
366          print "WARNING: failed to restore connection between GenSurf_2 and Pmv_Viewer_6 in network masterNet" 
367  if GenSurf_2 is not None and Pmv_Viewer_6 is not None: 
368      try: 
369          masterNet.connectNodes( 
370              GenSurf_2, Pmv_Viewer_6, "out1", "geometries", blocking=True) 
371      except: 
372          print "WARNING: failed to restore connection between GenSurf_2 and Pmv_Viewer_6 in network masterNet" 
373  if Left_Isocontour_7 is not None and _polygons_4 is not None: 
374      try: 
375          masterNet.connectNodes( 
376              Left_Isocontour_7, _polygons_4, "coords", "coords", blocking=True) 
377      except: 
378          print "WARNING: failed to restore connection between Left_Isocontour_7 and _polygons_4 in network masterNet" 
379  if Left_Isocontour_7 is not None and _polygons_4 is not None: 
380      try: 
381          masterNet.connectNodes( 
382              Left_Isocontour_7, _polygons_4, "indices", "indices", blocking=True) 
383      except: 
384          print "WARNING: failed to restore connection between Left_Isocontour_7 and _polygons_4 in network masterNet" 
385  if Left_Isocontour_7 is not None and _polygons_4 is not None: 
386      try: 
387          masterNet.connectNodes( 
388              Left_Isocontour_7, _polygons_4, "normals", "vnormals", blocking=True) 
389      except: 
390          print "WARNING: failed to restore connection between Left_Isocontour_7 and _polygons_4 in network masterNet" 
391  if GenSurf_3 is not None and Pmv_Viewer_6 is not None: 
392      try: 
393          masterNet.connectNodes( 
394              GenSurf_3, Pmv_Viewer_6, "out0", "geometries", blocking=True) 
395      except: 
396          print "WARNING: failed to restore connection between GenSurf_3 and Pmv_Viewer_6 in network masterNet" 
397  if GenSurf_3 is not None and Pmv_Viewer_6 is not None: 
398      try: 
399          masterNet.connectNodes( 
400              GenSurf_3, Pmv_Viewer_6, "out1", "geometries", blocking=True) 
401      except: 
402          print "WARNING: failed to restore connection between GenSurf_3 and Pmv_Viewer_6 in network masterNet" 
403  if Right_Isocontour_8 is not None and _polygons_5 is not None: 
404      try: 
405          masterNet.connectNodes( 
406              Right_Isocontour_8, _polygons_5, "coords", "coords", blocking=True) 
407      except: 
408          print "WARNING: failed to restore connection between Right_Isocontour_8 and _polygons_5 in network masterNet" 
409  if Right_Isocontour_8 is not None and _polygons_5 is not None: 
410      try: 
411          masterNet.connectNodes( 
412              Right_Isocontour_8, _polygons_5, "indices", "indices", blocking=True) 
413      except: 
414          print "WARNING: failed to restore connection between Right_Isocontour_8 and _polygons_5 in network masterNet" 
415  if Right_Isocontour_8 is not None and _polygons_5 is not None: 
416      try: 
417          masterNet.connectNodes( 
418              Right_Isocontour_8, _polygons_5, "normals", "vnormals", blocking=True) 
419      except: 
420          print "WARNING: failed to restore connection between Right_Isocontour_8 and _polygons_5 in network masterNet" 
421  if _polygons_4 is not None and GenSurf_3 is not None: 
422      try: 
423          masterNet.connectNodes( 
424              _polygons_4, GenSurf_3, "indexedPolygons", "geom1", blocking=True) 
425      except: 
426          print "WARNING: failed to restore connection between _polygons_4 and GenSurf_3 in network masterNet" 
427  if Left_Isocontour_7 is not None and GenSurf_3 is not None: 
428      try: 
429          masterNet.connectNodes( 
430              Left_Isocontour_7, GenSurf_3, "isovalue", "value", blocking=True) 
431      except: 
432          print "WARNING: failed to restore connection between Left_Isocontour_7 and GenSurf_3 in network masterNet" 
433  if _polygons_5 is not None and GenSurf_2 is not None: 
434      try: 
435          masterNet.connectNodes( 
436              _polygons_5, GenSurf_2, "indexedPolygons", "geom1", blocking=True) 
437      except: 
438          print "WARNING: failed to restore connection between _polygons_5 and GenSurf_2 in network masterNet" 
439  if Right_Isocontour_8 is not None and GenSurf_2 is not None: 
440      try: 
441          masterNet.connectNodes( 
442              Right_Isocontour_8, GenSurf_2, "isovalue", "value", blocking=True) 
443      except: 
444          print "WARNING: failed to restore connection between Right_Isocontour_8 and GenSurf_2 in network masterNet" 
445  if Pmv_Grids_9 is not None and Left_Isocontour_7 is not None: 
446      try: 
447          masterNet.connectNodes( 
448              Pmv_Grids_9, Left_Isocontour_7, "grid", "grid3D", blocking=True) 
449      except: 
450          print "WARNING: failed to restore connection between Pmv_Grids_9 and Left_Isocontour_7 in network masterNet" 
451  if Pmv_Grids_9 is not None and Right_Isocontour_8 is not None: 
452      try: 
453          masterNet.connectNodes( 
454              Pmv_Grids_9, Right_Isocontour_8, "grid", "grid3D", blocking=True) 
455      except: 
456          print "WARNING: failed to restore connection between Pmv_Grids_9 and Right_Isocontour_8 in network masterNet" 
457  if Pmv_Grids_9 is not None and VolumeStats_1 is not None: 
458      try: 
459          masterNet.connectNodes( 
460              Pmv_Grids_9, VolumeStats_1, "grid", "grid", blocking=True) 
461      except: 
462          print "WARNING: failed to restore connection between Pmv_Grids_9 and VolumeStats_1 in network masterNet" 
463  masterNet.unfreeze() 
464  #masterNet.run() 
465