def test_neo_rawio_sources():
    #~ from neo.rawio.tdtrawio import TdtRawIO
    #~ local_tdt_folder = get_tdt_test_files()
    #~ neorawio = TdtRawIO(dirname=local_tdt_folder)
    #~ neorawio.parse_header()
    #~ print(neorawio)

    from neo.rawio.blackrockrawio import BlackrockRawIO
    filename = get_blackrock_files()
    neorawio = BlackrockRawIO(filename=filename)
    neorawio.parse_header()
    print(neorawio)

    sources = ephyviewer.get_sources_from_neo_rawio(neorawio)
    #~ print(sources)

    for s in sources['signal']:
        print(s.t_start, s.nb_channel, s.sample_rate)
        print(s.get_chunk(i_start=0, i_stop=1024).shape)

    for s in sources['epoch']:
        print(s.t_start, s.nb_channel)
        #~ print(s.get_chunk(i_start=0, i_stop=1024).shape)
        print(s.get_chunk_by_time(chan=0, t_start=None, t_stop=None))

    for s in sources['spike']:
        print(s.t_start, s.nb_channel)
        print(s.get_chunk_by_time(chan=0, t_start=None, t_stop=None))
Example #2
0
def test_neoviewer():
    #TODO make autorun neo tdtrawio test before
    from neo.rawio.tdtrawio import TdtRawIO

    dirname = '/tmp/files_for_testing_neo/tdt/aep_05/'
    neorawio = TdtRawIO(dirname=dirname)
    neorawio.parse_header()
    print(neorawio)

    sources = ephyviewer.get_sources_from_neo_rawio(neorawio)


    app = ephyviewer.mkQApp()
    win = ephyviewer.MainViewer(debug=True, show_auto_scale=True)

    for i, sig_source in enumerate(sources['signal']):
        view = ephyviewer.TraceViewer(source=sig_source, name='signal {}'.format(i))
        win.add_view(view)

    for i, ep_source in enumerate(sources['epoch']):
        view = ephyviewer.EpochViewer(source=ep_source, name='epochs')
        win.add_view(view)

    win.show()

    app.exec_()
def test_neoviewer(interactive=False):
    #~ from neo.rawio.tdtrawio import TdtRawIO

    #~ local_tdt_folder = get_tdt_test_files()
    #~ neorawio = TdtRawIO(dirname=local_tdt_folder)
    #~ neorawio.parse_header()
    #~ print(neorawio)

    from neo.rawio.blackrockrawio import BlackrockRawIO
    filename = get_blackrock_files()
    neorawio = BlackrockRawIO(filename=filename)
    neorawio.parse_header()
    print(neorawio)

    sources = ephyviewer.get_sources_from_neo_rawio(neorawio)
    print(sources)

    app = ephyviewer.mkQApp()
    win = ephyviewer.MainViewer(debug=True, show_auto_scale=True)

    for i, sig_source in enumerate(sources['signal']):
        view = ephyviewer.TraceViewer(source=sig_source,
                                      name='signal {}'.format(i))
        win.add_view(view)

    for i, ep_source in enumerate(sources['epoch']):
        view = ephyviewer.EpochViewer(source=ep_source, name='epochs')
        win.add_view(view)

    if interactive:
        win.show()
        app.exec_()
    else:
        # close thread properly
        win.close()
Example #4
0
    def open_ephyviewer(self):
        if self.win_viewer is not None:
            self.win_viewer.close()
            self.win_viewer = None

        if self.dataio is None:
            return
        if not hasattr(self.dataio.datasource, 'rawios'):
            return

        sources = ephyviewer.get_sources_from_neo_rawio(
            self.dataio.datasource.rawios[0])

        self.win_viewer = ephyviewer.MainViewer()

        for i, sig_source in enumerate(sources['signal']):
            view = ephyviewer.TraceViewer(source=sig_source,
                                          name='signal {}'.format(i))
            view.params['scale_mode'] = 'same_for_all'
            view.params['display_labels'] = True
            view.auto_scale()
            if i == 0:
                self.win_viewer.add_view(view)
            else:
                self.win_viewer.add_view(view,
                                         tabify_with='signal {}'.format(i - 1))

        self.win_viewer.show()
def test_neoviewer(interactive=False):
    from neo.rawio.tdtrawio import TdtRawIO

    local_test_dir = get_tdt_test_files()
    dirname = os.path.join(local_test_dir, 'aep_05')
    neorawio = TdtRawIO(dirname=dirname)
    neorawio.parse_header()
    print(neorawio)

    sources = ephyviewer.get_sources_from_neo_rawio(neorawio)

    app = ephyviewer.mkQApp()
    win = ephyviewer.MainViewer(debug=True, show_auto_scale=True)

    for i, sig_source in enumerate(sources['signal']):
        view = ephyviewer.TraceViewer(source=sig_source,
                                      name='signal {}'.format(i))
        win.add_view(view)

    for i, ep_source in enumerate(sources['epoch']):
        view = ephyviewer.EpochViewer(source=ep_source, name='epochs')
        win.add_view(view)

    if interactive:
        win.show()
        app.exec_()
    else:
        # close thread properly
        win.close()
Example #6
0
def test_neo_rawio_sources():
    from neo.rawio.tdtrawio import TdtRawIO

    local_test_dir = get_tdt_test_files()
    dirname = os.path.join(local_test_dir, 'aep_05')
    neorawio = TdtRawIO(dirname=dirname)
    neorawio.parse_header()
    print(neorawio)

    sources = ephyviewer.get_sources_from_neo_rawio(neorawio)
    #~ print(sources)

    for s in sources['signal']:
        print(s.t_start, s.nb_channel, s.sample_rate)
        print(s.get_chunk(i_start=0, i_stop=1024).shape)

    for s in sources['epoch']:
        print(s.t_start, s.nb_channel)
        #~ print(s.get_chunk(i_start=0, i_stop=1024).shape)
        print(s.get_chunk_by_time(chan=0, t_start=None, t_stop=None))

    for s in sources['spike']:
        print(s.t_start, s.nb_channel)
        print(s.get_chunk_by_time(chan=0, t_start=None, t_stop=None))
Example #7
0
def test_neo_rawio_sources():
    #TODO make autorun neo tdtrawio test before
    from neo.rawio.tdtrawio import TdtRawIO

    dirname = '/tmp/files_for_testing_neo/tdt/aep_05/'
    neorawio = TdtRawIO(dirname=dirname)
    neorawio.parse_header()
    print(neorawio)

    sources = ephyviewer.get_sources_from_neo_rawio(neorawio)
    #~ print(sources)

    for s in sources['signal']:
        print(s.t_start, s.nb_channel, s.sample_rate)
        print(s.get_chunk(i_start=0, i_stop=1024).shape)

    for s in sources['epoch']:
        print(s.t_start, s.nb_channel)
        #~ print(s.get_chunk(i_start=0, i_stop=1024).shape)
        print(s.get_chunk_by_time(chan=0, t_start=None, t_stop=None))

    for s in sources['spike']:
        print(s.t_start, s.nb_channel)
        print(s.get_chunk_by_time(chan=0, t_start=None, t_stop=None))