Skip to content

Commit

Permalink
Merge pull request #1249 from zm711/master
Browse files Browse the repository at this point in the history
Add Access to Intan Digital-In and Digital-Out from the RawIO API
  • Loading branch information
samuelgarcia authored Sep 22, 2023
2 parents 354c8d9 + dc5beb9 commit 340b022
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions neo/rawio/intanrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,24 @@

class IntanRawIO(BaseRawIO):
"""
Intan reader can handle two file formats 'rhd' and 'rhs'. It will automatically
check for the file extension and will gather the header information based on the
extension. Additionally it functions with RHS v 1.0 and RHD 1.0, 1.1, 1.2, 1.3, 2.0,
3.0, and 3.1 files.
Intan files contain amplifier channels labeled 'A', 'B' 'C' or 'D'
depending on the port in which they were recorded along with the following
additional channels.
1: 'RHD2000 auxiliary input channel',
2: 'RHD2000 supply voltage channel',
3: 'USB board ADC input channel',
4: 'USB board digital input channel',
5: 'USB board digital output channel'
Due to the structure of the digital input and output channels these can be accessed
as one long vector, which must be post-processed.
Parameters
----------
filename: str
name of the 'rhd' or 'rhs' data file
"""
extensions = ['rhd', 'rhs']
rawmode = 'one-file'
Expand Down Expand Up @@ -543,10 +560,17 @@ def read_rhd(filename):
# 4: USB board digital input channel
# 5: USB board digital output channel
for sig_type in [4, 5]:
# at the moment theses channel are not in sig channel list
# but they are in the raw memamp
# Now these are included so that user can obtain the
# dig signals and process them at the same time
if len(channels_by_type[sig_type]) > 0:
name = {4: 'DIGITAL-IN', 5: 'DIGITAL-OUT'}[sig_type]
chan_info = channels_by_type[sig_type][0]
chan_info['native_channel_name'] = name # overwite to allow memmap to work
chan_info['sampling_rate'] = sr
chan_info['units'] = 'TTL' # arbitrary units so I did TTL for the logic
chan_info['gain'] = 1.0
chan_info['offset'] = 0.0
ordered_channels.append(chan_info)
data_dtype += [(name, 'uint16', BLOCK_SIZE)]

if bool(global_info['notch_filter_mode']) and version >= V('3.0'):
Expand Down

0 comments on commit 340b022

Please sign in to comment.