Skip to content

CLASS ndr.reader.intan_rhd

  NDR_READER_INTAN_RHD - Reader class for Intan Technologies .RHD
  file

  This class reads data from Intan Technologies .RHD file format.

  Intan Technologies: http://intantech.com

Superclasses

ndr.reader.base

Properties

none

Methods

Method Description
canbereadtogether can the channels in a channel struct be read in a single function call?
daqchannels2internalchannels Convert a set of DAQ channel
epochclock return the ndr.time.clocktype objects for an epoch
filenamefromepochfiles Return the file name that corresponds to the .RHD file, or directory in case of directory
getchannelsepoch List the channels that are available on this Intan
intan_rhd Create a new Neuroscience Data Reader object
intananychannelname2intanchanneltype Converts a channel bank from Intan native format or relative format to the appropriate Intan channel type
intanchanneltype2mfdaqchanneltype Convert the channel type to generic format of multifuncdaqchannel
intanheadertype2mfdaqchanneltype Convert between Intan headers and the ndr.ndr.reader.mfdaq channel types
intanname2mfdaqname Converts a channel name from Intan native format to ndr.ndr.reader.mfdaq format
mfdaq_channeltypes channel types for ndi.daq.system.mfdaq objects
mfdaq_prefix Give the channel prefix for a channel type
mfdaq_type Give the preferred long channel type for a channel type
mfdaqchanneltype2intanchanneltype Convert the channel type from generic format of multifuncdaqchannel
mfdaqchanneltype2intanfreqheader Return header name with frequency information for channel type
mfdaqchanneltype2intanheadertype Convert between the ndr.ndr.reader.mfdaq channel types and Intan headers
readchannels_epochsamples Read the data based on specified channels
readevents_epochsamples_native read events or markers of specified channels for a specified epoch
samplerate Get the sample rate for specific channel
t0_t1 Return the beginning and end epoch times for an

Methods help

canbereadtogether - can the channels in a channel struct be read in a single function call?

[B,ERRORMSG] = CANBEREADTOGETHER(NDR_READER_BASE_OBJ, CHANNELSTRUCT)

  Returns 1 if the NDR_READER_BASE_OBJ can read all of the channels in
  CHANNELSTRUCT with a single function call. If they cannot be read together,
  a description is provided in ERRORMSG.

  In the abstract class, this returns 1 if all of the samplerate values are
  the same and none are NaNs.

  CHANNELSTRUCT is a structure with the following fields:
  ------------------------------------------------------------------------------
  | Parameter                   | Description                                  |
  |-----------------------------|----------------------------------------------|
  | internal_type               | Internal channel type; the type of channel as|
  |                             |   it is known to the device.                 |
  | internal_number             | Internal channel number, as known to device  |
  | internal_channelname        | Internal channel name, as known to the device|
  | ndr_type                    | The NDR type of channel; should be one of the|
  |                             |   types returned by                          |
  |                             |   ndr.reader.base.mfdaq_type                 |
  | samplerate                  | The sampling rate of this channel, or NaN if |
  |                             |   not applicable.
  ------------------------------------------------------------------------------

  in the abstract class, this returns 1 if all the samplerates are the same
  and none are NaNs

Help for ndr.reader.intan_rhd/canbereadtogether is inherited from superclass ndr.reader.base

daqchannels2internalchannels - Convert a set of DAQ channel

