MATLAB Interfaces For Blackrock Microsystems Data Acquisition Systems

MATLAB Interfaces For Blackrock Microsystems Data Acquisition Systems

Introduction

Blackrock has several functions for looking at and interacting with data collected through our neural signal processors. These functions are available for post-recording processing (Neural Processing MATLAB Kit - NPMK) or for interacting with or controlling live data (CBMEX) online. This page will outline how to install these programs and learn more about them. 

Offline Analysis - Data File Loading

How to Install

Our NPMK is a loader for .NEV and .NSx (NS3, NS5, etc) files. It is a script that loads these file types into MATLAB for later analysis and is a primary way that many of our customers look at and view their saved neural data.

To install the NPMK, first download from our website here: Blackrock Microsystems Downloads . This downloaded file should be added to the MATLAB path. Remember that you can always use the built-in "which" function in MATLAB to make sure you are being directed to the most recent version of the NPMK that you have installed.

To install, place the folder in the desired location and run "installNPMK" script from within MATLAB.

Getting Started

The NPMK function has quite a few parameters that can be specified when loading a file, but one of the easiest ways to get started is to simply type the following command: 

  1. openNEV() % Loads NEV Files
  2. openNSx() % Loads NSx (Continuous Data) Files

For a video tutorial on NPMK and the data structures, visit our How-To Videos page. If you prefer text, keep reading.

When your file loads, it will create a data structure in the output variable of the function or name it as the file extension by default. This structure contains a few fields. 

NSx Structure

The NSx structure is relatively simple; it has only a few fields in the structure.

MetaTags
Contains general information about the file such as the date it was recorded, the file name, sampling rate, etc.
Data
Contains a matrix where each row is a channel and each column is a timestamp. Note that the first timestamp of each cell is equal to the timestamp values in MetaTags.
RawData
Contains information for other NPMK functions and does not need to be manipulated by the user.
ElectrodesInfo
Information on each of the electrodes in the recording, this includes filtering info, channel name, etc. 

NEV Structure

The NEV structure is slightly more involved. 

Like the NSx structure, the MetaTags field contains similar information, and the same is true for the Electrodes Info structure. 

The Data structure of NEV files contains a number of sub-structures that outline the types of data the NEV contains. This is because the NEV contains all non-continuous data, that is, any data that is not a continuous stream of voltages. A summary of the data in each field is shown below:


SerialDigitalIO
All Digital Input and Serial Input data
Spikes 
All action potentials/spikes that have been detected/extracted
Comments 
Arbitrary text data that can be entered by the user or other Blackrock programs
VideoSync 
Neuromotive frame synchronization data
Tracking 
Neuromotive video tracking data
Tracking Events
Events, such as regions of interest, that were logged in Neuromotive
Patient Trigger
Generally unused, but accessible by some clinical system integrations
Reconfig 
Generally unused, primarily used for Blackrock Support and troubleshooting purposes

Each of these structures is organized in a similar way. The spike field is looked at below as an illustrative example.


In the spike structure, we have fields for TimeStamp, Electrode, Unit, and Waveform. 

Each of these fields has the same number of columns, because a given column in each field describes the same event. For example, the second value in the timestamp field is associated with the second value in the electrodes field, and those are associated with the waveform shown in the second column of the waveforms field. This is applicable to the other structures inside of the data structure of the NEV as well.

Online Access - Streaming and Configuring

Our online MATLAB program, CBMEX, allows you to control and interact with the neural data online as it is acquires. This allows you to write MATLAB functions and scripts that can trigger events, write comments, and control parameters of the Neural Signal Processor.

CBMEX is specific to the Central Windows Suite software that you are running, so we have included CBMEX with the download of Central on to your computer. It is automatically installed with the Central program and you can find it in the following location: C:\Program Files (x86)\Blackrock Microsystems

To install, add the folder containing the files cbmex.mexw32 and cbmex.mexw64 to the MATLAB path. 

A manual for CBMEX, as well as some example code can be found on the support section of the Blackrock Microsystems website.

    • Related Articles

    • Using cbMEX on Unix Operating Systems

      Introduction This article covers the method for allowing cbmex, our online Matlab interface, to function on unix operating systems. For more information on cbmex and our Matlab libraries, please refer to the user manuals section of our website.  ...
    • Loading Data into MClust

      PS: for MClust 4.0+ please download and use NPMK 4.2.2 Please also find attached PDF version with screenshots -------------------------------------------------------------------------------------- 1, Download MClust (V3.5 or later) and the latest ...
    • Loading Blackrock Event and Continuous Data Files into Plexon Offline Sorter (POS or OFS)

      Installation Note: Version 4.0+ of offline sorter can natively load .NEV files, so the steps below do not need to be followed. Note: Plexon's offline sorter is not compatible with Blackrock's File Spec 3.0 (Available on Central version 7.5.0 and ...
    • Concatenating segmented files in NPMK

      Occasionally during recording sessions, users may encounter brief packet loss or they may pause and resume file recording themselves. When this happens, Central File Recording will write a new header to the file, causing the data to become segmented ...
    • Broadcasting Data from nPlayServer to Multiple Computers

      Introduction This article will cover how to make nPlayServer, Blackrock's data playback program, send data out from a computer as if it were a Neural Signal Processor. This can be done whether you own a CerePlex Direct or Neural Signal Processor ...