def test_run_study_sorters():
    study = GroundTruthStudy(study_folder)
    sorter_list = [
        'tridesclous',
    ]
    print(
        f"\n#################################\nINSTALLED SORTERS\n#################################\n"
        f"{installed_sorters()}")
    study.run_sorters(sorter_list)
Beispiel #2
0
def _setup_comparison_study():
    rec0, gt_sorting0 = toy_example(num_channels=4, duration=30, seed=0, num_segments=1)
    rec1, gt_sorting1 = toy_example(num_channels=32, duration=30, seed=0, num_segments=1)
    
    gt_dict = {
        'toy_tetrode': (rec0, gt_sorting0),
        'toy_probe32': (rec1, gt_sorting1),
    }
    study = GroundTruthStudy.create(study_folder, gt_dict)
Beispiel #3
0
##############################################################################
# Setup study folder and run all sorters
# --------------------------------------
# 
# We first generate the folder.
# this can take some time because recordings are copied inside the folder.


rec0, gt_sorting0 = se.toy_example(num_channels=4, duration=10, seed=10, num_segments=1)
rec1, gt_sorting1 = se.toy_example(num_channels=4, duration=10, seed=0, num_segments=1)
gt_dict = {
    'rec0': (rec0, gt_sorting0),
    'rec1': (rec1, gt_sorting1),
}
study_folder = 'a_study_folder'
study = GroundTruthStudy.create(study_folder, gt_dict)

##############################################################################
# Then just run all sorters on all recordings in one functions.

# sorter_list = st.sorters.available_sorters() # this get all sorters.
sorter_list = ['herdingspikes', 'tridesclous', ]
study.run_sorters(sorter_list, mode_if_folder_exists="keep")

##############################################################################
# You can re run **run_study_sorters** as many time as you want.
# By default **mode='keep'** so only uncomputed sorter are rerun.
# For instance, so just remove the "sorter_folders/rec1/herdingspikes" to re-run
# only one sorter on one recording.
#
# Then we copy the spike sorting outputs into a separate subfolder.
Beispiel #4
0
def test_extract_sortings():
    study = GroundTruthStudy(study_folder)
    
    study.copy_sortings()
    
    

    for rec_name in study.rec_names:
        gt_sorting = study.get_ground_truth(rec_name)
    

    for rec_name in study.rec_names:
        metrics = study.get_metrics(rec_name=rec_name)
        
        snr = study.get_units_snr(rec_name=rec_name)

    

    study.copy_sortings()

    run_times = study.aggregate_run_times()
    

    study.run_comparisons(exhaustive_gt=True)

    perf = study.aggregate_performance_by_units()
    
    count_units = study.aggregate_count_units()
    dataframes = study.aggregate_dataframes()
    print(dataframes)