Skip to content

CLASS ndr.reader.ced_smr

  CED_SMR - reader class for Cambridge Electronic Design (CED) SMR files

  This class reads data from CED Spike2 .SMR or .SON file formats.

  It depends on sigTOOL by Malcolm Lidierth (http://sigtool.sourceforge.net).

  sigTOOL is also included in the https://github.com/VH-Lab/vhlab-thirdparty-matlab bundle and
  can be installed with instructions at http://code.vhlab.org.

Superclasses

ndr.reader.base

Properties

none

Methods

Method Description
canbereadtogether can the channels in a channel struct be read in a single function call?
ced_smr Create a new NDR_NDR_READER_CEDSMR object
cedsmrfile Identify the .SMR file out of a file list
cedsmrheader2readerchanneltype Convert between Intan headers and the ndr.ndr.reader channel types
daqchannels2internalchannels convert a set of DAQ channel prefixes and channel numbers to an internal structure to pass to internal reading functions
epochclock return the ndr.time.clocktype objects for an epoch
getchannelsepoch List the channels that are available on this device
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
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 EPOCH AND CHANNEL
t0_t1 return the t0_t1 (beginning and end) epoch times for an epoch

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.ced_smr/canbereadtogether is inherited from superclass ndr.reader.base

ced_smr - Create a new NDR_NDR_READER_CEDSMR object

N = ndr.reader.ced_smr(NAME,THEFILENAVIGATOR)

   Creates a new object for reading Cambridge Electronic Design SMR files.

    Documentation for ndr.reader.ced_smr/ced_smr
       doc ndr.reader.ced_smr

cedsmrfile - Identify the .SMR file out of a file list

FILENAME = CEDSMRFILE(FILELIST)

  Given a cell array of strings FILELIST with full-path file names,
  this function identifies the first file with an extension '.smr' (case insensitive)
  and returns the result in FILENAME (full-path file name).

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

CHANNELTYPE = CEDSMRHEADER2READERCHANNELTYPE(CEDSMRCHANNELTYPE)

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

daqchannels2internalchannels - convert a set of DAQ channel prefixes and channel numbers to an internal structure to pass to internal reading functions

CHANNELSTRUCT = DAQCHANNELS2INTERNALCHANNELS(NDR_READER_CEDSMR_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 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 one 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.                 |
  | 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.                            |
  ------------------------------------------------------------------------------

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.ced_smr/epochclock is inherited from superclass ndr.reader.base

getchannelsepoch - List the channels that are available on this device

CHANNELS = GETCHANNELS(THEDEV, EPOCHFILES, EPOCHSELECT)

   Returns the channel list of acquired channels in this session

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

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.ced_smr.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.ced_smr.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.ced_smr.mfdaq_type is inherited from superclass ndr.reader.base

readchannels_epochsamples - read the data based on specified channels

DATA = READ_CHANNELS(MYDEV, CHANNELTYPE, CHANNEL, EPOCHFILES, S0, S1)

   CHANNELTYPE is the type of channel to read

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

   EPOCHFILES is the cell array of full path filenames for this epoch

   DATA is the channel data (each column contains data from an indvidual channel)

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

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

   CHANNELTYPE is the type of channel to read
   ('event','marker', 'text')

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

   EPOCH is the set of epoch files

   DATA is a multiple-column vector; the first column has the
   time of the event. The remaining columns indicate 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.

samplerate - GET THE SAMPLE RATE FOR SPECIFIC EPOCH AND CHANNEL

SR = SAMPLERATE(DEV, EPOCHFILES, CHANNELTYPE, CHANNEL)

  SR is the list of sample rate from specified channels

t0_t1 - return the t0_t1 (beginning and end) epoch times for an epoch

T0T1 = T0_T1(NDR_NDR_READER_CEDSMR_OBJ, EPOCHFILES, EPOCHSELECT)

  Return the beginning (t0) and end (t1) times of the EPOCHFILES that define this
  epoch in the same units as the ndi.time.clocktype objects returned by EPOCHCLOCK.


  See also: ndi.time.clocktype, EPOCHCLOCK