prefixes and channel numbers to an internal structure to pass to
  internal reading functions

   CHANNELSTRUCT = DAQCHANNELS2INTERNALCHANNELS(INTAN_RHD_OBJ, ...
      CHANNELPREFIX, CHANNELNUMBERS, EPOCHSTREAMS, EPOCH_SELECT)

   Inputs:
   For a set of CHANNELPREFIX (cell array of channel prefixes that
   describe channels for this device) and CHANNELNUMBER (array of
   of channel numbers, 1 for each entry in CHANNELPREFIX), and for
   a given recording epoch (specified by EPOCHSTREAMS and
   EPOCH_SELECT), this function returns a structure CHANNELSTRUCT
   describing the channel information that should be passed to
   READCHANNELS_EPOCHSAMPLES or READEVENTS_EPOCHSAMPLES.

   EPOCHSTREAMS is a cell array of full path file names or remote
   access streams that comprise the epoch of data.

   EPOCH_SELECT allows one to choose which epoch in the file one
   wants to access, if the file(s) has more than epoch contained.
   For most devices, EPOCH_SELECT is always 1.

  Output: CHANNELSTRUCT is a structure with the following fields:
  ------------------------------------------------------------------------------
  | Parameter                   | Description                                  |
  |-----------------------------|----------------------------------------------|
  | internal_type               | Internal channel type; the type of channel as|
  |                             |   it is known to the device. This is the type|
  |                             |   that readepoch_samples takes               |
  | internal_number             | Internal channel number, as known to device  |
  | internal_channelname        | Internal channel name, as known to the device|
  | ndr_type                    | The NDR type of channel; should be one of the|
  |                             |   types returned by                          |
  |                             |   ndr.reader.base.mfdaq_type                 |
  | samplerate                  | The sampling rate of this channel, or NaN if |
  |                             |   not applicable.                            |
  ------------------------------------------------------------------------------

  Examples for Intan. Channels can be specified by either absolute reference
  (for example, A-000 means the first channel in bank A) or in relative reference
  (for example, ai1 means the first channel that was turned on; the one that appears
  first in the header file).

  Example: 
    % absolute reference
    channelstruct_1 = daqchannels2internalchannels(intan_rhd_obj, 'A', 0, epochstreams, epoch_select)
    % channelstruct_1.internal_type = 'ai';
    % channelstruct_1.internal_number = 1; % assuming A-000 is the first channel acquired
    % channelstruct_1.internal_channelname = 'A-000'; 
    % channelstruct_1.ndr_type = 'ai'; % analog input
    % channelstruct_1.samplerate = 20000;

    % relative reference
    channelstruct_2 = daqchannels2internalchannels(intan_rhd_obj, 'ai', 1, epochstreams, epoch_select)
    % channelstruct_2.internal_type = 'ai';
    % channelstruct_2.internal_number = 1; % we asked for the first internal/relative channel
    % channelstruct_2.internal_channelname = 'A-000'; % assuming A-000 is the first channel acquired 
    % channelstruct_2.ndr_type = 'ai'; % analog input
    % channelstruct_2.samplerate = 20000;

epochclock - return the ndr.time.clocktype objects for an epoch

EC = EPOCHCLOCK(NDR_READER_BASE_OBJ, EPOCHSTREAMS, EPOCH_SELECT)

  Return the clock types available for this epoch as a cell array
  of ndr.time.clocktype objects (or sub-class members).

  For the generic ndr.reader.base, this returns a single clock
  type 'dev_local'time';

  See also: ndr.time.clocktype

Help for ndr.reader.intan_rhd/epochclock is inherited from superclass ndr.reader.base

filenamefromepochfiles - Return the file name that corresponds to the .RHD file, or directory in case of directory

[FILENAME, PARENTDIR, ISDIRECTORY] = FILENAMEFROMEPOCHFILES(NDR_NDRREADER_INTANREADER_OBJ, FILENAME_ARRAY)

   Examines the list of filenames in FILENAME_ARRAY (cell array of full path file strings) and determines which
   one is an .RHD data file. If the 1-file-per-channel mode is used, then PARENTDIR is the name of the directory
   that holds the data files and ISDIRECTORY is 1.

getchannelsepoch - List the channels that are available on this Intan

device for a given set of files

   CHANNELS = GETCHANNELSEPOCH(INTANREADER_OBJ, EPOCHSTREAMS, EPOCH_SELECT)

   Returns the channel list of acquired channels in this epoch.

  CHANNELS is a structure list of all channels with fields:
  ---------------------------------------------------------
  'name'             | The name of the channel (e.g., 'ai1')
  'type'             | The type of data store in the channel
                     |    (e.g., 'analogin', 'digitalin', 'image', 'timestamp')

intan_rhd - Create a new Neuroscience Data Reader object

INTAN_RHD_OBJ = INTAN_RHD()

   Creates a Neuroscience Data Reader object of the Intan
   Technologies .RHD file format.

    Documentation for ndr.reader.intan_rhd/intan_rhd
       doc ndr.reader.intan_rhd

