Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0e30009
initial documentation restiling
TommasoGhilardi Nov 5, 2025
664db22
swithched to docs as web folder
TommasoGhilardi Nov 5, 2025
95fac8e
wider page
TommasoGhilardi Nov 21, 2025
957aa8c
calibration tutorial
TommasoGhilardi Nov 21, 2025
012dc13
Merge branch 'main' into Documentation
TommasoGhilardi Nov 21, 2025
8f672f6
fix verbose in calibration
TommasoGhilardi Nov 22, 2025
4b91c0a
Update infant_stims parameter to accept True for default stimuli inst…
TommasoGhilardi Nov 22, 2025
dcfdb2a
Add announcement banner for beta status, enable grid pagination, and …
TommasoGhilardi Nov 22, 2025
e9e1efe
Add calibration video and status GIF to documentation resources
TommasoGhilardi Nov 22, 2025
caf9cfb
Add custom callout Quarto extension with YAML config and Lua scripts
TommasoGhilardi Nov 22, 2025
702f12f
Rewrite and expand Calibration vignette: improved explanations, added…
TommasoGhilardi Nov 22, 2025
38c6180
render
TommasoGhilardi Nov 22, 2025
6b4e329
test video in website
TommasoGhilardi Nov 22, 2025
6d516f2
switch to vimeo for video hosting
TommasoGhilardi Nov 22, 2025
440170e
rendering
TommasoGhilardi Nov 22, 2025
c86549c
new logo render
TommasoGhilardi Nov 23, 2025
3e2ed59
Add logo images (PNG and SVG) to Documentation resources folder
TommasoGhilardi Nov 23, 2025
9cdc986
Add note about Tobii eye tracker drivers and update installation inst…
TommasoGhilardi Nov 23, 2025
c6e35e3
render
TommasoGhilardi Nov 23, 2025
c914897
added calibration to sidebar
TommasoGhilardi Nov 23, 2025
88d9ec6
updated documentation and website
TommasoGhilardi Nov 29, 2025
c94ecb6
render
TommasoGhilardi Nov 29, 2025
ffaa494
Merge branch 'main' into Documentation
TommasoGhilardi Nov 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
419 changes: 337 additions & 82 deletions DeToX/Base.py

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions DeToX/Calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,6 @@ def _fade_sound(self, sound, fade_duration=0.5, steps=10):
-----
The sound is automatically stopped after the fade completes, and volume
is reset to 1.0 (maximum) so it's ready for the next playback at full volume.

