diff --git a/doc/source/authors.rst b/doc/source/authors.rst index 1a3182b0a..378127866 100644 --- a/doc/source/authors.rst +++ b/doc/source/authors.rst @@ -89,6 +89,8 @@ and may not be the current affiliation of a contributor. * Anthony Pinto [41] * Xin Niu * Nikhil Chandra [40] +* Letizia Signorelli [42] + 1. Centre de Recherche en Neuroscience de Lyon, CNRS UMR5292 - INSERM U1028 - Universite Claude Bernard Lyon 1 2. Unité de Neuroscience, Information et Complexité, CNRS UPR 3293, Gif-sur-Yvette, France @@ -131,6 +133,7 @@ and may not be the current affiliation of a contributor. 39. Massachusetts General Hospital, Department of Molecular Biology 40. Plexon Inc. 41. Paris Brain Institute +42. Centre for Molecular Medicine Norway (NCMM), University of Oslo, Norway diff --git a/neo/rawio/axonarawio.py b/neo/rawio/axonarawio.py index 22387da4c..958edea48 100644 --- a/neo/rawio/axonarawio.py +++ b/neo/rawio/axonarawio.py @@ -377,8 +377,7 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop, strea if channel_indexes is None: channel_indexes = [i for i in range(bin_dict["num_channels"])] elif isinstance(channel_indexes, slice): - channel_indexes_all = [i for i in range(bin_dict["num_channels"])] - channel_indexes = channel_indexes_all[channel_indexes] + channel_indexes = self._get_active_channels() num_samples = i_stop - i_start @@ -561,6 +560,20 @@ def get_active_tetrode(self): tetrode_id = int(key.strip("collectMask_")) active_tetrodes.append(tetrode_id) return active_tetrodes + + def _get_active_channels(self): + """ + Returns the ID numbers of the active channels as a list. + E.g.: [20,21,22,23] for tetrode 6 active. + """ + active_tetrodes = self.get_active_tetrode() + active_channels = [] + + for tetrode in active_tetrodes: + chans = self._get_channel_from_tetrode(tetrode) + active_channels.append(chans) + + return np.concatenate(active_channels) def _get_channel_from_tetrode(self, tetrode): """ @@ -632,12 +645,13 @@ def _get_signal_chan_header(self): gain_list = self._get_channel_gain() offset = 0 # What is the offset? + first_channel = (active_tetrode_set[0] - 1)*elec_per_tetrode sig_channels = [] for itetr in range(num_active_tetrode): for ielec in range(elec_per_tetrode): - cntr = (itetr * elec_per_tetrode) + ielec - ch_name = f"{itetr + 1}{letters[ielec]}" + cntr = (itetr * elec_per_tetrode) + ielec + first_channel + ch_name = f"{itetr + active_tetrode_set[0]}{letters[ielec]}" chan_id = str(cntr) gain = gain_list[cntr] stream_id = "0"