Esempio n. 1
0
def test_pruningshears():

    dirname = 'test_cluster'
    
    
    dataio = DataIO(dirname=dirname)
    print(dataio)
    cc = CatalogueConstructor(dataio=dataio)
    #~ print(cc.mode)
    #~ exit()
    
    #~ cc.extract_some_features(method='pca_by_channel')
    #~ print(dataio)
    #~ print(cc)
    
    if dataset_name == 'olfactory_bulb':
        kargs = dict(adjacency_radius_um = 420)
    else:
        kargs = {}
    
    t0 = time.perf_counter()
    #~ cc.find_clusters(method='pruningshears', print_debug=True)
    #~ cc.find_clusters(method='pruningshears', print_debug=True, debug_plot=True, **kargs)
    cc.find_clusters(method='pruningshears', print_debug=False, debug_plot=False, **kargs)
    t1 = time.perf_counter()
    print('cluster', t1-t0)

    if __name__ == '__main__':
        app = mkQApp()
        win = CatalogueWindow(cc)
        win.show()
        app.exec_()
Esempio n. 2
0
def test_sawchaincut():
    #~ dirname = 'test_catalogueconstructor'
    #~ dirname = '/home/samuel/Documents/projet/tridesclous/example/tridesclous_locust/'

    #~ dirname = '/home/samuel/Documents/projet/DataSpikeSorting/GT 252/tdc_20170623_patch1/'
    #~ dirname = '/home/samuel/Documents/projet/tridesclous/example/tridesclous_locust/'
    #~ dirname = '/home/samuel/Documents/projet/tridesclous/example/tridesclous_olfactory_bulb/'
    #~ dirname = '/home/samuel/Documents/projet/tridesclous/example/tridesclous_olfactory_bulb/'
    #~ dirname = '/home/samuel/Documents/projet/DataSpikeSorting/kampff/tdc_2015_09_03_Cell9.0/'
    #~ dirname = '/home/samuel/Documents/projet/DataSpikeSorting/spikesortingtest/tdc_silico_0/'
    dirname = '/home/samuel/Documents/projet/tridesclous/example/tridesclous_purkinje/'

    dataio = DataIO(dirname=dirname)
    cc = catalogueconstructor = CatalogueConstructor(dataio=dataio)
    print(dataio)
    print(cc)

    t0 = time.perf_counter()
    cc.find_clusters(method='sawchaincut')
    t1 = time.perf_counter()
    print('cluster', t1 - t0)
    #~ exit()

    print(cc)

    app = mkQApp()
    win = CatalogueWindow(catalogueconstructor)
    win.show()

    app.exec_()
Esempio n. 3
0
def test_sawchaincut():
    dirname = 'test_cluster'

    dataio = DataIO(dirname=dirname)
    cc = CatalogueConstructor(dataio=dataio)
    #~ print(dataio)
    #~ print(cc)

    t0 = time.perf_counter()
    cc.find_clusters(method='sawchaincut', print_debug=True)
    t1 = time.perf_counter()
    print('cluster', t1 - t0)
    #~ exit()

    #~ print(cc)

    if __name__ == '__main__':
        app = mkQApp()
        win = CatalogueWindow(cc)
        win.show()
        app.exec_()
Esempio n. 4
0
def test_pruningshears():

    dirname = 'test_cluster'

    dataio = DataIO(dirname=dirname)
    print(dataio)
    cc = CatalogueConstructor(dataio=dataio)

    #~ cc.extract_some_features(method='pca_by_channel')
    #~ print(dataio)
    #~ print(cc)

    t0 = time.perf_counter()
    cc.find_clusters(method='pruningshears', print_debug=True)
    t1 = time.perf_counter()
    print('cluster', t1 - t0)

    if __name__ == '__main__':
        app = mkQApp()
        win = CatalogueWindow(cc)
        win.show()
        app.exec_()
def test_one_decomposition():
    dirname = 'test_catalogueconstructor'
    
    dataio = DataIO(dirname=dirname)
    cc = catalogueconstructor = CatalogueConstructor(dataio=dataio)
    print(dataio)
    print(cc)
    
    t0 = time.perf_counter()
    #~ cc.extract_some_features(method='global_pca', n_components=7)
    #~ cc.extract_some_features(method='peak_max')
    #~ cc.extract_some_features(method='pca_by_channel', n_components_by_channel=3)
    cc.extract_some_features(method='neighborhood_pca', n_components_by_neighborhood=3, radius_um=500)
    
    print(cc.channel_to_features)
    print(cc.channel_to_features.shape)
    t1 = time.perf_counter()
    print('extract_some_features', t1-t0)

    app = mkQApp()
    win = CatalogueWindow(catalogueconstructor)
    win.show()
    app.exec_()