In [1]:
import numpy as np
import scipy.io
from yass.evaluate import stability, util, visualization, analyzer
Here for demonstration, we use retinal dataset that we have gold standard for.
To instantiate, you just have to give the path to .yaml file.
If there is a gold standard spike train you can perform accuracy, if you only can have stability.
Do not run this code on two configuration files that share the same root_dir.
In [2]:
# Get the gold standard spike train which shape (N, 2)
map_ = scipy.io.loadmat('/ssd/data/peter/ej49_dataset/groundtruth_ej49_data1_set1.mat')
gstd_spike_train = np.append(map_['spt_gt'], map_['L_gt'], axis=1).astype('int32')
# Pass the configuration file.
a = analyzer.Analyzer('/ssd/data/hooshmand/newyass/stability2/config_dummy.yaml', gstd_spike_train)
a.run_analyses()
In [3]:
a.visualize('stability')
Using the same method, you can plot waveforms of units of interes. Note that for each indicated unit, you have two wavefors
In [4]:
a.visualize('stability', units=[12, 50, 60])
In [5]:
a.visualize('accuracy')
In [6]:
a.visualize('accuracy', units=[5, 9, 27])
In [ ]: