File
ArGaze provides a ready-made contexts to read data from various file format.
To select a desired context, the JSON samples have to be edited and saved inside an ArContext configuration file. Notice that the pipeline entry is mandatory.
{
JSON sample
"pipeline": ...
}
Read more about ArContext base class in code reference.
CSV
Bases: ArFeatures.DataPlaybackContext
duration: int | float
property
Get data duration.
end: int | float
property
writable
End reading timestamp.
left_eye_validity_column: str
property
writable
Validity of left eye coordinate column name.
Note
This column name is required in the case where gaze position coordinates and validity are given for each eye in six separated columns.
left_eye_x_column: str
property
writable
X coordinate for left eye column name.
Note
This column name is required in the case where gaze position coordinates and validity are given for each eye in six separated columns.
left_eye_y_column: str
property
writable
Y coordinate for left eye column name.
Note
This column name is required in the case where gaze position coordinates and validity are given for each eye in six separated columns.
path: str
property
writable
Path to data file.
progression: float
property
Get data processing progression between 0 and 1.
rescale_to_pipeline_size: bool
property
writable
Rescale gaze positions to pipeline size.
right_eye_validity_column: str
property
writable
Validity of right eye coordinate column name.
Note
This column name is required in the case where gaze position coordinates and validity are given for each eye in six separated columns.
right_eye_x_column: str
property
writable
X coordinate for right eye column name.
Note
This column name is required in the case where gaze position coordinates and validity are given for each eye in six separated columns.
right_eye_y_column: str
property
writable
Y coordinate for right eye column name.
Note
This column name is required in the case where gaze position coordinates and validity are given for each eye in six separated columns.
separator: str
property
writable
Value delimiter character
start: int | float
property
writable
Start reading timestamp.
timestamp_column: str
property
writable
Timestamp column name in file.
Warning
This column name is mandatory.
x_column: str
property
writable
X coordinate column name.
Note
This column name is required in the case where gaze position coordinates are splitted in two separated columns.
xy_column: str
property
writable
X and Y coordinate column name.
Note
This column name is required in the case where gaze position coordinates are joined as a list in one single column.
y_column: str
property
writable
Y coordinate column name.
Note
This column name is required in the case where gaze position coordinates are splitted in two separated columns.
JSON sample: splitted case
To use when gaze position coordinates are splitted in two separated columns.
{
"argaze.utils.contexts.File.CSV": {
"name": "CSV file data playback",
"path": "./src/argaze/utils/demo/gaze_positions_splitted.csv",
"timestamp_column": "Timestamp (ms)",
"x_column": "Gaze Position X (px)",
"y_column": "Gaze Position Y (px)",
"pipeline": ...
}
}
JSON sample: joined case
To use when gaze position coordinates are joined as a list in one single column.
{
"argaze.utils.contexts.File.CSV" : {
"name": "CSV file data playback",
"path": "./src/argaze/utils/demo/gaze_positions_xy_joined.csv",
"timestamp_column": "Timestamp (ms)",
"xy_column": "Gaze Position (px)",
"pipeline": ...
}
}
JSON sample: left and right eyes
To use when gaze position coordinates and validity are given for each eye in six separated columns.
{
"argaze.utils.contexts.File.CSV": {
"name": "CSV file data playback",
"path": "./src/argaze/utils/demo/gaze_positions_left_right_eyes.csv",
"timestamp_column": "Timestamp (ms)",
"left_eye_x_column": "Left eye X",
"left_eye_y_column": "Left eye Y",
"left_eye_validity_column": "Left eye validity",
"right_eye_x_column": "Right eye X",
"right_eye_y_column": "Right eye Y",
"right_eye_validity_column": "Right eye validity",
"rescale_to_pipeline_size": true,
"pipeline": ...
}
}