Skip to content

Commit 73b5151

Browse files
authored
Merge pull request #1520 from BoccaraLab/fix_axonarawio
Fix electrode selection in Axona raw recording
2 parents 8e1b6ad + 17d5cbd commit 73b5151

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

doc/source/authors.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ and may not be the current affiliation of a contributor.
9696
* Paul Adkisson [24]
9797
* Luiz Tauffer [24]
9898
* Akshaj Verma [46]
99+
* Letizia Signorelli [47]
99100

100101
1. Centre de Recherche en Neuroscience de Lyon, CNRS UMR5292 - INSERM U1028 - Université Claude Bernard Lyon 1
101102
2. Unité de Neuroscience, Information et Complexité, CNRS UPR 3293, Gif-sur-Yvette, France
@@ -143,6 +144,7 @@ and may not be the current affiliation of a contributor.
143144
44. AquiNeuro, SAS
144145
45. Maxwell Biosystems AG
145146
46. Brain Center, University Medical Center Utrecht, Utrecht University, The Netherlands
147+
47. Centre for Molecular Medicine Norway (NCMM), University of Oslo, Norway
146148

147149

148150

neo/rawio/axonarawio.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop, strea
377377
if channel_indexes is None:
378378
channel_indexes = [i for i in range(bin_dict["num_channels"])]
379379
elif isinstance(channel_indexes, slice):
380-
channel_indexes_all = [i for i in range(bin_dict["num_channels"])]
381-
channel_indexes = channel_indexes_all[channel_indexes]
380+
channel_indexes = self._get_active_channels()
382381

383382
num_samples = i_stop - i_start
384383

@@ -561,6 +560,20 @@ def get_active_tetrode(self):
561560
tetrode_id = int(key.strip("collectMask_"))
562561
active_tetrodes.append(tetrode_id)
563562
return active_tetrodes
563+
564+
def _get_active_channels(self):
565+
"""
566+
Returns the ID numbers of the active channels as a list.
567+
E.g.: [20,21,22,23] for tetrode 6 active.
568+
"""
569+
active_tetrodes = self.get_active_tetrode()
570+
active_channels = []
571+
572+
for tetrode in active_tetrodes:
573+
chans = self._get_channel_from_tetrode(tetrode)
574+
active_channels.append(chans)
575+
576+
return np.concatenate(active_channels)
564577

565578
def _get_channel_from_tetrode(self, tetrode):
566579
"""
@@ -632,12 +645,13 @@ def _get_signal_chan_header(self):
632645
gain_list = self._get_channel_gain()
633646
offset = 0 # What is the offset?
634647

648+
first_channel = (active_tetrode_set[0] - 1)*elec_per_tetrode
635649
sig_channels = []
636650
for itetr in range(num_active_tetrode):
637651

638652
for ielec in range(elec_per_tetrode):
639-
cntr = (itetr * elec_per_tetrode) + ielec
640-
ch_name = f"{itetr + 1}{letters[ielec]}"
653+
cntr = (itetr * elec_per_tetrode) + ielec + first_channel
654+
ch_name = f"{itetr + active_tetrode_set[0]}{letters[ielec]}"
641655
chan_id = str(cntr)
642656
gain = gain_list[cntr]
643657
stream_id = "0"

0 commit comments

Comments
 (0)