Skip to content

Commit 17d1ae2

Browse files
initial commit to plot_features.py
use this file to visualize features on a slice of the data for different channels
1 parent 7b5fac7 commit 17d1ae2

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

plot_features.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from pyside import *
2+
from numpy import *
3+
4+
import h5py
5+
6+
### features file and labels
7+
8+
features_path = "data/features00.h5"
9+
features_h5_path = "features"
10+
11+
labels_path = "data/ws.h5"
12+
labels_h5_path = "ws"
13+
14+
### display options
15+
16+
# the slide to select to show feature values for
17+
z_slide = 10
18+
19+
# select the features you want to display
20+
features = [0, 1, 2, 3]
21+
22+
#######################################################
23+
24+
25+
### import features
26+
27+
f_file = h5py.File(features_path)
28+
f = f_file["features"]
29+
f_file.close()
30+
31+
l_file = h5py.File(labels_path)
32+
l = l_file["ws"]
33+
l_file.close()
34+
35+
36+
dataslice = l[:,:,z_slide]
37+
38+
assert(len(data.shape) == 2)
39+
40+
41+
42+

0 commit comments

Comments
 (0)