This software has been developed as a collaboration between Gustavo Sudre (Carnegie Mellon University), Lauri Parkkonen (Aalto University School of Science and Technology), Elizabeth Bock and Sylvain Baillet (Medical College of Wisconsin), and Wei Wang and Doug Weber (University of Pittsburgh). We would also like to thank Robert Oostenveld and Stefan Klanke (Donders/DCCN) for their assistance with the integration with the Fieldtrip buffer. Please cite the paper rtMEG: A Real-time Software Interface for Magnetoencephalography (Computational Intelligence and Neuroscience, Volume 2011) in any work that uses it.
The rtMEG software relays signals from a 306-channel Elekta Neuromag® MEG device in real-time to a Fieldtrip buffer. This buffer can then be read by any computer in the same network as the computer hosting the buffer. The data is still stored by the Acquisition computer (i.e. where you run the Acquisition software by Neuromag) as a FIF file, and it can be read by as many computers in the network as necessary. The rtMEG software has the capability of running the Fieldtrip buffer by itself, or it can output the data to a separate computer hosting the buffer when necessary. The delay introduced by the software to the data being relayed has been measured to be smaller than 50ms, which is sufficient for most real-time studies.
neuromag2ft [—-option1 value1 —-option2 value2 …]
without any arguments, the software creates the Fieldtrip buffer in the same computer where the Neuromag Acquisition software is running (localhost), with port 1972 and using the length of the buffer currently set in the real-time computer.
The following are the optional arguments available to the user:
How it works:
This section gives a simplistic overview of the Acquisition system and how rtMEG fits in. This knowledge is not necessary to run the program, but it might come handy if you want to understand a bit of what is going on behind the scenes.
Each DSP (Digital Signal Processor) manages 12 different channels in the MEG machine (in the most common setup). The several DSPs then send the data they acquire from the channels to the real-time computer (in packets of 28 samples per channel, in the usual setup). The real-time computer sorts the data and applies some calibration values to them. The Acquisition computer talks to the real-time computer to receive the data. It receives the data by requesting “buflen” datapoints per packet, and hence the need for the —-buflen option. If not used, rtMEG uses the default settings, which are usually around 1s second of data (e.g. buflen=1000 for sampling rate of 1Khz), which is fine for the regular data saving operations, but will be too long for a real-time application.
The data received from the real-time computer are then stored in a local buffer that is used by different Neuromag programs, such as the visualization interface. So, rtMEG taps into this local buffer and reads the data being retrieved from the real-time computer. Once the data has been read, rtMEG writes them to a Fieldtrip buffer, which can be easily read by several different clients (see above) using an open-source format. This Fieldtrip buffer can be run by rtMEG itself, or by a separate computer in the network (i.e. the —-ftbuffer option).
Binaries have been provided for the HP-UX and Linux platforms, which are the two platforms where the Neuromag acquisition software runs. But, if you need to re-compile the software, the sources have also been provided to compile the binary file neuromag2ft. You'll need gcc, gmake, the libbuffer library (provided by Fieldtrip), as well as a few libraries provided by Elekta Neuromag.
Questions / suggestions / reporting a bug, please email Gustavo Sudre or Lauri Parkkonen. The source code and binaries for rtMEG are available in the Fieldtrip repository, or can also be obtained by contacting one of the authors.