Created
December 29, 2020 16:30
-
-
Save N-M-T/15d9e336c581477880ade03def7a18be to your computer and use it in GitHub Desktop.
Use get_event method to access pupil data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plugin import Plugin | |
class access_pupil_data(Plugin): | |
uniqueness = "not_unique" | |
icon_chr = chr(0xE061) | |
icon_font = "pupil_icons" | |
def __init__( | |
self, g_pool | |
): | |
super().__init__(g_pool) | |
self.order = 0.9 | |
# initialize empty menu | |
self.menu = None | |
def recent_events(self, events): | |
fixation_pts = [ | |
pt["norm_pos"] | |
for pt in events.get("fixations", []) | |
] | |
gaze_pts = [ | |
pt["norm_pos"] | |
for pt in events.get("gaze", []) | |
] | |
if len(fixation_pts) > 0: | |
print(fixation_pts) | |
if len(gaze_pts) > 0: | |
print(gaze_pts) | |
def init_ui(self): | |
self.add_menu() | |
self.menu.label = "example" | |
def deinit_ui(self): | |
self.remove_menu() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment