Back to start page

Raw binary format specification

Download raw data in custom binary format (42.8 MiB)

The file consists of a sequence of "frames". Each frame is 18 bytes and encoded as follows:

unsigned long wacomtime; 4 byte integer. Time when the "touch" happened on the tablet, as returned by wacom's pkTime. The number is in milliseconds. The first frame in the file has wacomtime=0. Then it's strictly increasing, but the exact time between frames can vary slightly. Bytes 0, 1, 2, 3
unsigned long index; 4 byte integer. Which frame is this? When the program starts, the first frame will have index=0, then 1, then 2 and so on. However, to save space, not all frames are in the file. When nothing interesting happened during the recording (i.e pen doesn't touch the tablet, and testimage is the same as last frame), that frame will not be written to disk, but the counter will keep increasing, so there are "gaps" in the output file. Use this to know whether the subject drew an uninterrupted line or lifted the pen. If this frame index is equal to the last frame index+1, it's an uninterrupted line. Bytes 4, 5, 6, 7
unsigned long penpressure; 4 byte integer. How hard is the wacom pen pressed against the tablet? 0=not touching, 1=lightest possible touch, ... 1023=max pressure. Note that you will encounter very few frames where this value is =0, because those frames are not written to disk (unless the testimage changed). Bytes 8, 9, 10, 11
unsigned short testimage; 2 byte integer. Which test image is currently displayed to the subject on the screen? There are predefined test images numbered from 0 to 47, you can view and download them here. Bytes 12, 13
short penx; 2 byte signed integer. Where on the screen is the pen / mouse pointer? Horizontal distance from the left edge. Between 0 and 1279, inclusive Bytes 14, 15
short peny; 2 byte signed integer. Vertical distance from the top edge. Between 0 and 1023, inclusive Bytes 16, 17

All the integers are stored with their least significant byte first, aka little-endian.

CSV format specification

Download raw data in csv format (76.4 MiB)

This contains exactly the same data as the raw binary format, but depending on your environment it might be easier to parse. The file consists of a sequence of frames. The frames are separated by newline (unix-style newlines, ascii 10). (Note that this does not follow RFC4180 which specifies dos-style newlines.) Each frame consists of 6 integer numbers. The numbers are separated by a comma character (ascii 44). There is no comma after the last number on the line.

wacomtime, Time when the "touch" happened on the tablet, as returned by wacom's pkTime. The number is in milliseconds. The first frame in the file has wacomtime=0. Then it's strictly increasing, but the exact time between frames can vary slightly.
index, Which frame is this? When the program starts, the first frame will have index=0, then 1, then 2 and so on. However, to save space, not all frames are in the file. When nothing interesting happened during the recording (i.e pen doesn't touch the tablet, and testimage is the same as last frame), that frame will not be written to disk, but the counter will keep increasing, so there are "gaps" in the output file. Use this to know whether the subject drew an uninterrupted line or lifted the pen. If this frame index is equal to the last frame index+1, it's an uninterrupted line.
penpressure, How hard is the wacom pen pressed against the tablet? 0=not touching, 1=lightest possible touch, ... 1023=max pressure. Note that you will encounter very few frames where this value is =0, because those frames are not written to disk (unless the testimage changed).
testimage, Which test image is currently displayed to the subject on the screen? There are predefined test images numbered from 0 to 47, you can view and download them here.
penx, Where on the screen is the pen / mouse pointer? Horizontal distance from the left edge. Between 0 and 1279, inclusive
peny, Vertical distance from the top edge. Between 0 and 1023, inclusive

3146505,411647,282,5,816,668
3146512,411648,122,5,819,669
3147190,411738,331,5,625,496

Let's parse the second line as an example. 3146512 is in milliseconds since the recording started, roughly equal to 3147 seconds or 53 minutes. 411648 is the frame index, which doesn't tell us anything interesting on its own. But if you look at the previous line, it had frame index 411647 which means that there is no gap, so we should draw a line between the previous pen position and this current pen position. 282 is the penpressure. 5 corresponds to this test image. 816,668 means that the pen is 816 pixels away from the left edge of the screen, and 668 pixels from the top edge.

The third line has frame index 411738, which means that there is a gap. Ever since 411648 the test subject did not draw anything. This frame should be regarded as the start of a new line.