Skip to content

Commit

Permalink
@N-M-T 's final edits
Browse files Browse the repository at this point in the history
  • Loading branch information
N-M-T committed Sep 25, 2024
1 parent 593c284 commit 6808bf4
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions neon/data-collection/psychopy/index.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# PsychoPy

[PsychoPy](https://psychopy.org/) is widely used open-source software for creating and running psychophysics experiments. It enables users to present stimuli, collect data, and interface with a variety of hardware and software applications.
[PsychoPy](https://psychopy.org/) is widely used open-source software for creating and running psychophysics experiments.
It enables users to present stimuli, collect data, and interface with a variety of hardware and software applications.

PsychoPy users have two options for designing their experiments.
We have created a dedicated plugin for PsychoPy that enables Neon to be used in PsychoPy experiments. PsychoPy
users have two options for designing their experiments, both of which can be used alongside Neon:

- [Builder](https://www.psychopy.org/builder/) – Gives users a graphical interface with little or no need to write code - although it does support custom code when necessary. A Pupil Labs plugin for PsychoPy is provided to simplify interactions between PsychoPy and Neon.
- [Builder](https://www.psychopy.org/builder/) – Gives users a graphical interface with little or no need to write code - although it does support custom code when necessary.
- [Coder](https://psychopy.org/coder/index.html) – Gives users the option to generate experiments or do other things programmatically, [using Psychopy like any other Python package](https://psychopy.org/api/).

Check warning on line 10 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (Psychopy)

## Using PsychoPy with Neon
When using PsychoPy with Neon, you can save eyetracking data in PsychoPy's hdf5 format, by enabling the "Save hdf5 file"

Check warning on line 13 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (eyetracking)
option within the experiment settings. But we also recommend recording in the Neon Companion app for the duration of
the experiment for data redundancy. PsychoPy’s standard "Eyetracker Record" component can be used to start and stop recordings

Check warning on line 15 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (Eyetracker)
on the Companion Device accordingly.

When using PsychoPy with Neon, we recommend making a recording in the Neon Companion app for the duration of the experiment. PsychoPy’s standard "Eyetracker Record" component can be used to start and stop recordings accordingly. To save eyetracking data in PsychoPy's hdf5 format, enable the "Save hdf5 file" option within the experiment settings.
For experiments that only require pupillometry/eye state, make sure the "Compute Eye State" setting is enabled in the companion app.

Check warning on line 18 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (pupillometry)
For experiments that do not require screen-based gaze coordinates, this is all that is required.

For experiments that only require pupillometry/eye state, make sure the "Compute Eye State" setting is enabled in the companion app. For experiments that do not require screen-based gaze coordinates, this is all that is required.

To use Neon for screen-based work in PsychoPy, the screen needs to be robustly located within the scene camera’s field of view, and Neon’s gaze data subsequently transformed from scene camera-based coordinates to screen-based coordinates. The Pupil Labs eyetracker plugin for PsychoPy achieves this with the use of AprilTag Markers and the [real-time-screen-gaze](https://github.com/pupil-labs/real-time-screen-gaze) Python package (installed automatically with the plugin).
To use Neon for screen-based work in PsychoPy, the screen needs to be robustly located within the scene camera’s field of view,
and Neon’s gaze data subsequently transformed from scene camera-based coordinates to screen-based coordinates. The plugin for
PsychoPy achieves this with the use of AprilTag Markers and the
[real-time-screen-gaze](https://github.com/pupil-labs/real-time-screen-gaze) Python package (installed automatically with the plugin).

## Builder

Expand All @@ -34,18 +42,20 @@ To use Neon for screen-based work in PsychoPy, the screen needs to be robustly l

The standard "Eyetracker Record" and "Region of Interest" components work with Neon. Because Neon is calibration-free, the Calibration and Validation components are unused.

Check warning on line 43 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (Eyetracker)

Two new Builder components will be available in the components list under the Eyetracking section: "April Tag Frame" and "April Tag". These are necessary for screen-based work.
Two new Builder components will be available in the components list under the Eyetracking section: "April Tag Frame" and "April Tag" (necessary for screen-based work).

Check warning on line 45 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (Eyetracking)

- April Tag Frame: this component is recommended for most users. Using it in your Builder experiment will display an array of AprilTag markers around the edge of the screen. You can configure the number of markers to display along the horizontal and vertical edges of the screen, the size and contrast of the markers, and (optionally) the marker IDs. A minimum of four markers (2 horizontally by 2 vertically) is recommended, but more markers will provide more robust detection and accurate mapping.
![AprilTag Frame](./apriltag-frame.png)

- April Tag: this component will add a single AprilTag marker to your display. It is intended for use when the April Tag Frame component cannot be used (e.g., you need to display stimuli on the edges of the display where the April Tag Frame component would place markers in the way).

### Data
### Data Format

[PsychoPy saves eyetracking data in its own format](https://psychopy.org/hardware/eyeTracking.html#what-about-the-data), but we also recommend that you record your sessions with the Companion app. You can use the "Eyetracker Record" component in Builder to automate starting and stopping/saving your recordings.
[PsychoPy saves eyetracking data in its own format](https://psychopy.org/hardware/eyeTracking.html#what-about-the-data).

Check warning on line 54 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (eyetracking)

When processing eyetracking data in PsychoPy's data format, please note that PsychoPy doesn’t have distinct record types for gaze data versus eye state. If you’re collecting screen-gaze coordinates and pupillometry data, their records they will be intermixed, but they can be distinguished.
When processing eyetracking data in PsychoPy's data format, please note that PsychoPy doesn’t have distinct record types

Check warning on line 56 in neon/data-collection/psychopy/index.md

View workflow job for this annotation

GitHub Actions / ✍️ Check spelling

Unknown word (eyetracking)
for gaze data versus eye state. If you’re collecting screen-gaze coordinates and pupillometry data, their records they will
be intermixed, but they can be distinguished.

- For screen gaze records
- `[left|right]_gaze_[x|y]` will be the screen coordinates in PsychoPy’s display units `[left|right]_gaze_z` will be `0`
Expand All @@ -57,14 +67,17 @@ When processing eyetracking data in PsychoPy's data format, please note that Psy
- `left_pupil_measure1` will be pupil diameter in mm
- `left_pupil_measure1_type` will be `77`

### Example
### Example Builder Experiment

Check out our simple but complete [gaze contingent demo designed in PsychoPy Builder](https://github.com/pupil-labs/psychopy-gaze-contingent-demo) to see how it all works!

## Coder

To use Neon with PsychoPy coder, we recommend interfacing directly with the [real-time API](https://docs.pupil-labs.com/neon/real-time-api/tutorials/) and, for screen-based tasks, using the [real-time-screen-gaze](https://github.com/pupil-labs/real-time-screen-gaze) package. `AprilTagFrameStim` and `AprilTagStim` classes are provided to more easily display screen markers and configure a screen-based gaze mapper.
To use Neon with PsychoPy coder, we recommend interfacing directly with the [real-time API](https://docs.pupil-labs.com/neon/real-time-api/tutorials/)
and, for screen-based tasks, using the [real-time-screen-gaze](https://github.com/pupil-labs/real-time-screen-gaze) package.
`AprilTagFrameStim` and `AprilTagStim` classes are provided to more easily display screen markers and configure a screen-based gaze mapper.

### Example Coder Experiment
```python
import numpy as np

Expand Down Expand Up @@ -110,4 +123,4 @@ while True:
break

neon_device.close()
```
```

0 comments on commit 6808bf4

Please sign in to comment.