Skip to content

Commit 0f6c9a0

Browse files
authored
Merge pull request #1558 from zm711/fix-intan-one-channel-per-signal
IntanRawIO: Fix memmap order for Intan one-file-per-stream
2 parents eaa6903 + d739a10 commit 0f6c9a0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

neo/rawio/intanrawio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def _parse_header(self):
179179
self._raw_data = np.memmap(self.filename, dtype=memmap_data_dtype, mode="r", offset=header_size)
180180

181181
# for 'one-file-per-signal' we have one memory map / neo stream
182+
# based on https://github.com/NeuralEnsemble/python-neo/issues/1556 bug in versions 0.13.1, .2, .3
182183
elif self.file_format == "one-file-per-signal":
183184
self._raw_data = {}
184185
for stream_index, (stream_index_key, stream_datatype) in enumerate(memmap_data_dtype.items()):
@@ -188,8 +189,8 @@ def _parse_header(self):
188189
dtype_size = np.dtype(stream_datatype).itemsize
189190
n_samples = size_in_bytes // (dtype_size * num_channels)
190191
signal_stream_memmap = np.memmap(
191-
file_path, dtype=stream_datatype, mode="r", shape=(num_channels, n_samples)
192-
).T
192+
file_path, dtype=stream_datatype, mode="r", shape=(n_samples, num_channels), order='C',
193+
)
193194
self._raw_data[stream_index] = signal_stream_memmap
194195

195196
# for one-file-per-channel we have one memory map / channel stored as a list / neo stream

0 commit comments

Comments
 (0)