Beispiel #1
0
    def init(self):
        '''
        Secondary init function. See riglib.experiment.Experiment.init()
        Prior to starting the task, this 'init' sets up DataSource objects for streaming from the Blackrock system.
        For LFP streaming, the data is stored as it is received.
        '''

        from riglib import blackrock, source

        if hasattr(self, "_neural_src_type") and hasattr(
                self, "_neural_src_kwargs") and hasattr(
                    self, "_neural_src_system_type"):
            # for testing only!
            self.neurondata = self._neural_src_type(
                self._neural_src_system_type, **self._neural_src_kwargs)
        elif 'spike' in self.decoder.extractor_cls.feature_type:  # e.g., 'spike_counts'
            self.neurondata = source.DataSource(
                blackrock.Spikes,
                channels=self.blackrock_channels,
                send_data_to_sink_manager=False)
        elif 'lfp' in self.decoder.extractor_cls.feature_type:  # e.g., 'lfp_power'
            self.neurondata = source.MultiChanDataSource(
                blackrock.LFP,
                channels=self.blackrock_channels,
                send_data_to_sink_manager=True)
        else:
            raise Exception(
                "Unknown extractor class, unable to create data source object!"
            )

        from riglib import sink
        sink.sinks.register(self.neurondata)

        super(BlackrockData, self).init()
Beispiel #2
0
    def init(self):
        sys_module = self.sys_module  # e.g., riglib.plexon, riglib.blackrock

        kwargs = dict(send_data_to_sink_manager=self.send_data_to_sink_manager,
                      channels=self.cortical_channels)

        if hasattr(self, "_neural_src_type") and hasattr(
                self, "_neural_src_kwargs") and hasattr(
                    self, "_neural_src_system_type"):
            # for testing only!
            self.neurondata = self._neural_src_type(
                self._neural_src_system_type, **self._neural_src_kwargs)
        elif 'spike' in self.decoder.extractor_cls.feature_type:  # e.g., 'spike_counts'
            self.neurondata = source.DataSource(sys_module.Spikes, **kwargs)
        elif 'lfp' in self.decoder.extractor_cls.feature_type:  # e.g., 'lfp_power'
            self.neurondata = source.MultiChanDataSource(
                sys_module.LFP, **kwargs)
        else:
            raise Exception(
                "Unknown extractor class, unable to create data source object!"
            )

        if self.register_with_sink_manager:
            sink_manager = sink.SinkManager.get_instance()
            sink_manager.register(self.neurondata)

        super(CorticalData, self).init()
Beispiel #3
0
 def init(self):
     from riglib import plexon, source
     print channels
     self.neurondata = source.MultiChanDataSource(plexon.LFP, channels=channels, chan_offset=chan_offset)
     try:
         super(PlexonLFPData, self).init()
     except:
         print "PlexonLFPData: running without a task"
    def init(self):
        from riglib import source
        from riglib.brainamp import rda

        self.emgdata = source.MultiChanDataSource(rda.EMGData,
                                                  channels=channels)

        try:
            super(BrainAmpData, self).init()
        except:
            print("BrainAmpData: running without a task")
    def init(self):
        from riglib import blackrock, source

        if 'spike' in extractor_cls.feature_type:  # e.g., 'spike_counts'
            self.neurondata = source.DataSource(blackrock.Spikes, channels=channels)
        elif 'lfp' in extractor_cls.feature_type:  # e.g., 'lfp_power'
            self.neurondata = source.MultiChanDataSource(blackrock.LFP, channels=channels)
        else:
            raise Exception("Unknown extractor class, unable to create data source object!")

        try:
            super(BlackrockData, self).init()
        except:
            print "BlackrockData: running without a task"
from riglib import source
from riglib.brainamp import rda

channels = [1]
s = source.MultiChanDataSource(rda.EMGData, channels=channels, recorder_ip='192.168.137.1')
s.start()