Examples
--------
>>> # Fade out calibration audio when point is collected
>>> self._fade_sound(self.audio, fade_duration=0.5)
>>> # Next play() will start at full volume
>>> self.audio.play()
"""
# --- Fade-out Loop ---
# Gradually decrease volume from current level to 0
Expand Down
6 changes: 6 additions & 0 deletions Documentation/Vignettes/Calibration.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ Let's break down what's happening here:

**`shuffle=True`**: Randomizes which image appears at each calibration point. This prevents habituation and keeps participants engaged throughout the procedure.

<<<<<<< HEAD
**`audio=True`**: Plays an attention-getting sound along with the visual stimulus to help capture and maintain the participant's focus.

**`anim_type='zoom'`**: Makes the stimuli gently pulse in size to attract attention. You can also use `'trill'` for a rotating animation.
=======
**`audio=True`**: Plays an attention-getting sound along with the visual stimulus to help capture and maintain the participant's focus. **`anim_type='zoom'`**: Makes the stimuli gently pulse in size to attract attention. You can also use `'trill'` for a rotating animation.
>>>>>>> origin/main

**`visualization_style='circles'`**: Displays the calibration results using dots at each point. You can also choose `'lines'` to show lines connecting the target to where the gaze landed.

Expand Down
8 changes: 0 additions & 8 deletions Documentation/Vignettes/Installation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ So you're interested in using DeToX? Awesome! Let's get you set up quickly.

DeToX is designed as a lightweight wrapper around **PsychoPy** and **tobii_research**. Here's the good news: `tobii_research` usually comes bundled with PsychoPy, which means the only real hurdle is installing PsychoPy itself. And yes, PsychoPy *can* be a bit tricky to install due to its many dependencies—but don't worry, we'll walk you through it. Once PsychoPy is up and running, adding DeToX is a breeze.

::: callout-note
## Eye Tracker Drivers Required ![](https://connect.tobii.com/file-asset/eye_tracker_manager?v=2){fig-align="right" width="49" height="33"}

Before DeToX can communicate with your Tobii eye tracker, you need to ensure the correct drivers are installed on your computer. The easiest way to do this is by downloading and installing the [Tobii Pro Eye Tracker Manager](https://www.tobii.com/products/software/applications-and-developer-kits/tobii-pro-eye-tracker-manager)—a free software provided by Tobii that allows you to installs the necessary drivers for your device.

As a bonus, the Eye Tracker Manager also includes a built-in calibration tool (designed for adult self-paced calibration), which can be useful for testing that your hardware is working properly before running DeToX.
:::

## Installing PsychoPy

Since PsychoPy is the main challenge, let's tackle that first. You have **two main options**:
Expand Down
27 changes: 17 additions & 10 deletions Documentation/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ website:
format:
html:
theme:
- pulse
- sandstone
- styles.scss # your custom SCSS file
toc: true
toc-expand: 4
Expand Down Expand Up @@ -123,15 +123,22 @@ filters:


quartodoc:
style: pkgdown
title: Reference
package: DeToX

style: pkgdown
parser: numpy
renderer:
style: markdown
table_style: table
render_interlinks: true

dir: api
sidebar: api/_sidebar.yml

sections:
- title: Main Eye-tracker Class
desc: >
desc: |
The central class of the DeToX package, responsible for connecting to
and managing the Tobii eye tracker. This class must be instantiated
before any other functionality can be used. It provides access to
Expand All @@ -141,7 +148,7 @@ quartodoc:
- ETracker

- subtitle: Control the Recording
desc: >
desc: |
Functions for starting, stopping, and managing the capture of eye-tracking
data. These methods allow you to initiate and terminate recordings,
mark events of interest, and save collected data to disk.
Expand All @@ -152,7 +159,7 @@ quartodoc:
- ETracker.save_data

- subtitle: Calibration
desc: >
desc: |
Methods for running and managing eye tracker calibration. These include
displaying calibration status, initiating calibration routines, and
saving or loading calibration settings to ensure accurate gaze data.
Expand All @@ -163,7 +170,7 @@ quartodoc:
- ETracker.load_calibration

- subtitle: Gaze Contingent
desc: >
desc: |
Tools for running gaze-contingent experiments, where visual presentation
adapts dynamically to a participants gaze position. Includes functionality
for live gaze-contingent control and methods to compute average gaze
Expand All @@ -173,7 +180,7 @@ quartodoc:
- ETracker.get_gaze_position

- title: Internal Calibration
desc: >
desc: |
Classes for running eye-tracker calibration. These get called internally by the ETracker class, and are reported here only for completeness.
They are comprise of a base calibration class that set the common interface, and the specific implementations for Tobii and Mouse calibration.
contents:
Expand All @@ -182,7 +189,7 @@ quartodoc:
- MouseCalibrationSession

- title: Coordinate Conversion
desc: >
desc: |
A collection of utility functions designed to help the conversion of the data from different formats.
These are called internally by the ETracker class, but can be used independently if needed.
contents:
Expand All @@ -195,15 +202,15 @@ quartodoc:
- get_psychopy_pos_from_trackbox

- title: Utilities
desc: >
desc: |
A set of utility classes and functions for presenting stimuli
and formatted text. These are called internally by the ETracker class.
contents:
- NicePrint
- InfantStimuli

- title: Configuration Settings
desc: >
desc: |
Configuration classes and module-level instances for customizing the
behavior and appearance of the DeToX eye-tracking system. These settings
control animation parameters, colors, UI element sizes, and data formats.
Expand Down
29 changes: 18 additions & 11 deletions Documentation/api/BaseCalibrationSession.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BaseCalibrationSession(
audio=None,
anim_type='zoom',
visualization_style='lines',
visualization_style='lines',
)
```

Expand Down Expand Up @@ -43,15 +44,15 @@ simulation modes support 2-9 calibration points.

#### Parameters {.doc-section .doc-section-parameters}

| Name | Type | Description | Default |
|--------------------|--------|----------------------------------------------------|------------|
| calibration_points | list | List of calibration point coordinates to validate. | _required_ |
| Name | Type | Description | Default |
|--------------------|----------------|----------------------------------------------------|------------|
| calibration_points | [list](`list`) | List of calibration point coordinates to validate. | _required_ |

#### Raises {.doc-section .doc-section-raises}

| Name | Type | Description |
|--------|------------|-------------------------------------------------------|
| | ValueError | If number of points is less than 2 or greater than 9. |
| Name | Type | Description |
|--------|----------------------------|-------------------------------------------------------|
| | [ValueError](`ValueError`) | If number of points is less than 2 or greater than 9. |

### show_message_and_wait { #DeToX.BaseCalibrationSession.show_message_and_wait }

Expand All @@ -67,8 +68,14 @@ then pauses execution until any key is pressed.

#### Parameters {.doc-section .doc-section-parameters}

| Name | Type | Description | Default |
|--------|--------|-------------------------------------------------------------------|--------------|
| body | str | The main message text to display. | _required_ |
| title | str | Title for the message box. Default empty string. | `''` |
| pos | tuple | Position of the message box center on screen. Default (0, -0.15). | `(0, -0.15)` |
| Name | Type | Description | Default |
|--------|--------|------------------------------------------------------------------------------------------------------------------------|--------------|
| body | str | The main message text to display. Will be formatted with box-drawing characters via NicePrint. | _required_ |
| title | str | Title for the message box. Appears at the top of the formatted box. Default empty string. | `''` |
| pos | tuple | Position of the message box center on screen in window units. Default (0, -0.15) places message slightly below center. | `(0, -0.15)` |

#### Returns {.doc-section .doc-section-returns}

| Name | Type | Description |
|--------|--------|---------------|
| | None | |
22 changes: 11 additions & 11 deletions Documentation/api/ETSettings.AnimationSettings.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ in height units (percentage of screen height).

## Attributes {.doc-section .doc-section-attributes}

| Name | Type | Description |
|-----------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------|
| focus_time | float | Wait time in seconds before collecting calibration data at each point. Allows participant to fixate on the target. Default is 0.5 seconds. |
| zoom_speed | float | Speed multiplier for the zoom animation. Higher values make the size oscillation faster. Default is 6.0. |
| max_zoom_size | float | Maximum size for zoom animation as percentage of screen height. Default is 0.11 (11% of screen height). |
| min_zoom_size | float | Minimum size for zoom animation as percentage of screen height. Default is 0.05 (5% of screen height). |
| trill_size | float | Fixed size for trill animation as percentage of screen height. Default is 0.075 (7.5% of screen height). |
| trill_rotation_range | float | Maximum rotation angle in degrees for trill animation. Default is 20 degrees. |
| trill_cycle_duration | float | Total cycle time for trill animation in seconds (active + pause). Default is 1.5 seconds. |
| trill_active_duration | float | Duration of active trill rotation in seconds, within each cycle. Default is 1.1 seconds (leaves 0.4s pause). |
| trill_frequency | float | Number of back-and-forth rotation oscillations per second during active trill phase. Default is 3.0 oscillations/second. |
| Name | Type | Description |
|-----------------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| focus_time | [float](`float`) | Wait time in seconds before collecting calibration data at each point. Allows participant to fixate on the target. Default is 0.5 seconds. |
| zoom_speed | [float](`float`) | Speed multiplier for the zoom animation. Higher values make the size oscillation faster. Default is 6.0. |
| max_zoom_size | [float](`float`) | Maximum size for zoom animation as percentage of screen height. Default is 0.11 (11% of screen height). |
| min_zoom_size | [float](`float`) | Minimum size for zoom animation as percentage of screen height. Default is 0.05 (5% of screen height). |
| trill_size | [float](`float`) | Fixed size for trill animation as percentage of screen height. Default is 0.075 (7.5% of screen height). |
| trill_rotation_range | [float](`float`) | Maximum rotation angle in degrees for trill animation. Default is 20 degrees. |
| trill_cycle_duration | [float](`float`) | Total cycle time for trill animation in seconds (active + pause). Default is 1.5 seconds. |
| trill_active_duration | [float](`float`) | Duration of active trill rotation in seconds, within each cycle. Default is 1.1 seconds (leaves 0.4s pause). |
| trill_frequency | [float](`float`) | Number of back-and-forth rotation oscillations per second during active trill phase. Default is 3.0 oscillations/second. |

## Examples {.doc-section .doc-section-examples}

Expand Down
37 changes: 0 additions & 37 deletions Documentation/api/ETSettings.CalibrationPatterns.qmd
Original file line number Diff line number Diff line change
@@ -1,37 +0,0 @@
# ETSettings.CalibrationPatterns { #DeToX.ETSettings.CalibrationPatterns }

```python
ETSettings.CalibrationPatterns(
points_5=(lambda: [(0.0, 0.0), (-0.8, 0.8), (0.8, 0.8), (-0.8, -0.8), (0.8, -0.8)])(),
points_9=(lambda: [(-0.8, 0.8), (0.0, 0.8), (0.8, 0.8), (-0.8, 0.0), (0.0, 0.0), (0.8, 0.0), (-0.8, -0.8), (0.0, -0.8), (0.8, -0.8)])(),
num_samples_mouse=5,
)
```

Standard calibration point patterns in normalized coordinates.

Defines commonly used calibration patterns in normalized units where
the screen ranges from -1 to +1 in both dimensions. These universal
coordinates work across different screen sizes, aspect ratios, and
PsychoPy unit systems.

Convert to window-specific coordinates at runtime using the
norm_to_window_units() function from the Coords module.

## Attributes {.doc-section .doc-section-attributes}

| Name | Type | Description |
|-------------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| points_5 | list of tuple | 5-point calibration pattern (4 corners + center). Standard for quick calibrations with good coverage. Pattern: corners at �0.4 from edges to avoid screen boundaries. |
| points_9 | list of tuple | 9-point calibration pattern (3�3 grid). Standard for comprehensive calibrations requiring high accuracy. Pattern: 3 rows � 3 columns with �0.4 positioning. |
| num_samples_mouse | int | Number of mouse position samples to collect per calibration point in simulation mode. Default 5. |

## Examples {.doc-section .doc-section-examples}

```python
>>> from DeToX import ETSettings as cfg
>>> from DeToX.Coords import norm_to_window_units
>>>
>>> # Change number of mouse samples collected per point
>>> cfg.calibration.num_samples_mouse = 10
```
18 changes: 18 additions & 0 deletions Documentation/api/ETSettings.UIElementSizes.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ PsychoPy window configuration.

## Attributes {.doc-section .doc-section-attributes}

<<<<<<< HEAD
| Name | Type | Description |
|---------------------|------------------|---------------------------------------------------------------------------------------------------------------------|
| highlight | [float](`float`) | Radius of circles highlighting selected calibration points for retry. Default is 0.02 (2% of screen height). |
| line_width | [float](`float`) | Thickness of lines drawn in calibration visualizations. Default is 0.003 (0.3% of screen height). |
| marker | [float](`float`) | Size of markers indicating data collection points. Default is 0.02 (2% of screen height). |
| border | [float](`float`) | Thickness of the red calibration mode border around the screen. Default is 0.005 (0.5% of screen height). |
| plot_line | [float](`float`) | Width of lines in calibration result plots connecting targets to samples. Default is 0.002 (0.2% of screen height). |
| text | [float](`float`) | Base text height (deprecated - use specific text sizes below). Default is 0.025 (2.5% of screen height). |
| target_circle | [float](`float`) | Radius of target circles drawn in calibration result visualizations. Default is 0.012 (1.2% of screen height). |
| target_circle_width | [float](`float`) | Line width for target circle outlines in result visualizations. Default is 0.003 (0.3% of screen height). |
| sample_marker | [float](`float`) | Radius of sample markers in circle visualization style. Default is 0.005 (0.5% of screen height). |
| instruction_text | [float](`float`) | Text height for instruction displays during calibration. Default is 0.019 (1.9% of screen height). |
| message_text | [float](`float`) | Text height for general message displays. Default is 0.016 (1.6% of screen height). |
| title_text | [float](`float`) | Text height for title text in message boxes. Default is 0.018 (1.8% of screen height). |
| legend_text | [float](`float`) | Text height for legend labels showing eye color coding. Default is 0.015 (1.5% of screen height). |
=======
| Name | Type | Description |
|---------------------|--------|---------------------------------------------------------------------------------------------------------------------|
| highlight | float | Radius of circles highlighting selected calibration points for retry. Default is 0.02 (2% of screen height). |
Expand All @@ -42,6 +59,7 @@ PsychoPy window configuration.
| message_text | float | Text height for general message displays. Default is 0.016 (1.6% of screen height). |
| title_text | float | Text height for title text in message boxes. Default is 0.018 (1.8% of screen height). |
| legend_text | float | Text height for legend labels showing eye color coding. Default is 0.015 (1.5% of screen height). |
>>>>>>> origin/main

## Notes {.doc-section .doc-section-notes}

Expand Down
Loading