@@ -105,6 +105,13 @@ def _to_bool(txt):
105105 r' \(h:m:s\.ms\) (?P<time>\S+)' ,
106106 filename_regex = r'## File Name (?P<filename>\S+)' ,
107107 datetimeformat = '%m/%d/%Y %H:%M:%S.%f' ),
108+ 'neuraview2' : dict (
109+ datetime1_regex = r'## Date Opened: \(mm/dd/yyy\): (?P<date>\S+)'
110+ r' At Time: (?P<time>\S+)' ,
111+ datetime2_regex = r'## Date Closed: \(mm/dd/yyy\): (?P<date>\S+)'
112+ r' At Time: (?P<time>\S+)' ,
113+ filename_regex = r'## File Name: (?P<filename>\S+)' ,
114+ datetimeformat = '%m/%d/%Y %H:%M:%S' ),
108115 # Cheetah after v 5.6.4 and default for others such as Pegasus
109116 'def' : dict (
110117 datetime1_regex = r'-TimeCreated (?P<date>\S+) (?P<time>\S+)' ,
@@ -148,7 +155,7 @@ def __init__(self, filename):
148155 chid_entries = re .findall (r'\w+' , self ['channel_ids' ])
149156 self ['channel_ids' ] = [int (c ) for c in chid_entries ]
150157 else :
151- self ['channel_ids' ] = [name ]
158+ self ['channel_ids' ] = ['unknown' ]
152159
153160 # convert channel names
154161 if 'channel_names' in self :
@@ -158,7 +165,7 @@ def __init__(self, filename):
158165 assert len (self ['channel_names' ]) == len (self ['channel_ids' ]), \
159166 'Number of channel ids does not match channel names.'
160167 else :
161- self ['channel_names' ] = [name ] * len (self ['channel_ids' ])
168+ self ['channel_names' ] = ['unknown' ] * len (self ['channel_ids' ])
162169
163170 # version and application name
164171 # older Cheetah versions with CheetahRev property
@@ -172,10 +179,15 @@ def __init__(self, filename):
172179 match = re .findall (pattern , self ['ApplicationName' ])
173180 assert len (match ) == 1 , 'impossible to find application name and version'
174181 self ['ApplicationName' ], app_version = match [0 ]
175- # BML Ncs file writing contained neither property, assume BML version 2
176- else :
182+ # BML Ncs file contain neither property, but 'NLX_Base_Class_Type'
183+ elif 'NLX_Base_Class_Type' in txt_header :
177184 self ['ApplicationName' ] = 'BML'
178185 app_version = "2.0"
186+ # Neuraview Ncs file contained neither property nor
187+ # NLX_Base_Class_Type information
188+ else :
189+ self ['ApplicationName' ] = 'Neuraview'
190+ app_version = '2'
179191
180192 self ['ApplicationVersion' ] = distutils .version .LooseVersion (app_version )
181193
@@ -216,6 +228,9 @@ def __init__(self, filename):
216228 elif an == 'BML' :
217229 hpd = NlxHeader .header_pattern_dicts ['bml' ]
218230 av = "2"
231+ elif an == 'Neuraview' :
232+ hpd = NlxHeader .header_pattern_dicts ['neuraview2' ]
233+ av = "2"
219234 else :
220235 an = "Unknown"
221236 av = "NA"
0 commit comments