Skip to content

Commit bc60370

Browse files
Merge pull request #945 from samuelgarcia/openephys_binary
Start again openephys binary rawio.
2 parents 7a1cd85 + f61a76e commit bc60370

File tree

8 files changed

+570
-4
lines changed

8 files changed

+570
-4
lines changed

neo/io/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* :attr:`NeuroshareIO`
4343
* :attr:`NixIO`
4444
* :attr:`OpenEphysIO`
45+
* :attr:`OpenEphysBinaryIO`
4546
* :attr:`PhyIO`
4647
* :attr:`PickleIO`
4748
* :attr:`PlexonIO`
@@ -172,6 +173,10 @@
172173
173174
.. autoattribute:: extensions
174175
176+
.. autoclass:: neo.io.OpenEphysBinaryIO
177+
178+
.. autoattribute:: extensions
179+
175180
.. autoclass:: neo.io.PhyIO
176181
177182
.. autoattribute:: extensions
@@ -270,6 +275,7 @@
270275
from neo.io.nixio import NixIO
271276
from neo.io.nixio_fr import NixIO as NixIOFr
272277
from neo.io.openephysio import OpenEphysIO
278+
from neo.io.openephysbinaryio import OpenEphysBinaryIO
273279
from neo.io.phyio import PhyIO
274280
from neo.io.pickleio import PickleIO
275281
from neo.io.plexonio import PlexonIO
@@ -314,6 +320,7 @@
314320
NeuroScopeIO,
315321
NeuroshareIO,
316322
OpenEphysIO,
323+
OpenEphysBinaryIO,
317324
PhyIO,
318325
PickleIO,
319326
PlexonIO,

neo/io/openephysbinaryio.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from neo.io.basefromrawio import BaseFromRaw
2+
from neo.rawio.openephysbinaryrawio import OpenEphysBinaryRawIO
3+
4+
5+
class OpenEphysBinaryIO(OpenEphysBinaryRawIO, BaseFromRaw):
6+
_prefered_signal_group_mode = 'group-by-same-units'
7+
mode = 'dir'
8+
9+
def __init__(self, dirname):
10+
OpenEphysBinaryRawIO.__init__(self, dirname=dirname)
11+
BaseFromRaw.__init__(self, dirname)

neo/io/proxyobjects.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ def __init__(self, array_annotations=None, **annotations):
3333
# used to be str so raw bytes
3434
annotations['file_origin'] = str(self._rawio.source_name())
3535

36-
# this mock the array annotaions to avoid inherits DataObject
36+
if array_annotations is None:
37+
array_annotations = {}
38+
for k, v in array_annotations.items():
39+
array_annotations[k] = np.asarray(v)
40+
41+
# clean array annotations that are not 1D
42+
# TODO remove this once multi-dimensional array_annotations are possible
43+
array_annotations = {k: v for k, v in array_annotations.items()
44+
if v.ndim == 1}
45+
46+
# this mock the array annotations to avoid inherits DataObject
3747
self.array_annotations = ArrayDict(self.shape[-1])
38-
if array_annotations is not None:
39-
self.array_annotations.update(array_annotations)
48+
self.array_annotations.update(array_annotations)
4049

4150
BaseNeo.__init__(self, **annotations)
4251

neo/rawio/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* :attr:`NeuroScopeRawIO`
2626
* :attr:`NIXRawIO`
2727
* :attr:`OpenEphysRawIO`
28+
* :attr:`OpenEphysBinaryRawIO`
2829
* :attr:'PhyRawIO'
2930
* :attr:`PlexonRawIO`
3031
* :attr:`RawBinarySignalRawIO`
@@ -88,6 +89,10 @@
8889
8990
.. autoattribute:: extensions
9091
92+
.. autoclass:: neo.rawio.OpenEphysBinaryRawIO
93+
94+
.. autoattribute:: extensions
95+
9196
.. autoclass:: neo.rawio.PhyRawIO
9297
9398
.. autoattribute:: extensions
@@ -141,6 +146,7 @@
141146
from neo.rawio.neuroscoperawio import NeuroScopeRawIO
142147
from neo.rawio.nixrawio import NIXRawIO
143148
from neo.rawio.openephysrawio import OpenEphysRawIO
149+
from neo.rawio.openephysbinaryrawio import OpenEphysBinaryRawIO
144150
from neo.rawio.phyrawio import PhyRawIO
145151
from neo.rawio.plexonrawio import PlexonRawIO
146152
from neo.rawio.rawbinarysignalrawio import RawBinarySignalRawIO
@@ -165,6 +171,7 @@
165171
NeuroScopeRawIO,
166172
NIXRawIO,
167173
OpenEphysRawIO,
174+
OpenEphysBinaryRawIO,
168175
PhyRawIO,
169176
PlexonRawIO,
170177
RawBinarySignalRawIO,

0 commit comments

Comments
 (0)