# Mworks file format documentation?

**URL:** <https://mworks.discourse.group/t/mworks-file-format-documentation/504>\
**Category:** Support\
**Created:** [August 12, 2015, 1:26pm UTC](https://mworks.discourse.group/t/mworks-file-format-documentation/504 "2015-08-12T13:26:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 12, 2015, 1:26pm UTC](https://mworks.discourse.group/t/mworks-file-format-documentation/504/1 "2015-08-12T13:26:35Z")

</div>

Hi Chris,

Is the mwk file format documented anywhere?

I’m trying to do some analyses of eye-movement patterns from mwk files. While I know where in Ha’s code I can extract this type of information (in kind of a hack-y way), for me it’s often more time effective and cleaner to have an understanding of how things underneath are structured (ex. the file format) than to somewhat hack-ily modify Ha’s scripts which were designed for a completely different purpose (RSVP-type analyses).

[I’m specifically using [GitHub - hahong/maru: Multi-electrode Array Recording Utilities](https://github.com/hahong/maru), which uses [GitHub - hahong/pymworks: Python interface to .mwk files under \*NIX systems](https://github.com/hahong/pymworks) for file reading… but neither seem to describe the mwk file format explicitly and I don’t see documentation on the mworks website]

Thanks!  
Darren

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 12, 2015, 1:36pm UTC](https://mworks.discourse.group/t/mworks-file-format-documentation/504/2 "2015-08-12T13:36:23Z")

</div>

Oh–I was looking through some of the source files and found:

[https://github.com/mworks/mworks/blob/master/examples/Examples/RSVPDemo/MATLAB\_analysis\_files/RSVP\_analysis.m](https://github.com/mworks/mworks/blob/master/examples/Examples/RSVPDemo/MATLAB_analysis_files/RSVP_analysis.m)

This example seems like the right amount of detail for me to extract the data I need.

(maybe it would be useful to provide a link to these examples on the mworks website in the “Knowledge Base / Data Analysis” section? I was assuming examples like this might not exist since I didn’t find anything linked from the main website)

Best,  
Darren

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 12, 2015, 3:20pm UTC](https://mworks.discourse.group/t/mworks-file-format-documentation/504/3 "2015-08-12T15:20:48Z")

</div>

Hi Darren,

If you’re doing your analysis on a Mac, then you can use the data-unpacking tools that are bundled with MWorks. I’ve attached MATLAB and Python example scripts that demonstrate the basics.

I believe Ha wrote his [pymworks](https://github.com/hahong/pymworks) package so that he could unpack MWorks data files under Linux. If you’re also working on a non-Mac system, then you’ll either need to use Ha’s code (or another package, also called [pymworks](https://github.com/braingram/pymworks), written by a former member of Dave Cox’s lab) or write your own unpacking tools.

Unfortunately, there is no documentation of MWorks’ file format apart from the [source code](https://github.com/mworks/mworks/blob/master/supporting_libs/scarab/Scarab-0.1.00d19/c/encoding_ldo.c). For a more digestible version of such, see the attached file `ldo.py`, which contains a pure-Python implementation of the unpacking algorithm.

> (maybe it would be useful to provide a link to these examples on the mworks website in the “Knowledge Base / Data Analysis” section? I was assuming examples like this might not exist since I didn’t find anything linked from the main website)

Yes, that’s a good idea!

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 12, 2015, 3:20pm UTC](https://mworks.discourse.group/t/mworks-file-format-documentation/504/4 "2015-08-12T15:20:48Z")

</div>

Attachments:

- [dumpEvents.m](https://mworks.discourse.group/uploads/short-url/iO4KpcLWnQL6Hfv2mBVKoLSBOla.m) (670 Bytes)
- [dump\_events.py](https://mworks.discourse.group/uploads/short-url/mcQC9WMDSaNW9vePVu6Wi5ZmUFg.py) (656 Bytes)
- [ldo.py](https://mworks.discourse.group/uploads/short-url/fQB9X7bbwq4qZ7k8hCVckY88WNu.py) (3.04 KB)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 10:38pm UTC](https://mworks.discourse.group/t/mworks-file-format-documentation/504/5 "2022-07-19T22:38:26Z")

</div>


