Example set-up for a Natus NeuroWorks clinical system
Function
The NatusADC filter acquires raw data in real-time from Natus Headboxes over UDP connection for signal processing and visualizations. The overview of the NatusADC working is shown in the image below.
Overview of NatusADC working
NatusDataServer processes and sends signal from the device to the client application. A project named XLDataExportClient reads signals from the device and calls the NatusDataServer's functions to send the signal to the client. NatusClient is the client application within the BCI2000 that receives the signals and does the initial processing. NatusPackageInterface contains the implementation of data transfer protocol between server/device and client and is used by NatusClient and NatusDataServer to communicate with each other over TCP and UDP. NatusDataServer and NatusPackageInterface are independent of BCI2000, whereas NatusClient relies on BCI2000.
The below image explains the context in which packet, blocks, samples and channels are used in this project. A packet may have one or block, a block may have one or more samples and a sample contains values for all the channels.
Packet, block and samples relationship
For more information about the Natus connection and specific commands, refer to the Natus programming page
Version History
Source Code Revisions
Initial development: 5900
Tested under: 7381
Known to compile under:7381
Broken since: --
Natus software version: 9.2.1 Build 6524
Natus Data Export Version: 9.4
Prerequisites
The NatusADC source module requires a proprietary SDK protected by an NDA with Natus. Please contact Natus for this NDA and for access to the XLDataExportClient SDK before attempting to use the NatusADC source module.
It is also helpful to have an ethernet port available for the Natus computer. If your system does not have an ethernet port, consider using a USB ethernet dongle.
Hardware
In theory, the module should work fine with all of the following Natus Headboxes.
EEG32
EEG128, EEG128FS
Mobee32, Mobee32-02
Mobee-24
Connex/ Brain Monitor
Trex
EMU40
EEG32u
Quantum
NeuroLink IP
Bio-logic NetLink
Bio-logic Traveler
Drivers
Connecting Natus to BCI2000
The figure below should serve as a supplement to the instructions for connecting the Natus computer to the BCI2000 computer
Neuroworks SDK for BCI2000
On the Natus Computer
Connect the BCI2000 computer to the Natus computer via ethernet (this may require a usb-to-ethernet adapter)
Change the IP address of this port on the Natus computer to something on its own subnet, like 192.168.10.10. ***This must be a static IP address.*** You can follow a tutorial like this one to change the IP address. The easiest way to confirm that you are changing the IP address of the correct port is to unplug the ethernet cable. The unplugged option will disappear.
When starting a new study, set the sampling rate of the acquisition system by opening "Wave" and going to edit -> settings -> acquisition while a study is NOT running
Be sure that the Natus computer is set to acquire data over Ethernet and not USB if you intend to acquire data over 4kHz Set Natus Sampling Rate
Start an EEG study in Neuroworks using the New EEG button. Start a new Natus study You will need to enter the study information. Enter the study information Note that you do not need to start the recording for the signal to stream to BCI2000. Study is running
On the BCI2000 Computer
Compile the NatusSignalSource source module after you have gotten access to the Natus data export service on the BCI2000 svn
Change the IP address of the BCI2000 computer ethernet port to something on the same subnet, like 192.168.10.9, following the same steps as above.
Open the command line on the BCI2000 computer and type "ping 192.168.10.10" to ensure you have a connection.
Note that if this does not work you may need to turn off firewalls on one or both machines
Locate the included registry editing tool found in bci2000/src/private/SignalSource/NatusSignalSource/
Edit the _SetSdkAcquisitionStationIp.reg registry editing tool (right-click, edit) to add the IP of the Natus computer to the BCI2000 computer's registry (i.e., 192.168.10.10)
Run RegXLDataExportService.bat found in bci2000/src/private/SignalSource/NatusSignalSource/DataExport_9.4/XLDataExportService to register the DLL of the data export service. (This may not be necessary with the newest version?)
Start the data export service executable XLDataExportSrv.exe found in bci2000/src/private/SignalSource/NatusSignalSource/DataExport_9.4/XLDataExportService
Note that this can be started before an EEG study has been started, or after an EEG study is already running
A small horizontal window should appear, indicating study data is streaming
Create a BCI2000 batch file to start up the NatusSignalSource source module (An example batch file should be in the same NatusSignalSource folder after BCI2000 has been compiled)
Launch BCI2000 using this batch file
Open the config window and navigate to the source tab. Source parameters will vary according to your needs, but some recommended settings can be found below
SampleBlockSize: 100 (at a sampling rate of 2048, this yields a sample block size of 48.83ms. Note that the ratio of SampleBlockSize/ServerBlockSize needs to be a whole number for best performance. SampleBlockSize less than 48.83ms is not recommended.)
SamplingRate: auto (inherited from the Natus system)
ServerBlockSize: 1 (server buffer size. Larger ServerBlockSize can lead to performance issues.)
DecimationFactor: 1 (you can decimate the incoming sampled data by the DecimationFactor. The BCI2000 sampling rate will reflect the decimated rate.)
ServerIP: Set the IP address to localhost or 127.0.0.1
Press “Set Config.” Data should begin streaming. Open the System Log from the BCI2000 Operator window to confirm that the sampling rate and channel count were inherited correctly from the Natus stream
Legacy Instructions for Connecting Natus to BCI2000
On the Natus Computer
If you have previously registered the XLDataExportClient.dll for an older version of the data export tool, you must first deregister this dll. Launch a command window as an administrator and type regsvr /u XLDataExportClient.dll
Connect to the network via ethernet cable. Alternately, it is preferable to connect directly to the BCI2000 computer via ethernet.
Copy the Export Service folder found in src\private\SignalSource\NatusSignalSource\DataExport_9.4\XLDataExportService to the hard drive of the computer running Natus Neuroworks or to a USB drive
Note the IP address of the Natus computer (run “ipconfig” in the Command Prompt on the Natus computer). If the computers are directly connected with an ethernet cable, the IP address should be under "ethernet adapter ethernet" Run ipconfig on the Natus computer and note the IP address
When starting a new study, set the sampling rate of the acquisition system by opening "Wave" and going to edit -> settings -> acquisition while a study is NOT running
Be sure that the Natus computer is set to acquire data over Ethernet and not USB if you intend to acquire data over 4kHz Set Natus Sampling Rate
Start an EEG study in Neuroworks using the New EEG button. Start a new Natus study You will need to enter the study information. Enter the study information Note that you do not need to start the recording for the signal to stream to BCI2000. Study is running
Run the executable XLDataExportSrv.exe found in the XLDataExportService folder that was copied to the Natus computer Run the executable XLDataExportSrv.exe from the XLDataExportService folder
Note that this can be started before an EEG study has been started, or after an EEG study is already running
A small horizontal window should appear, indicating study data is streaming Natus Data Export Service Running
On the BCI2000 Computer
Connect to the same network that the Natus computer is connected via ethernet cable. Alternately, it is preferable to connect directly to the Natus computer via ethernet.
Run a BCI2000 batch file that loads the NatusSignalSource
Open the config window and navigate to the source tab. Source parameters will vary according to your needs, but some recommended settings can be found below
SampleBlockSize: 100 (at a sampling rate of 2048, this yields a sample block size of 48.83ms. Note that the ratio of SampleBlockSize/ServerBlockSize needs to be a whole number for best performance. SampleBlockSize less than 48.83ms is not recommended.)
SamplingRate: auto (inherited from the Natus system)
ServerBlockSize: 1 (server buffer size. Larger ServerBlockSize can lead to performance issues.)
DecimationFactor: 1 (you can decimate the incoming sampled data by the DecimationFactor. The BCI2000 sampling rate will reflect the decimated rate.)
ServerIP: Set the IP address to that of the Natus computer Natus BCI2000 parameters
Press “Set Config.” Data should begin streaming. Open the System Log from the BCI2000 Operator window to confirm that the sampling rate and channel count were inherited correctly from the Natus stream
Parameters
Parameters common to all source modules are described under User Reference:DataIOFilter. In addition, the following parameters are supported:
SamplingRate
The rate at which the device samples the data. The default value is the device's default sampling rate.
SampleBlockSize
The number of samples per block the output signal, created by the client application(NatusADC), should have. The default value is 20. Note that the ratio of SampleBlockSize/ServerBlockSize needs to be a whole number for best performance. SampleBlockSize less than 48.83ms is not recommended.
ServerBlockSize
The number of samples sent by the server/device in a single UDP Packet. The default value is 1.
DecimationFactor
The decimation factor. The factor by which to decimate/downsize the signal. The default value is 1. The SamplingRate is updated by dividing it by the DecimationFactor.Note: The SamplingRate should be an integral multiple of DecimationFactor.
ServerIP
The IPv4 address of the server/device.
Port
The port number of the server/device which on which TCP runs. UDP port number is assumed to be 1 + TCP port number.
SourceCh
The number of channels to be acquired from the device. If this is set to auto, all the available channels from the device will be acquired.
SourceChGain
SourceChGain should be left to auto. The default value is 0 for every channel.
SourceChOffset
SourceChOffset should be left to auto. The default value is 1 microVolt for every channel.
SourceChList
The list of channel numbers to be acquired from the device. The order of the numbers doesn't matter, i.e., '1 2 3 4' is same as '3 2 4 1'. Entering duplicate channels, eg. in '1 2 3 2' will result in an error. Entering an invalid channel number, i.e., a number greater than the maximum number of the channels will result in an error. If set to auto, all the device channels will be streamed.
ChannelNames
The user-preferred channel names. If set to auto, the channel names will be retrieved from the device. If the device doesn't have any specific channel names, the channel names will be set to 0 to SourceCh - 1. If set manually, names should be given for each channel in SourceChList
States
SampleLost
SampleLost is represented by 1 bit. The device sends data in sample packets over UDP connection which is not a reliable connection and hence may result in loss of some. The lost packets between two packets received from the device are detected from the packet counter, and inserted with a value of NaN. The SampleLost state value is 1 if the sample has been lost, and 0 if the packet is received from the device.
Interpolated
Interpolated is an obsolete name for SampleLost. The Interpolated state has been kept for backward compatibility and may be removed any time.
BlockCount
The number of data blocks received so far. This is a 32 bit state.
Additional Info
The module also contains a function called GetDecimationFactor to query the current Decimation Factor from the server/device.
More details from a programmer's perspective can be found here Programming_Reference:NatusADC
Troubleshooting
If there is a problem streaming the data, try force quitting the Natus export service by opening the task manager on the Natus computer, then right clicking on the XLDataExportSrv and choosing 'end task.' Then start the data export service again.