Skip to content

Commit b7fb77e

Browse files
Peter N. SteinmetzPeter N. Steinmetz
authored andcommitted
Don't count features or retrieve WaveformLength from header when determining dtype.
1 parent 2d63e18 commit b7fb77e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

neo/rawio/neuralynxrawio/neuralynxrawio.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -850,20 +850,21 @@ def get_nse_or_ntt_dtype(info, ext):
850850
"""
851851
dtype = [('timestamp', 'uint64'), ('channel_id', 'uint32'), ('unit_id', 'uint32')]
852852

853-
# count feature
854-
nb_feature = 0
855-
for k in info.keys():
856-
if k.startswith('Feature '):
857-
nb_feature += 1
853+
# for purpose of dtypes, features in the file are always fixed 8 presently,
854+
# whether mentioned in the header or not. Features may not be listed in the header
855+
# if no feature names are assigned in Neuralynx software.
856+
nb_feature = 8
858857
dtype += [('features', 'int32', (nb_feature,))]
859858

860-
# count sample
859+
# Number of samples are fixed in the file at 32 for .nse 32 * 4 for .ntt.
860+
# WaveformLength may or may not be listed in the file depending on settings
861+
# in the Neuralynx software, so don't try retrieving it.
861862
if ext == 'nse':
862-
nb_sample = info['WaveformLength']
863+
nb_sample = 32
863864
dtype += [('samples', 'int16', (nb_sample,))]
864865
elif ext == 'ntt':
865-
nb_sample = info['WaveformLength']
866-
nb_chan = 4 # check this if not tetrode
866+
nb_sample = 32
867+
nb_chan = 4
867868
dtype += [('samples', 'int16', (nb_sample, nb_chan))]
868869

869870
return dtype

0 commit comments

Comments
 (0)