From b7fb77e33a76aad0bba9ae177497edd8948f5ad2 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 13 Jan 2023 14:30:11 -0700 Subject: [PATCH 01/17] Don't count features or retrieve WaveformLength from header when determining dtype. --- neo/rawio/neuralynxrawio/neuralynxrawio.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/neo/rawio/neuralynxrawio/neuralynxrawio.py b/neo/rawio/neuralynxrawio/neuralynxrawio.py index 8f46bb9d0..1b5b91a2f 100644 --- a/neo/rawio/neuralynxrawio/neuralynxrawio.py +++ b/neo/rawio/neuralynxrawio/neuralynxrawio.py @@ -850,20 +850,21 @@ def get_nse_or_ntt_dtype(info, ext): """ dtype = [('timestamp', 'uint64'), ('channel_id', 'uint32'), ('unit_id', 'uint32')] - # count feature - nb_feature = 0 - for k in info.keys(): - if k.startswith('Feature '): - nb_feature += 1 + # for purpose of dtypes, features in the file are always fixed 8 presently, + # whether mentioned in the header or not. Features may not be listed in the header + # if no feature names are assigned in Neuralynx software. + nb_feature = 8 dtype += [('features', 'int32', (nb_feature,))] - # count sample + # Number of samples are fixed in the file at 32 for .nse 32 * 4 for .ntt. + # WaveformLength may or may not be listed in the file depending on settings + # in the Neuralynx software, so don't try retrieving it. if ext == 'nse': - nb_sample = info['WaveformLength'] + nb_sample = 32 dtype += [('samples', 'int16', (nb_sample,))] elif ext == 'ntt': - nb_sample = info['WaveformLength'] - nb_chan = 4 # check this if not tetrode + nb_sample = 32 + nb_chan = 4 dtype += [('samples', 'int16', (nb_sample, nb_chan))] return dtype From a53d6c20d11f043a6edda3f122a56c454ec27706 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Mon, 16 Jan 2023 15:54:25 -0700 Subject: [PATCH 02/17] Add Cheetah560 headers and acquisition type. --- neo/rawio/neuralynxrawio/nlxheader.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/neo/rawio/neuralynxrawio/nlxheader.py b/neo/rawio/neuralynxrawio/nlxheader.py index 0f3980390..9bb5fba79 100644 --- a/neo/rawio/neuralynxrawio/nlxheader.py +++ b/neo/rawio/neuralynxrawio/nlxheader.py @@ -97,6 +97,12 @@ def _to_bool(txt): r' At Time: (?P