neon_recording
¶
Modules:
-
calib
–Camera calibration utils
-
neon_recording
–Neon Recording
-
stream
–Streams module
Classes:
-
AudioStream
–Audio frames stream
-
BlinkStream
–Blinks data
-
EventStream
–Event annotations
-
EyeStateStream
–Eye state data
-
FixationStream
–Fixation data
-
GazeStream
–Gaze data
-
IMUStream
–Motion and orientation data
-
NeonRecording
–Class to handle the Neon Recording data
-
VideoStream
–Video frames from a camera
-
WornStream
–Worn (headset on/off) data
Functions:
-
open
–Load a NeonRecording from a path
AudioStream
¶
AudioStream(name: str, base_name: str, recording: NeonRecording)
Bases: BaseAVStream
Audio frames stream
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
data
(Array
) –Stream data as structured numpy array
-
pd
–Stream data as a pandas DataFrame
-
ts
(NDArray[int64]
) –The moment these data were recorded
Source code in src/pupil_labs/neon_recording/stream/av_stream/base_av_stream.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
BlinkStream
¶
BlinkStream(recording: NeonRecording)
Bases: Stream[BlinkArray, BlinkRecord]
, BlinkProps
Blinks data
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
end_ts
–End timestamp of blink
-
pd
–Stream data as a pandas DataFrame
-
start_ts
–Start timestamp of blink
-
ts
(NDArray[int64]
) –The moment these data were recorded
Source code in src/pupil_labs/neon_recording/stream/blink_stream.py
47 48 49 50 51 52 53 54 55 56 57 |
|
end_ts
class-attribute
instance-attribute
¶
end_ts = fields[int64]('end_timestamp_ns')
End timestamp of blink
start_ts
class-attribute
instance-attribute
¶
start_ts = fields[int64]('start_timestamp_ns')
Start timestamp of blink
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
EventStream
¶
EventStream(recording: NeonRecording)
Bases: Stream[EventArray, EventRecord]
, EventProps
Event annotations
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
by_name
–Return a dict of event_name => all ts
-
event
–Event name
-
pd
–Stream data as a pandas DataFrame
-
ts
(NDArray[int64]
) –The moment these data were recorded
Source code in src/pupil_labs/neon_recording/stream/event_stream.py
39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
EyeStateStream
¶
EyeStateStream(recording: NeonRecording)
Bases: Stream[EyeStateArray, EyeStateRecord]
, EyeStateProps
Eye state data
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
eyeball_center_left_xyz
–The xyz position in mm of the left eyeball relative to the scene camera
-
eyeball_center_right_xyz
–The xyz position in mm of the right eyeball relative to the scene camera
-
eyelid_angle
–Eyelid angle: (top_left, bottom_left, top_right, bottom_right)
-
eyelid_aperture_left_right_mm
–Eyelid aperture in mm: (left, right)
-
optical_axis_left_xyz
–A xyz vector in the forward direction of the left eye's optical axis
-
optical_axis_right_xyz
–A xyz vector in the forward direction of the right eye's optical axis
-
pd
–Stream data as a pandas DataFrame
-
pupil_diameter_left_mm
–Pupil diameter (in mm) for left eye
-
pupil_diameter_left_right_mm
–Pupil diameter (in mm) for both eyes: (left, right)
-
pupil_diameter_right_mm
–Pupil diameter (in mm) for right eye
-
ts
(NDArray[int64]
) –The moment these data were recorded
Source code in src/pupil_labs/neon_recording/stream/eye_state_stream.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
eyeball_center_left_xyz
class-attribute
instance-attribute
¶
eyeball_center_left_xyz = fields[float64](['eyeball_center_left_x', 'eyeball_center_left_y', 'eyeball_center_left_z'])
The xyz position in mm of the left eyeball relative to the scene camera
eyeball_center_right_xyz
class-attribute
instance-attribute
¶
eyeball_center_right_xyz = fields[float64](['eyeball_center_right_x', 'eyeball_center_right_y', 'eyeball_center_right_z'])
The xyz position in mm of the right eyeball relative to the scene camera
eyelid_angle
class-attribute
instance-attribute
¶
eyelid_angle = fields[float64](['eyelid_angle_top_left', 'eyelid_angle_bottom_left', 'eyelid_angle_top_right', 'eyelid_angle_bottom_right'])
Eyelid angle: (top_left, bottom_left, top_right, bottom_right)
eyelid_aperture_left_right_mm
class-attribute
instance-attribute
¶
eyelid_aperture_left_right_mm = fields[float64](['eyelid_aperture_left_mm', 'eyelid_aperture_right_mm'])
Eyelid aperture in mm: (left, right)
optical_axis_left_xyz
class-attribute
instance-attribute
¶
optical_axis_left_xyz = fields[float64](['optical_axis_left_x', 'optical_axis_left_y', 'optical_axis_left_z'])
A xyz vector in the forward direction of the left eye's optical axis
optical_axis_right_xyz
class-attribute
instance-attribute
¶
optical_axis_right_xyz = fields[float64](['optical_axis_right_x', 'optical_axis_right_y', 'optical_axis_right_z'])
A xyz vector in the forward direction of the right eye's optical axis
pupil_diameter_left_mm
class-attribute
instance-attribute
¶
pupil_diameter_left_mm = fields[float64](['pupil_diameter_left_mm'])
Pupil diameter (in mm) for left eye
pupil_diameter_left_right_mm
class-attribute
instance-attribute
¶
pupil_diameter_left_right_mm = fields[float64](['pupil_diameter_left_mm', 'pupil_diameter_right_mm'])
Pupil diameter (in mm) for both eyes: (left, right)
pupil_diameter_right_mm
class-attribute
instance-attribute
¶
pupil_diameter_right_mm = fields[float64](['pupil_diameter_right_mm'])
Pupil diameter (in mm) for right eye
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
FixationStream
¶
FixationStream(recording: NeonRecording)
Bases: Stream[FixationArray, FixationRecord]
, FixationProps
Fixation data
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
amplitude_angle_deg
–Amplitude angle (degrees)
-
amplitude_pixels
–Amplitude (pixels)
-
end_gaze_xy
–End gaze position in pixels
-
end_ts
–Start timestamp of fixation
-
event_type
–Fixation event kind (0 = saccade / 1 = fixation)
-
max_velocity
–Max velocity of fixation (pixels/sec)
-
mean_gaze_xy
–Mean gaze position in pixels
-
mean_velocity
–Mean velocity of fixation (pixels/sec)
-
pd
–Stream data as a pandas DataFrame
-
start_gaze_xy
–Start gaze position in pixels
-
start_ts
–Start timestamp of fixation
-
ts
(NDArray[int64]
) –The moment these data were recorded
Source code in src/pupil_labs/neon_recording/stream/fixation_stream.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
amplitude_angle_deg
class-attribute
instance-attribute
¶
amplitude_angle_deg = fields[float32]('amplitude_angle_deg')
Amplitude angle (degrees)
amplitude_pixels
class-attribute
instance-attribute
¶
amplitude_pixels = fields[float32]('amplitude_pixels')
Amplitude (pixels)
end_gaze_xy
class-attribute
instance-attribute
¶
end_gaze_xy = fields[float32](['end_gaze_x', 'end_gaze_y'])
End gaze position in pixels
end_ts
class-attribute
instance-attribute
¶
end_ts = fields[int64]('end_timestamp_ns')
Start timestamp of fixation
event_type
class-attribute
instance-attribute
¶
event_type = fields[int32]('event_type')
Fixation event kind (0 = saccade / 1 = fixation)
max_velocity
class-attribute
instance-attribute
¶
max_velocity = fields[float32]('max_velocity')
Max velocity of fixation (pixels/sec)
mean_gaze_xy
class-attribute
instance-attribute
¶
mean_gaze_xy = fields[float32](['mean_gaze_x', 'mean_gaze_y'])
Mean gaze position in pixels
mean_velocity
class-attribute
instance-attribute
¶
mean_velocity = fields[float32]('mean_velocity')
Mean velocity of fixation (pixels/sec)
start_gaze_xy
class-attribute
instance-attribute
¶
start_gaze_xy = fields[float32](['start_gaze_x', 'start_gaze_y'])
Start gaze position in pixels
start_ts
class-attribute
instance-attribute
¶
start_ts = fields[int64]('start_timestamp_ns')
Start timestamp of fixation
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
GazeStream
¶
GazeStream(recording: NeonRecording)
Bases: Stream[GazeArray, GazeRecord]
, GazeProps
Gaze data
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
pd
–Stream data as a pandas DataFrame
-
ts
(NDArray[int64]
) –The moment these data were recorded
-
x
–Gaze x coordinate in pixels
-
xy
–Gaze xy coordinates in pixels
-
y
–Gaze y coordinate in pixels
Source code in src/pupil_labs/neon_recording/stream/gaze_stream.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
xy
class-attribute
instance-attribute
¶
xy = fields[float64](['x', 'y'])
Gaze xy coordinates in pixels
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
IMUStream
¶
IMUStream(recording)
Bases: Stream[ImuArray, ImuRecord]
, ImuProps
Motion and orientation data
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
accel_xyz
–Acceleration data
-
data
(Array
) –Stream data as structured numpy array
-
gyro_xyz
–Gyroscope data
-
pd
–Stream data as a pandas DataFrame
-
quaternion_wxyz
–Orientation as a quaternion
-
ts
(NDArray[int64]
) –The moment these data were recorded
Source code in src/pupil_labs/neon_recording/stream/imu/imu_stream.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
accel_xyz
class-attribute
instance-attribute
¶
accel_xyz = fields[float64](['accel_x', 'accel_y', 'accel_z'])
Acceleration data
gyro_xyz
class-attribute
instance-attribute
¶
gyro_xyz = fields[float64](['gyro_x', 'gyro_y', 'gyro_z'])
Gyroscope data
quaternion_wxyz
class-attribute
instance-attribute
¶
quaternion_wxyz = fields[float64](['quaternion_w', 'quaternion_x', 'quaternion_y', 'quaternion_z'])
Orientation as a quaternion
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
NeonRecording
¶
Class to handle the Neon Recording data
Parameters:
Raises:
-
FileNotFoundError
–If the directory does not exist or is not valid.
Attributes:
-
audio
(AudioStream
) –Audio from the scene video
-
blinks
(BlinkStream
) –Blink data
-
calibration
(Calibration | None
) –Device camera calibration data
-
device_serial
(str | None
) –Device serial number
-
duration
(int
) –Recording Duration (nanoseconds)
-
events
(EventStream
) –Event annotations
-
eye
(VideoStream
) –Frames of video from the eye cameras
-
eye_state
(EyeStateStream
) –Eye state data
-
fixations
(FixationStream
) –Fixations data
-
gaze
(GazeStream
) –2D gaze data in scene-camera space
-
id
(str | None
) –UUID of the recording
-
imu
(IMUStream
) –Motion and orientation data
-
info
(dict
) –Information loaded from info.json
-
scene
(VideoStream
) –Frames of video from the scene camera
-
start_ts
(int
) –Start timestamp (nanoseconds since 1970-01-01)
-
stop_ts
(int
) –Stop timestamp (nanoseconds since 1970-01-01)
-
wearer
(dict
) –Wearer information containing uuid and name
-
worn
(WornStream
) –Worn (headset on/off) data
Source code in src/pupil_labs/neon_recording/neon_recording.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
VideoStream
¶
VideoStream(name: str, base_name: str, recording: NeonRecording)
Bases: BaseAVStream
Video frames from a camera
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
data
(Array
) –Stream data as structured numpy array
-
height
(int | None
) –Height of image in stream
-
pd
–Stream data as a pandas DataFrame
-
ts
(NDArray[int64]
) –The moment these data were recorded
-
width
(int | None
) –Width of image in stream
Source code in src/pupil_labs/neon_recording/stream/av_stream/base_av_stream.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
WornStream
¶
WornStream(recording: NeonRecording)
Bases: Stream[WornArray, WornRecord]
, WornProps
Worn (headset on/off) data
Methods:
-
interpolate
–Interpolated stream data for
sorted_ts
Attributes:
-
pd
–Stream data as a pandas DataFrame
-
ts
(NDArray[int64]
) –The moment these data were recorded
-
worn
–Worn
Source code in src/pupil_labs/neon_recording/stream/worn_stream.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
ts
class-attribute
instance-attribute
¶
ts: NDArray[int64] = fields[int64](TIMESTAMP_FIELD_NAME)
The moment these data were recorded
interpolate
¶
interpolate(sorted_ts: NDArray[int64]) -> ArrayType
Interpolated stream data for sorted_ts
Source code in src/pupil_labs/neon_recording/stream/stream.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
open
¶
open(rec_dir_in: Union[Path, str]) -> NeonRecording
Load a NeonRecording from a path
Source code in src/pupil_labs/neon_recording/neon_recording.py
151 152 153 |
|