コード例 #1
0
ファイル: filter_test1.py プロジェクト: Gjergj/OpenElectrophy
def test1():
    bl = generate_block_for_sorting(nb_unit = 6,
                                                        duration = 10.*pq.s,
                                                        noise_ratio = 0.2,
                                                        nb_segment = 2,
                                                        )
    rcg = bl.recordingchannelgroups[0]

    spikesorter = SpikeSorter(rcg)

    #~ spikesorter.ButterworthFilter( f_low = 200.)
    #~ spikesorter.DerivativeFilter()
    spikesorter.SlidingMedianFilter(window_size =  50.*pq.ms,
                             sliding_step =  25.*pq.ms, interpolation = 'spline')
    
    
    spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 4.,noise_estimation = 'MAD', threshold_mode = 'peak',  peak_span = 0.5*pq.ms)
    
    
    print spikesorter

    spikesorter.check_display_attributes()
    
    from OpenElectrophy.gui.spikesorting import FilteredBandSignal

    app = QApplication([ ])
    w1 = FilteredBandSignal(spikesorter = spikesorter)
    w1.refresh()
    w1.show()
    app.exec_()
コード例 #2
0
def test1():
    bl = generate_block_for_sorting(nb_unit = 6,
                                                        duration = 10.*pq.s,
                                                        noise_ratio = 0.7,
                                                        nb_segment = 2,
                                                        )
    rcg = bl.recordingchannelgroups[0]

    spikesorter = SpikeSorter(rcg)

    spikesorter.ButterworthFilter( f_low = 200.)
    #~ spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'MAD', threshold_mode = 'crossing',
                        #~ consistent_across_channels = False,
                        #~ consistent_across_segments = True,                                                                                
                                                                                #~ )
    #~ print spikesorter
    spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'MAD', threshold_mode = 'peak', peak_span = 0.53*pq.ms)
    print spikesorter.detection_thresholds
    print spikesorter
    #~ spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'STD', threshold_mode = 'crossing', )
    #~ print spikesorter
    #~ spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'STD', threshold_mode = 'peak', peak_span = 0.3*pq.ms )
    #~ print spikesorter
    spikesorter.populate_recordingchannelgroup(with_waveforms = False)
    

    
    spikesorter.check_display_attributes()
    from OpenElectrophy.gui.spikesorting import FilteredBandSignal
    app = QApplication([ ])
    w2 = FilteredBandSignal(spikesorter = spikesorter)
    w2.refresh()
    w2.show()
    app.exec_()
コード例 #3
0
def test1():
    app = QApplication([ ])
    #~ w1 = FullBandSignal(spikesorter = spikesorter)
    #~ w1.refresh()
    #~ w1.show()
    
    w2 = FilteredBandSignal(spikesorter = spikesorter)
    w2.refresh()
    w2.show()
    w2.spike_clusters_changed.connect(w2.refresh)


    #~ w3 = SignalStatistics(spikesorter = spikesorter)
    #~ w3.refresh()
    #~ w3.show()

    

    app.exec_()
コード例 #4
0
def test1():
    bl = generate_block_for_sorting(nb_unit = 6,
                                                        duration = 10.*pq.s,
                                                        noise_ratio = 0.7,
                                                        nb_segment = 2,
                                                        )
    rcg = bl.recordingchannelgroups[0]

    spikesorter = SpikeSorter(rcg)

    spikesorter.ButterworthFilter( f_low = 200.)
    spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'MAD', threshold_mode = 'peak', peak_span = 0.4*pq.ms)
    spikesorter.AlignWaveformOnPeak(left_sweep = 1*pq.ms , right_sweep = 2*pq.ms, sign = '-', peak_method = 'biggest_amplitude')
    spikesorter.PcaFeature(n_components = 4)
    spikesorter.SklearnGaussianMixtureEm(n_cluster = 5)
    
    

    
    spikesorter.check_display_attributes()
    from OpenElectrophy.gui.spikesorting import FilteredBandSignal, AverageWaveforms
    app = QApplication([ ])
    w1 = AverageWaveforms(spikesorter = spikesorter)
    w1.refresh()
    w1.show()
    
    w2 = FilteredBandSignal(spikesorter = spikesorter)
    w2.refresh()
    w2.show()
    app.exec_()
