Skip to content

Commit d26589c

Browse files
authored
Merge pull request #1107 from JuliaSprenger/fix/neuralynx_header
Fix neuralynx channel ids and names and add ATLAS acq type
2 parents d5dcd84 + 1093e08 commit d26589c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

neo/rawio/neuralynxrawio/ncssections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ def build_for_ncs_file(ncsMemMap, nlxHdr):
411411

412412
# digital lynx style with fractional frequency and micros per samp determined from
413413
# block times
414-
elif acqType == "DIGITALLYNX" or acqType == "DIGITALLYNXSX":
414+
elif acqType == "DIGITALLYNX" or acqType == "DIGITALLYNXSX" or acqType == 'CHEETAH64':
415415
nomFreq = nlxHdr['sampling_rate']
416416
nb = NcsSectionsFactory._buildForMaxGap(ncsMemMap, nomFreq)
417417

418-
# BML style with fractional frequency and micros per samp
419-
elif acqType == "BML":
418+
# BML & ATLAS style with fractional frequency and micros per samp
419+
elif acqType == "BML" or acqType == "ATLAS":
420420
sampFreqUsed = nlxHdr['sampling_rate']
421421
nb = NcsSectionsFactory._buildGivenActualFrequency(ncsMemMap, sampFreqUsed,
422422
math.floor(sampFreqUsed))

neo/rawio/neuralynxrawio/nlxheader.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ def __init__(self, filename):
152152

153153
# convert channel ids
154154
if 'channel_ids' in self:
155-
chid_entries = re.findall(r'\w+', self['channel_ids'])
155+
chid_entries = re.findall(r'\S+', self['channel_ids'])
156156
self['channel_ids'] = [int(c) for c in chid_entries]
157157
else:
158158
self['channel_ids'] = ['unknown']
159159

160160
# convert channel names
161161
if 'channel_names' in self:
162-
name_entries = re.findall(r'\w+', self['channel_names'])
162+
name_entries = re.findall(r'\S+', self['channel_names'])
163163
if len(name_entries) == 1:
164164
self['channel_names'] = name_entries * len(self['channel_ids'])
165165
assert len(self['channel_names']) == len(self['channel_ids']), \
@@ -288,6 +288,13 @@ def type_of_recording(self):
288288
elif self['HardwareSubSystemType'] == 'DigitalLynxSX':
289289
return 'DIGITALLYNXSX'
290290

291+
# Cheetah64
292+
elif self['HardwareSubSystemType'] == 'Cheetah64':
293+
return 'CHEETAH64'
294+
295+
else:
296+
return 'UNKNOWN'
297+
291298
elif 'FileType' in self:
292299

293300
if self['FileVersion'] in ['3.3', '3.4']:

0 commit comments

Comments
 (0)