forked from fos/fos-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started with micromaps actor idea. Renamed THANKS to CREDITS
- Loading branch information
1 parent
b0fc8c6
commit 91e113e
Showing
5 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import numpy as np | ||
|
||
from fos import Window | ||
from fos.actor.network import AttributeNetwork | ||
|
||
#import fos.lib.pyglet | ||
#fos.lib.pyglet.options['debug_gl'] = True | ||
|
||
wi = Window() | ||
w = wi.get_world() | ||
|
||
# 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'} | ||
} | ||
|
||
def update(self, dt): | ||
if self.living: | ||
print "t@", dt | ||
|
||
cu = AttributeNetwork(affine = aff, | ||
node_position = pos, | ||
node_size = siz, | ||
node_color = col, | ||
node_label = nlabs, | ||
edge_connectivity = edg) | ||
cu.update = update | ||
|
||
w.add(cu) | ||
cu.start() | ||
#w.delete(cu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" An actor to visualize time-depended electrical potential data """ | ||
|
||
sensor_positions : (N,3) | ||
Location of the sensor positions | ||
connectivity : (M,3) | ||
Triangular connectivity of the sensors to make up the surface | ||
|
||
sampling_frequency : | ||
data : (S, N, T) | ||
Number of subjects S, for each sensor N, across time duration T | ||
plot_data : | ||
For each subject and time frame, additional data array | ||
(e.g. probability for microstate) | ||
|
||
nr_maps_to_show : int | ||
The number of maps to show simultaneously for each subject | ||
|
||
# look for delaunay triangulation of a 2d projected coordinate frame as preprocessing step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters