Skip to content

Commit

Permalink
Merge pull request #1558 from zm711/fix-intan-one-channel-per-signal
Browse files Browse the repository at this point in the history
IntanRawIO: Fix memmap order for Intan one-file-per-stream
  • Loading branch information
alejoe91 authored Sep 23, 2024
2 parents eaa6903 + d739a10 commit 0f6c9a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neo/rawio/intanrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def _parse_header(self):
self._raw_data = np.memmap(self.filename, dtype=memmap_data_dtype, mode="r", offset=header_size)

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

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

0 comments on commit 0f6c9a0

Please sign in to comment.