コード例 #5
0
def test1():
    bl = generate_block_for_sorting(
        nb_unit=6,
        duration=10. * pq.s,
        noise_ratio=0.2,
        nb_segment=2,
    )
    rcg = bl.recordingchannelgroups[0]

    spikesorter = SpikeSorter(rcg)

    #~ spikesorter.ButterworthFilter( f_low = 200.)
    #~ spikesorter.DerivativeFilter()
    spikesorter.SlidingMedianFilter(window_size=50. * pq.ms,
                                    sliding_step=25. * pq.ms,
                                    interpolation='spline')

    spikesorter.RelativeThresholdDetection(sign='-',
                                           relative_thresh=4.,
                                           noise_estimation='MAD',
                                           threshold_mode='peak',
                                           peak_span=0.5 * pq.ms)

    print spikesorter

    spikesorter.check_display_attributes()

    from OpenElectrophy.gui.spikesorting import FilteredBandSignal

    app = QApplication([])
    w1 = FilteredBandSignal(spikesorter=spikesorter)
    w1.refresh()
    w1.show()
    app.exec_()
コード例 #6
0
def test1():
    app = QApplication([ ])
    w1 = FullBandSignal(spikesorter = spikesorter)
    w1.refresh()
    w1.show()
    
    w2 = FilteredBandSignal(spikesorter = spikesorter)
    w2.refresh()
    w2.show()
    
    w2.spike_clusters_changed.connect(w2.refresh)
    
    
    w2.shared_view_with = w1
    w1.shared_view_with = w2

    #~ w3 = SignalStatistics(spikesorter = spikesorter)
    #~ w3.refresh()
    #~ w3.show()

    #~ w4 = BetweenSpikeNoiseEstimation(spikesorter = spikesorter)
    #~ w4.refresh()
    #~ w4.show()

    

    app.exec_()
コード例 #7
0
def test1():
    app = QApplication([])
    w1 = FullBandSignal(spikesorter=spikesorter)
    w1.refresh()
    w1.show()

    w2 = FilteredBandSignal(spikesorter=spikesorter)
    w2.refresh()
    w2.show()

    w2.spike_clusters_changed.connect(w2.refresh)

    w2.shared_view_with = w1
    w1.shared_view_with = w2

    #~ w3 = SignalStatistics(spikesorter = spikesorter)
    #~ w3.refresh()
    #~ w3.show()

    #~ w4 = BetweenSpikeNoiseEstimation(spikesorter = spikesorter)
    #~ w4.refresh()
    #~ w4.show()

    app.exec_()
コード例 #8
0
def test1():
    bl = generate_block_for_sorting(
        nb_unit=6,
        duration=10. * pq.s,
        noise_ratio=0.7,
        nb_segment=2,
    )
    rcg = bl.recordingchannelgroups[0]

    spikesorter = SpikeSorter(rcg)

    spikesorter.ButterworthFilter(f_low=200.)
    #~ spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'MAD', threshold_mode = 'crossing',
    #~ consistent_across_channels = False,
    #~ consistent_across_segments = True,
    #~ )
    #~ print spikesorter
    spikesorter.RelativeThresholdDetection(sign='-',
                                           relative_thresh=3.5,
                                           noise_estimation='MAD',
                                           threshold_mode='peak',
                                           peak_span=0.53 * pq.ms)
    print spikesorter.detection_thresholds
    print spikesorter
    #~ spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'STD', threshold_mode = 'crossing', )
    #~ print spikesorter
    #~ spikesorter.RelativeThresholdDetection(sign= '-', relative_thresh = 3.5,noise_estimation = 'STD', threshold_mode = 'peak', peak_span = 0.3*pq.ms )
    #~ print spikesorter
    spikesorter.populate_recordingchannelgroup(with_waveforms=False)

    spikesorter.check_display_attributes()
    from OpenElectrophy.gui.spikesorting import FilteredBandSignal
    app = QApplication([])
    w2 = FilteredBandSignal(spikesorter=spikesorter)
    w2.refresh()
    w2.show()
    app.exec_()
コード例 #9
0
        noise_ratio=0.2,
    )
    rcg = bl.recordingchannelgroups[0]
    spikesorter = SpikeSorter(rcg)

    # Apply a chain
    spikesorter.ButterworthFilter(f_low=200.)
    # equivalent to
    # spikesorter.run_step(ButterworthFilter, f_low = 200.)
    spikesorter.MedianThresholdDetection(sign='-', median_thresh=6)
    spikesorter.AlignWaveformOnDetection(left_sweep=1 * pq.ms,
                                         right_sweep=2 * pq.ms)
    spikesorter.PcaFeature(n_components=6)
    spikesorter.SklearnGaussianMixtureEm(n_cluster=6, n_iter=200)

    from PyQt4.QtGui import QApplication
    app = QApplication([])

    spikesorter.check_display_attributes()

    w1 = AverageWaveforms(spikesorter=spikesorter)
    w2 = FeaturesNDViewer(spikesorter=spikesorter)
    w3 = FilteredBandSignal(spikesorter=spikesorter)

    all = [w1, w2, w3]
    for w in all:
        w.refresh()
        w.show()

    app.exec_()