intananychannelname2intanchanneltype - Converts a channel bank from Intan native format or relative format to the appropriate Intan channel type

[INTANCHANNELTYPE,ABSOLUTE] = INTANANYCHANNELNAME2INTANCHANNELTYPE(INTANANYCHANNELNAME)

   Converts any channel name into the type needed to call ndr.format.intan.readfile. If the channel was specified
   as an absolute reference (that is, 'A', 'B', etc), then ABSOLUTE is 1. Otherwise, if the reference is relative,
   then ABSOLUTE is 0.

   Examples:
         intanchanneltype = ndr.reader.intan_rhd.intananychannelname2intanchanneltype('ai') % returns 'amp', 0
         intanchanneltype = ndr.reader.intan_rhd.intananychannelname2intanchanneltype('A') % returns 'amp', 1
         intanchanneltype = ndr.reader.intan_rhd.intananychannelname2intanchanneltype('DIN') % returns 'din', 0

intanchanneltype2mfdaqchanneltype - Convert the channel type to generic format of multifuncdaqchannel

from the specific Intan channel type

   INTANCHANNELTYPE = MFDAQCHANNELTYPE2INTANCHANNELTYPE(CHANNELTYPE)

   The intanchanneltype is a string of the specific channel type for Intan.

intanheadertype2mfdaqchanneltype - Convert between Intan headers and the ndr.ndr.reader.mfdaq channel types

CHANNELTYPE = INTANHEADERTYPE2MFDAQCHANNELTYPE(INTANCHANNELTYPE)

   Given an Intan header file type, returns the standard ndi.ndr.reader.mfdaq channel type.

intanname2mfdaqname - Converts a channel name from Intan native format to ndr.ndr.reader.mfdaq format

[CHANNAME] = INTANNAME2MFDAQNAME(NDR_NDRREADER_INTANREADER_OBJ, TYPE, NAME)

   Given an Intan native channel name (e.g., 'A-000') in NAME and an
   ndr.ndr.reader.mfdaq channel type string (see NDI_DEVICE_MFDAQ), this function
   produces an ndr.ndr.reader.mfdaq channel name (e.g., 'ai1').

mfdaq_channeltypes - channel types for ndi.daq.system.mfdaq objects

CT = MFDAQ_CHANNELTYPES - channel types for ndi.daq.system.mfdaq objects

   Returns a cell array of strings of supported channels of the
   ndi.daq.system.mfdaq class. These are the following:

   Channel type:       | Description: 
   -------------------------------------------------------------
   analog_in           | Analog input channel
   aux_in              | Auxiliary input
   analog_out          | Analog output channel
   digital_in          | Digital input channel
   digital_out         | Digital output channel
   marker              | 

  See also: ndi.daq.system.mfdaq/MFDAQ_TYPE

Help for ndr.reader.intan_rhd.mfdaq_channeltypes is inherited from superclass ndr.reader.base

mfdaq_prefix - Give the channel prefix for a channel type

PREFIX = MFDAQ_PREFIX(CHANNELTYPE)

   Produces the channel name prefix for a given CHANNELTYPE.

  Channel type:               | MFDAQ_PREFIX:
  ---------------------------------------------------------
  'analog_in',       'ai'     | 'ai' 
  'analog_out',      'ao'     | 'ao'
  'digital_in',      'di'     | 'di'
  'digital_out',     'do'     | 'do'
  'time','timestamp','t'      | 't'
  'auxiliary','aux','ax',     | 'ax'
     'auxiliary_in'           | 
  'mark', 'marker', or 'mk'   | 'mk'
  'text'                      | 'text'
  'event' or 'e'              | 'e'
  'metadata' or 'md'          | 'md'
  'digital_in_event', 'de',   | 'dep'
  'digital_in_event_pos','dep'| 
  'digital_in_event_neg','den'| 'den'
  'digital_in_mark','dimp',   | 'dimp'
  'digital_in_mark_pos','dim' |
  'digital_in_mark_neg','dimn'| 'dimn'

  See also: ndi.daq.system.mfdaq/MFDAQ_TYPE

Help for ndr.reader.intan_rhd.mfdaq_prefix is inherited from superclass ndr.reader.base

mfdaq_type - Give the preferred long channel type for a channel type

