PolyCAT / docs /file_formats.md
laBran's picture
Add files using upload-large-folder tool
eb72cfa verified
# PolyCAT File Formats
## Gaze TSV (`data/gaze/*.tsv`)
Tab-separated sample-level gaze data. One file per session, named `{participant_id}_part{part}_{session_id}.tsv`.
- **Sampling rate:** 500 Hz per eye (binocular recording; hardware rate 1000 Hz split between eyes)
- **Scope:** Only samples during stimulus presentation (4.0 s per trial) are included
- **Eyes:** One row per sample per eye (binocular sessions produce 2 rows per timestamp)
### Validity codes
| Code | Meaning |
|------|---------|
| 0 | Valid gaze sample (within screen bounds 0-3840 x 0-2160) |
| 1 | Missing or out-of-range (blink, track loss, or coordinates outside screen) |
---
## Fixations CSV (`data/fixations/fixations_all.csv`)
Comma-separated fixation events. Fixations detected by EyeLink's built-in algorithm with:
- Saccade velocity threshold: 30 deg/s
- Saccade acceleration threshold: 8000 deg/s^2
Only fixations starting during stimulus presentation are included. Fixation `end_time_ms` is clamped to stimulus offset.
### Per-participant files
Individual files at `data/fixations/per_participant/{participant_id}_fixations.csv` with the same schema.
---
## Saliency Maps
### NumPy format (`data/saliency_maps/by_polygon/{polygon_id}/{image_id}_fixmap.npy`)
- 2D float32 array at stimulus resolution (3840 x 2160)
- Gaussian kernel sigma = 1.0 degrees visual angle (~78.5 pixels)
- Values outside polygon aperture set to 0
- Normalized to sum to 1 (probability distribution)
- Only generated for polygon-image combinations with >= 3 observers
### PNG format (`data/saliency_maps/by_polygon/{polygon_id}/{image_id}_fixmap.png`)
- Grayscale visualization of the saliency map
- 8-bit, linearly scaled from 0 (min) to 255 (max)
---
## Scanpaths (`data/scanpaths/{participant_id}/{trial_uid}.csv`)
One CSV per trial, containing the ordered fixation sequence.
Columns: `fixation_index`, `start_time_ms`, `end_time_ms`, `x_px`, `y_px`, `duration_ms`
---
## MATLAB Export (`data/fixations/fixations.mat`)
CAT2000-compatible MATLAB struct:
```matlab
fixations.x % double vector: x positions (pixels)
fixations.y % double vector: y positions (pixels)
fixations.dur % double vector: durations (ms)
fixations.subj % cell array: participant IDs
fixations.img % cell array: image IDs
fixations.polygon % cell array: polygon IDs (PolyCAT extension)
```
---
## Coordinate System
**Screen pixels:** 3840 x 2160, origin top-left. `x_px` increases rightward, `y_px` increases downward.
**Degrees:** Relative to screen center (1920, 1080 px).
Conversion formula:
```
x_deg = (x_px - 1920) / ppd
y_deg = (y_px - 1080) / ppd
```
Where `ppd` (pixels per degree) is computed from:
- Screen diagonal: 27 inches = 68.58 cm
- Resolution: 3840 x 2160 px
- Screen width: 59.77 cm, height: 33.62 cm (from diagonal + 16:9 aspect ratio)
- Viewing distance: 70 cm
- Pixel pitch = screen_width / horizontal_pixels = 59.77 cm / 3840 ≈ 0.01557 cm/px
- 1° at 70 cm = 70 × tan(1°) ≈ 1.2228 cm
- `ppd = 1.2228 / 0.01557` ≈ **78.5 px/deg**
---
## Time Reference
| Context | Reference point | Units |
|---------|----------------|-------|
| `timestamp_rel_ms` (gaze TSV) | Stimulus onset for that trial | milliseconds |
| `start_time_ms` / `end_time_ms` (fixations) | Stimulus onset for that trial | milliseconds |
| `ts_*` fields (trials.csv) | Session start (experiment clock) | seconds |