import numpy as np from fos import SimpleWindow, run from fos.actor.network import AttributeNetwork wi = SimpleWindow() # node positions pos = np.array( [ [0,0,0], [10,10,10] ], dtype = np.float32) siz = np.array( [ [1.0, 1.0 ]], dtype = np.float32 ) col = np.array( [ [255,0,0,255], [0,255,0,255]], dtype = np.ubyte) edg = np.array( [ [0,1]], dtype = np.uint32 ) aff = np.eye(4, dtype = np.float32) aff[:3,3] = [0,0,0] nlabs = {0 : { 'label' : 'Node 1', 'size' : 20, 'font' : 'Times New Roman', 'color' : ( 255, 0, 0, 255 ) }, 1 : { 'label' : 'Node 2'} } cu = AttributeNetwork(affine = aff, node_position = pos, node_size = siz, node_color = col, node_label = nlabs, edge_connectivity = edg)
print parents print labeling print colors mycpt = "Treedemo - Fos.me" try: # Try and create a window with multisampling (antialiasing) config = Config( sample_buffers=1, samples=4, depth_size=16, double_buffer=True, ) window = Window(resizable=True, config=config, vsync=False, width=1000, height=800, caption=mycpt) # "vsync=False" to check the framerate except fos.lib.pyglet.window.NoSuchConfigException: # Fall back to no multisampling for old hardware print "fallback" window = Window(resizable=True, caption=mycpt) ac = [] # spread factor s = 500 # duplicator d = 30 # tune it up # this is very inefficient, because it copies the position arrays
pos = f['neurons/position'].value parents = f['neurons/localtopology'].value labeling = f['neurons/labeling'].value colors = f['neurons/segmentcolors'].value f.close() print pos print parents print labeling print colors mycpt = "Treedemo - Fos.me" try: # Try and create a window with multisampling (antialiasing) config = Config(sample_buffers=1, samples=4,depth_size=16, double_buffer=True,) window = Window(resizable=True, config=config, vsync=False, width=1000, height=800, caption = mycpt) # "vsync=False" to check the framerate except pyglet.window.NoSuchConfigException: # Fall back to no multisampling for old hardware print "fallback" window = Window(resizable=True, caption = mycpt) ac=[] # spread factor s=500 # duplicator d = 30 # tune it up # this is very inefficient, because it copies the position arrays bigpos = np.zeros( (d*len(pos), 3), dtype = np.float32 ) bigpar = np.zeros( (d*len(parents)), dtype = np.float32 )