The Optotrak Toolbox:
Control your Optotrak from within Matlab.

Volker Franz, University of Tübingen, Germany

The Optotrak Certus and the older Optotrak 3020 (Northern Digital Inc.) are widely used and highly accurate 3D motion and position measurement systems. Traditionally, they are controlled using an interface written in the C-programming language (the C-API you need to have purchased from Northern Digital Inc.). In 2004, I wrote a toolbox which allows to control the Optotrak from within Matlab. This has a number of advantages: (a) Matlab provides a flexible environment for high level mathematics, much more versatile than C. This is advantageous for the processing of the 3D data produced by the Optotrak. (b) There exist already a number of Matlab toolboxes for psychophysical experiments. Most importantly the Psychophysics Toolbox (mainly for stimulus presentation) and the Eyelink Toolbox (controlling the SR-Research Eyelink Eyetracker). The Optotrak Toolbox can be used to integrate the Optotrak with these other research tools. Technically, the Optotrak Toolbox communicates with the Optotrak from within Matlab by using Northern Digital's C-API to compile Matlab MEX-files. The Optotrak Toolbox is currently tested under Windows 7, Windows XP, and Linux (unfortunately, Northern Digital's C-API doesn't support Mac OSX, therefore the Optotrak Toolbox also is not able to do so).

Sample programs

Here, you can find some sample programs for the Optotrak Toolbox: Each sample is a 1-to-1 translation of one of the sample C-programs which are shipped with the Optotrak API


If you are interested in the Optotrak Toolbox, I will be happy to send you a copy by email (the Optotrak Toolbox is open software under the GNU general public license, such that it is free and you can modify the source code if you wish). Currently, the Optotrak Toolbox does not fully implement all features of Northern Digital's C-API but it is used successfully by many labs around the world (including my own lab where we have used it since 2004 with many different versions of Matlab on Windows and Linux and with both, the Optotrak 3020 and the Optotrak Certus). Note, however, that I cannot and will not provide support for it. The prerequisites to use it on your side are:
  • Northern Digital's Optotrak Certus or Optotrak 3020.
  • Northern Digital's C-API (you need to have purchased this in addition to the Optotrak)
  • Windows or Linux (better tested on Windows).
  • A C-compiler (Northern Digital's C-API works best with Microsoft's Visual C++ Compiler which is nowadays freely available)
  • You must be able to compile the C-API's sample programs in C. Only if this works you will be able to compile the Optotrak Toolbox (for this you will need once a C-savvy person for at least a couple of hours).
  • ... and of course Matlab. Currently (i.e., as of 2012): This needs to be a 32-bit version of Matlab. This again is a limitation of Northern Digital's C-API and of some of the additional toolboxes you might want to use (even some native toolboxes of Matlab only work with 32-bit versions of Matlab...).

It is free, but consider citing it!

If you use the Optotrak Toolbox for a scientific paper, please consider citing it. For example like this:
Movement recording was controlled with the Optotrak Toolbox by V. H. Franz ( within Matlab (Mathworks, Natick, MA, USA).