示例#1
0
    def __init__(self,
                 index=0,
                 coordinate=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        '''
        Initialize a new :class:`RecordingChannel` instance.
        '''
        # Inherited initialization
        # Sets universally recommended attributes, and places all others
        # in annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        # Store required and recommended attributes
        self.index = index
        self.coordinate = coordinate

        # Initialize contianers
        self.analogsignals = []
        self.irregularlysampledsignals = []
        # Many to many relationship
        self.recordingchannelgroups = []
示例#2
0
    def __init__(self,
                 time=0 * pq.s,
                 waveform=None,
                 sampling_rate=None,
                 left_sweep=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        '''
        Initialize a new :class:`Spike` instance.
        '''
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.time = time

        self.waveform = waveform
        self.left_sweep = left_sweep
        self.sampling_rate = sampling_rate

        self.segment = None
        self.unit = None
示例#3
0
 def __init__(self, times=None, durations=None, labels=None, units=None,
              name=None, description=None, file_origin=None, **annotations):
     '''
     Initialize a new :class:`Epoch` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
示例#4
0
    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        if array_annotations is None:
            array_annotations = {}
        for k, v in array_annotations.items():
            array_annotations[k] = np.asarray(v)

        # clean array annotations that are not 1D
        # TODO remove this once multi-dimensional array_annotations are possible
        array_annotations = {
            k: v
            for k, v in array_annotations.items() if v.ndim == 1
        }

        # this mock the array annotations to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
示例#5
0
    def __init__(self,
                 times=None,
                 durations=None,
                 labels=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        '''
        Initialize a new :class:`EpochArray` instance.
        '''
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        if times is None:
            times = np.array([]) * pq.s
        if durations is None:
            durations = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype='S')

        self.times = times
        self.durations = durations
        self.labels = labels

        self.segment = None
示例#6
0
    def __init__(self,
                 channel_names=None,
                 channel_indexes=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        """Initialize a new RecordingChannelGroup."""
        # Inherited initialization
        # Sets universally recommended attributes, and places all others
        # in annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        # Defaults
        if channel_indexes is None:
            channel_indexes = np.array([])
        if channel_names is None:
            channel_names = np.array([])

        # Store recommended attributes
        self.channel_names = channel_names
        self.channel_indexes = channel_indexes

        # Initialize containers for child objects
        self.analogsignalarrays = []
        self.units = []
        # Many to many relationship
        self.recordingchannels = []

        self.block = None
示例#7
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 file_datetime=None,
                 rec_datetime=None,
                 index=None,
                 **annotations):
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.epochs = []
        self.epocharrays = []
        self.events = []
        self.eventarrays = []
        self.analogsignals = []
        self.analogsignalarrays = []
        self.irregularlysampledsignals = []
        self.spikes = []
        self.spiketrains = []

        self.block = None
    def __init__(self, channel_names=None, channel_indexes=None, name=None,
                 description=None, file_origin=None, **annotations):
        """Initialize a new RecordingChannelGroup."""
        # Inherited initialization
        # Sets universally recommended attributes, and places all others
        # in annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        # Defaults
        if channel_indexes is None:
            channel_indexes = np.array([])
        if channel_names is None:
            channel_names = np.array([])

        # Store recommended attributes
        self.channel_names = channel_names
        self.channel_indexes = channel_indexes

        # Initialize containers for child objects
        self.analogsignalarrays = []
        self.units = []
        # Many to many relationship
        self.recordingchannels = []

        self.block = None
示例#9
0
    def __init__(self,
                 times,
                 t_stop,
                 units=None,
                 dtype=np.float,
                 copy=True,
                 sampling_rate=1.0 * pq.Hz,
                 t_start=0.0 * pq.s,
                 waveforms=None,
                 left_sweep=None,
                 name=None,
                 file_origin=None,
                 description=None,
                 **annotations):
        '''
        Initializes a newly constructed :class:`SpikeTrain` instance.
        '''
        # This method is only called when constructing a new SpikeTrain,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
示例#10
0
    def __init__(self,
                 signal,
                 units=None,
                 dtype=None,
                 copy=True,
                 t_start=0 * pq.s,
                 sampling_rate=None,
                 sampling_period=None,
                 name=None,
                 file_origin=None,
                 description=None,
                 **annotations):
        '''
        Initializes a newly constructed :class:`AnalogSignal` instance.
        '''
        # This method is only called when constructing a new AnalogSignal,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
示例#11
0
 def __init__(self, times=None, durations=None, labels=None, units=None,
              name=None, description=None, file_origin=None, **annotations):
     '''
     Initialize a new :class:`Epoch` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, file_origin=None, description=None,
              **annotations):
     '''
     Initializes a newly constructed :class:`IrregularlySampledSignal`
     instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
示例#13
0
 def __init__(self, signal, units=None, dtype=None, copy=True,
              t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
              name=None, file_origin=None, description=None,
              channel_index=None, **annotations):
     '''
     Initializes a newly constructed :class:`AnalogSignalArray` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
示例#14
0
文件: event.py 项目: tkf/neo
 def __init__(self, time, label, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new Event."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     self.time = time
     self.label = label
     
     self.segment =None
 def __init__(self, signal, units=None, dtype=None, copy=True,
              t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
              name=None, file_origin=None, description=None,
              channel_index=None, **annotations):
     '''
     Initializes a newly constructed :class:`AnalogSignalArray` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, description=None, file_origin=None,
              **annotations):
     '''
     Initializes a newly constructed :class:`IrregularlySampledSignal`
     instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
示例#17
0
    def __init__(self, times=np.array([]) * pq.s,
                 labels=np.array([], dtype='S'), name=None, description=None,
                 file_origin=None, **annotations):
        """Initialize a new EventArray."""
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
        self.times = times
        self.labels = labels

        self.segment = None
示例#18
0
    def __init__(self, time, label, name=None, description=None,
                 file_origin=None, **annotations):
        '''
        Initialize a new :class:`Event` instance.
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
        self.time = time
        self.label = label

        self.segment = None
示例#19
0
文件: unit.py 项目: tkf/neo
 def __init__(self, name=None, description=None, file_origin=None, 
                             channel_indexes = None, **annotations):
     """Initialize a new neuronal Unit (spike source)"""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.channel_indexes = channel_indexes
     
     self.spiketrains = [ ]
     self.spikes = [ ]
     
     self.recordingchannelgroup = None
示例#20
0
 def __init__(self, times, values,
               name=None, description=None,
              file_origin=None, **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.times = times
     self.values = values
     
     self.segment = None
     self.recordingchannel = None
示例#21
0
    def __init__(self, name=None, description=None, file_origin=None,
                 file_datetime=None, rec_datetime=None, index=None,
                 **annotations):
        """Initalize a new Block."""
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.segments = []
        self.recordingchannelgroups = []
示例#22
0
    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        # this mock the array annotaions to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        if array_annotations is not None:
            self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
示例#23
0
    def __init__(self, times=None, labels=None, name=None, description=None, file_origin=None, **annotations):
        """
        Initialize a new :class:`EventArray` instance.
        """
        BaseNeo.__init__(self, name=name, file_origin=file_origin, description=description, **annotations)
        if times is None:
            times = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype="S")

        self.times = times
        self.labels = labels

        self.segment = None
示例#24
0
    def __init__(self, name=None, description=None, file_origin=None,
                 channel_indexes=None, **annotations):
        '''
        Initialize a new :clas:`Unit` instance (spike source)
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
示例#25
0
    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        # this mock the array annotaions to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        if array_annotations is not None:
            self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
示例#26
0
    def __init__(self, times, t_stop, units=None,  dtype=np.float,
                 copy=True, sampling_rate=1.0 * pq.Hz, t_start=0.0 * pq.s,
                 waveforms=None, left_sweep=None, name=None, file_origin=None,
                 description=None, **annotations):
        """Initializes newly constructed SpikeTrain."""
        # This method is only called when constructing a new SpikeTrain,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
示例#27
0
    def __init__(self, name=None, description=None, file_origin=None, array_annotations=None,
                 **annotations):
        """
        This method is called by each data object and initializes the newly created object by
        adding array annotations and calling __init__ of the super class, where more annotations
        and attributes are processed.
        """

        if not hasattr(self, 'array_annotations') or not self.array_annotations:
            self.array_annotations = ArrayDict(self._get_arr_ann_length())
        if array_annotations is not None:
            self.array_annotate(**array_annotations)

        BaseNeo.__init__(self, name=name, description=description, file_origin=file_origin,
                         **annotations)
示例#28
0
    def __init__(self, name=None, description=None, file_origin=None, array_annotations=None,
                 **annotations):
        """
        This method is called by each data object and initializes the newly created object by
        adding array annotations and calling __init__ of the super class, where more annotations
        and attributes are processed.
        """

        if not hasattr(self, 'array_annotations') or not self.array_annotations:
            self.array_annotations = ArrayDict(self._get_arr_ann_length())
        if array_annotations is not None:
            self.array_annotate(**array_annotations)

        BaseNeo.__init__(self, name=name, description=description, file_origin=file_origin,
                         **annotations)
示例#29
0
文件: spike.py 项目: tkf/neo
 def __init__(self, time=0*pq.s, waveform=None, sampling_rate=None,
              left_sweep=None, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new Spike."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.time = time
     
     self.waveform = waveform
     self.left_sweep = left_sweep
     self.sampling_rate = sampling_rate
     
     self.segment = None
     self.unit = None
示例#30
0
    def __init__(self, signal, units=None, dtype=None, copy=True,
                 t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
                 name=None, file_origin=None, description=None,
                 channel_index=None, **annotations):
        '''
        Initializes a newly constructed :class:`BaseAnalogSignal` instance.
        '''
        # This method is only called when constructing a new BaseAnalogSignal,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
 def __init__(self,
              times,
              signal,
              units=None,
              time_units=None,
              dtype=None,
              copy=True,
              name=None,
              description=None,
              file_origin=None,
              **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self,
                      name=name,
                      file_origin=file_origin,
                      description=description,
                      **annotations)
示例#32
0
    def __init__(self,
                 times=np.array([]) * pq.s,
                 labels=np.array([], dtype='S'),
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        """Initialize a new EventArray."""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
        self.times = times
        self.labels = labels

        self.segment = None
示例#33
0
    def __init__(self,
                 time,
                 label,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        """Initialize a new Event."""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
        self.time = time
        self.label = label

        self.segment = None
示例#34
0
 def __init__(self, index=0, coordinate=None, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new RecordingChannel."""
     # Inherited initialization
     # Sets universally recommended attributes, and places all others
     # in annotations
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     # Store required and recommended attributes
     self.index = index
     self.coordinate = coordinate
     
     # Initialize contianers
     self.analogsignals = [ ]
     self.irregularlysampledsignals = [ ]
     # Many to many relationship
     self.recordingchannelgroups = [ ]
示例#35
0
文件: segment.py 项目: tkf/neo
 def __init__(self, name=None, description=None, file_origin=None,
              file_datetime=None, rec_datetime=None, index=None, **annotations):
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     self.file_datetime = file_datetime
     self.rec_datetime = rec_datetime
     self.index = index        
     
     self.epochs = [ ]
     self.epocharrays = [ ]
     self.events = [ ]
     self.eventarrays = [ ]
     self.analogsignals = [ ]
     self.analogsignalarrays = [ ]
     self.irregularlysampledsignals = [ ]
     self.spikes = [ ]
     self.spiketrains = [ ]
     
     self.block = None
示例#36
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 channel_indexes=None,
                 **annotations):
        """Initialize a new neuronal Unit (spike source)"""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
示例#37
0
    def __init__(self, times=None, durations=None, labels=None,
                 name=None, description=None, file_origin=None, **annotations):
        '''
        Initialize a new :class:`EpochArray` instance.
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        if times is None:
            times = np.array([]) * pq.s
        if durations is None:
            durations = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype='S')

        self.times = times
        self.durations = durations
        self.labels = labels

        self.segment = None
示例#38
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 file_datetime=None,
                 rec_datetime=None,
                 index=None,
                 **annotations):
        """Initalize a new Block."""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.segments = []
        self.recordingchannelgroups = []
示例#39
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 channel_indexes=None,
                 **annotations):
        '''
        Initialize a new :clas:`Unit` instance (spike source)
        '''
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, description=None, file_origin=None,
              **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)