TYPE = MFDAQ_TYPE(CHANNELTYPE)

   Produces the preferred long channel type name for a given CHANNELTYPE.

  Channel type:               | MFDAQ_TYPE:
  ---------------------------------------------------------
  'analog_in',       'ai'     | 'analog_in' 
  'analog_out',      'ao'     | 'analog_out'
  'digital_in',      'di'     | 'digital_in'
  'digital_out',     'do'     | 'digital_out'
  'time','timestamp','t'      | 'time'
  'auxiliary','aux','ax',     | 'auxiliary'
     'auxiliary_in'           | 
  'mark', 'marker', or 'mk'   | 'mark'
  'event' or 'e'              | 'event'

  See also: ndi.daq.system.mfdaq/MFDAQ_PREFIX

Help for ndr.reader.intan_rhd.mfdaq_type is inherited from superclass ndr.reader.base

mfdaqchanneltype2intanchanneltype - Convert the channel type from generic format of multifuncdaqchannel

to the specific Intan channel type

   INTANCHANNELTYPE = MFDAQCHANNELTYPE2INTANCHANNELTYPE(CHANNELTYPE)

   The intanchanneltype is a string of the specific channel type for Intan.

mfdaqchanneltype2intanfreqheader - Return header name with frequency information for channel type

HEADERNAME = MFDAQCHANNELTYPE2INTANFREQHEADER(CHANNELTYPE)

   Given an ndr.ndr.mfdaq channel type string, this function returns the associated fieldname.

mfdaqchanneltype2intanheadertype - Convert between the ndr.ndr.reader.mfdaq channel types and Intan headers

INTANCHANHEADERTYPE = MFDAQCHANNELTYPE2INTANHEADERTYPE(CHANNELTYPE)

   Given a standard ndr.ndr.reader.mfdaq channel type, returns the name of the type as
   indicated in Intan header files.

readchannels_epochsamples - Read the data based on specified channels

DATA = READCHANNELS_EPOCHSAMPLES(INTANREADER_OBJ, CHANNELTYPE, CHANNEL, EPOCH, S0, S1)

   CHANNELTYPE is the type of channel to read (single text string,
   such as 'ai','analog_input','time')

   CHANNEL is a vector of the channel numbers to read, beginning
   from 1.

   EPOCH is the epoch number to read from.

   DATA will have one column per channel.

readevents_epochsamples_native - read events or markers of specified channels for a specified epoch

[DATA] = READEVENTS_EPOCHSAMPLES_NATIVE(NDR_READER_BASE_OBJ, CHANNELTYPE, CHANNEL, EPOCHFILES, T0, T1)

   CHANNELTYPE is the type of channel to read
   ('event','marker', etc). It must be a string (not a cell array of strings).

   CHANNEL is a vector with the identity of the channel(s) to be read.

   EPOCH is the epoch number or epochID

   DATA is a two-column vector; the first column has the time of the event. The second
   column indicates the marker code. In the case of 'events', this is just 1. If more than one channel
   is requested, DATA is returned as a cell array, one entry per channel.

   TIMEREF is an ndi.time.timereference with the NDI_CLOCK of the device, referring to epoch N at time 0 as the reference.

Help for ndr.reader.intan_rhd/readevents_epochsamples_native is inherited from superclass ndr.reader.base

samplerate - Get the sample rate for specific channel

SR = SAMPLERATE(INTANREADER_OBJ, EPOCHSTREAMS, EPOCH_SELECT, CHANNELTYPE, CHANNEL)

   SR is an array of sample rates from the specified channels.

   CHANNELTYPE can be either a string or a cell array of strings
   the same length as the vector CHANNEL.
   If CHANNELTYPE is a single string, then it is assumed that that
   CHANNELTYPE applies to every entry of CHANNEL.

t0_t1 - Return the beginning and end epoch times for an

epoch

   T0T1 = T0_T1(INTAN_RHD_OBJ, EPOCHSTREAMS, EPOCH_SELECT)

   Return the beginning (t0) and end (t1) times of the epoch
   EPOCH_NUMBER in the same units as the ndr.time.clocktype objects
   returned by EPOCH_NUMBER.

   The abstract class always return {[NaN NaN]}.

   See also: ndr.time.clocktype, EPOCHCLOCK