Skip to content

Commit

Permalink
Adding Gaze raw data to the database (#530)
Browse files Browse the repository at this point in the history
* Saving gaze data to dataset.

* Fixing station in v2

* Fixing small bug

* Table metadata and small improvements.

---------

Co-authored-by: Paulo Soares <[email protected]>
  • Loading branch information
Paulo Soares and Paulo Soares authored Aug 20, 2023
1 parent 367b590 commit 90d97e0
Show file tree
Hide file tree
Showing 4 changed files with 596 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,16 @@

echo "Building database from scratch."

#./build_base_tables.py \
# && ./process_rest_state_task_data.py \
# && ./process_affective_task_data.py \
# && ./process_fingertapping_task_data.py \
# && ./process_ping_pong_competitive_data.py \
# && ./process_ping_pong_cooperative_data.py \
# && ./process_testbed_messages.py \
# && ./process_fnirs_data.py \
# && ./process_eeg_data.py \
# && ./update_inspect_file.sh

python build_base_tables.py
python process_rest_state_task_data.py
python process_affective_task_data.py
python process_fingertapping_task_data.py
python process_ping_pong_competitive_data.py
python process_ping_pong_cooperative_data.py
python process_testbed_messages.py
python process_fnirs_data.py
python process_eeg_data.py
python update_inspect_file.sh
./build_base_tables.py \
&& ./process_rest_state_task_data.py \
&& ./process_affective_task_data.py \
&& ./process_fingertapping_task_data.py \
&& ./process_ping_pong_competitive_data.py \
&& ./process_ping_pong_cooperative_data.py \
&& ./process_testbed_messages.py \
&& ./process_fnirs_data.py \
&& ./process_eeg_data.py \
&& ./process_gaze_data.py \
&& ./update_inspect_file.sh

echo "Finished building database from scratch"
39 changes: 39 additions & 0 deletions human_experiments/datasette_interface/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,45 @@ databases:
timestamp_unix: The Unix timestamp of the event.
timestamp_iso8601: The ISO-8601 timestamp of the event.

gaze_raw:
description: >
Table with raw Gaze data.
columns:
group_session: Group session ID
task: Task ID.
station: The iMac that the participant was stationed at.
participant: >
Participant ID. A participant ID of -1 indicates an
unknown participant. All rows that do not have values
for the `task` column will have their participant ID
set to -1. In the future, we will label some of these
inter/pre/post task rows with the correct participant
ID.
timestamp_unix: The Unix timestamp of the event.
timestamp_iso8601: The ISO-8601 timestamp of the event.
confidence: Computed confidence between 0 (not confident) - 1 (confident).
norm_pos_x: X position in the eye image frame in normalized coordinates.
norm_pos_y: Y position in the eye image frame in normalized coordinates.
gaze_point_3d_x: X position of the 3d gaze point (the point the subject looks at) in the world camera coordinate system.
gaze_point_3d_y: Y position of the 3d gaze point (the point the subject looks at) in the world camera coordinate system.
gaze_point_3d_z: X position of the 3d gaze point (the point the subject looks at) in the world camera coordinate system.
eye_center0_3d_x: X center of eye-ball 0 in the world camera coordinate system.
eye_center0_3d_y: Y center of eye-ball 0 in the world camera coordinate system.
eye_center0_3d_z: Z center of eye-ball 0 in the world camera coordinate system.
eye_center1_3d_x: X center of eye-ball 1 in the world camera coordinate system.
eye_center1_3d_y: Y center of eye-ball 1 in the world camera coordinate system.
eye_center1_3d_z: Z center of eye-ball 1 in the world camera coordinate system.
gaze_normal0_x: X normal of the visual axis for eye 0 in the world camera coordinate system. The visual axis goes through the eye ball center and the object that is looked at.
gaze_normal0_y: Y normal of the visual axis for eye 0 in the world camera coordinate system. The visual axis goes through the eye ball center and the object that is looked at.
gaze_normal0_z: Z normal of the visual axis for eye 0 in the world camera coordinate system. The visual axis goes through the eye ball center and the object that is looked at.
gaze_normal1_x: X normal of the visual axis for eye 1 in the world camera coordinate system. The visual axis goes through the eye ball center and the object that is looked at.
gaze_normal1_y: Y normal of the visual axis for eye 1 in the world camera coordinate system. The visual axis goes through the eye ball center and the object that is looked at.
gaze_normal1_z: Z normal of the visual axis for eye 1 in the world camera coordinate system. The visual axis goes through the eye ball center and the object that is looked at.
diameter0_2d: Diameter of the eye-ball 0's pupil in image pixels as observed in the eye image frame (not corrected for perspective).
diameter1_2d: Diameter of the eye-ball 1's pupil in image pixels as observed in the eye image frame (not corrected for perspective).
diameter0_3d: Diameter of the eye-ball 0's pupil scaled to mm based on anthropomorphic avg eye ball diameter and corrected for perspective.
diameter1_3d: Diameter of the eye-ball 1's pupil scaled to mm based on anthropomorphic avg eye ball diameter and corrected for perspective.

group_session:
description: Table with group session IDs.
columns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def insert_data_into_table(stream, session, station, db_connection):
)
+ ")"
)
db_connection.execute("PRAGMA foreign_keys = 1;")
db_connection.executemany(query, data)


Expand Down
Loading

0 comments on commit 90d97e0

Please sign in to comment.