MatRiver mr structure
From SCCN
MatRiver uses the global mr variable to store all its related data.
Description of fields in mr structure
- samplingRate: sampling rate of incoming or simulated data (frames per second).
- accumulatedData: holds accumulated data received from the buffer.
- numberOfChannelsInAccumulatedData: holds the number of channels that are valid (have received data) in accumulatedData variable.
- numberOfFramesInAccumulatedData: number of valid frames accumulatedData variable.
- numberOfFramesReceived: number of data samples (frames) received during the current session. This is similar but different from numberOfFramesInAccumulatedData, becuse if maxNumberOfFramesInAccumulatedData is set no a value other than Inf, accumulated data will be shrunk at some point, which changes the value in numberOfFramesInAccumulatedData, while leaving numberOfFrameReceived unchanged.
- maxNumberOfFramesInAccumulatedData: maximum number of frames to be kept in accumulatedData field. Set this to Inf to store all incoming data. If set to a finite value, the earliest data in accumulatedData field are removed in regular intervals to keep its length no more than this set value.
- bufferHandle: global handle to DataRiver buffer opened with ds_OpenAsyncRead
- functionHandle: global function (handle) to run after data is accumulated
- verboseLevel: an integer number that controls how much information is displayed while various MatRiver functions are executed. zero (0) is for no verbosity, one (1) is for medium and two (2) is for maximum detail being reported (useful when debugging).
- readFromDataRiver: indicates whether to read from DataRiver or from a variable, simulating realtime
- simulation: a sub-structure that contains fields related to simulated realtime processing.
- eventChannelNumber: number of channel that contains the event information (usually the last channel).
- event: a sub-structure that contains fields related to events.
- trigger: a sub-structure that contains fields related to event triggers.
- eeg: a sub-structure that contains fields related to EEG processing.
- readFromDataRiver: if set to true, MatRiver tries to read data from DataRiver system, otherwise simulated data in simulation field is used.
- executionLag: execution lag calculated by mr_record_lag() function is placed in this field.
Description of fields in mr.eeg structure
- channelNumbers: channel numbers (indexed from DataRiver channels) that contain EEG data.
- referenceChannel: reference channel number for re-referencing. Can be set to 'average' for average re-referencing.
- reference_is_included: whether referenceChannel is indexed from DataRiver channels or from selected EEG channels in channelNumbers.
- locutoff: low-pass cut-off frequency (Hz). An empty value [] indicates no low-pass filtering.
- hicutoff: high-pass cut-off frequency (Hz). An empty value [] indicates no high-pass filtering.
- originalIcaUnmix: ICA matrix to be applied to channel data.
- activeIcaUnmix: ICA matrix calculated by mr_update_ica() based on originalIcaUnmix to prevent usage of noisy (bad) channels. This matrix is used for calculating IC activities at each moment and may change every time mr_update_ica() is executed.
- icActivityDurationToCalculate: an optional value that indicates the duration (in ms) of most recent ICA activity to be calculated by mr_raw_to_ic_activity() function.
- icActivity: ICA activity for a section of data calculated by mr_raw_to_ic_activity().
- icNumbersToCalculateActivity: IC numbers to calculate (and potentially accumulate) activity for.
- accumulatedIcActivity: IC activity calculated and accumulated by mr_raw_to_ic_activity_accumulate() in a circular buffer.
- badChannels: contains the list of noisy (bad) channel indices calculated by mr_detect_bad_channels().
- chanlocs: optional sub-structure that contains channel locations similar to EEG.chanlocs.
- classifier: optional field to contain information for an EEG classifier.
- dipfit: optional sub-structure that contains dipole location information similar to EEG.dipfit.
Description of fields in mr.event structure
- type: type of the event (number).
- latency: latency of the event (in frames).
- triggered: whether the event has already created a trigger.
Description of fields in mr.trigger structure
- eventType: (numeric) type of a (single) trigger event.
- timeAfter: (numeric) time in ms after which the trigger should fire.
- callback: function (handle) to be executed when trigger fires. This callback function should have at least one input parameter for eventNumber, which is passed to it during trigger execution.
Description of fields in mr.simulation structure
- data: (channels x frames) simulated data to be sent into MatRiver system. Data is provided based on a realistic scenario in which only a limited number of frames are available (produced) based on how long the simulated session has been running.
- speedFactor: the ratio between the simulated time and the actual clock time. For example, the speedFactor of two will simulate the experiment (send data into MatRiver) twice faster than a real-time scenario. This is useful for stress-testing the system and also to process data using MatRiver system in a shorter time.
Description of fields in mr.read structure
The mr.read field contains sub-fields described below. Each of these fields is an array, with each index, like mr.read.bufferName{2}, associated with a different buffer.
- bufferName: A cell array containing string values, each uniquely identifying a buffer by its name. For example, for a buffer named 'force' may contain information from a force platform (mr.read.buffer{1} = 'force')
- bufferHandle: An array of DataRiver handles, each created by mr_init_reading() to facilitate communication with DataRiver system.
- numberOfFramesReceived: An array that contains the number of frames in each buffer (received so far).
- bufferAccumulatedData: An array of circular buffer structures containing received data for each MatRiver buffer.
Description of fields in mr.write structure
The mr.write field contains sub-fields described below. Each of these fields is an array, with each index, like mr.write.bufferName{2}, associated with a different buffer.
- bufferName: A cell array containing string values, each uniquely identifying a buffer by its name. For example, for a buffer named 'commands' may contain commands (as integer values) being sent into DataRiver system (mr.write.buffer{1} = 'commands')
- bufferHandle: An array of DataRiver handles, each created by mr_init_writing() to facilitate communication with DataRiver system.
MatRiver Topics