Skip to content

Instantly share code, notes, and snippets.

View N-M-T's full-sized avatar

Neil M. Thomas N-M-T

View GitHub Profile
@N-M-T
N-M-T / access_pupil_data.py
Created December 29, 2020 16:30
Use get_event method to access pupil data
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
@N-M-T
N-M-T / extract_surfaces.py
Last active January 19, 2023 02:44
Extract gaze and fixations on surfaces (if available) for a given set of recordings
import argparse
import logging
import os
import traceback as tb
import numpy as np
import pandas as pd
import msgpack
@N-M-T
N-M-T / transform_eye_centers.py
Last active August 22, 2022 07:55
Transform eyeball centers from scene camera coodinates to head pose coordinates
import argparse
import csv
import logging
import os
import cv2
import numpy as np
import pandas as pd
@N-M-T
N-M-T / decode_fit.py
Created July 20, 2022 13:01
Minimal example to extract fit and invisible timestamps
from datetime import datetime, timedelta
from typing import Dict, Union, Optional, Tuple
import numpy as np
import pandas as pd
import fitdecode
# The names of the columns we will use in our points DataFrame. For the data we will be getting
# from the FIT data, we use the same name as the field names to make it easier to parse the data.
@N-M-T
N-M-T / parse_and_plot_eda.py
Created February 6, 2023 17:12
Parse eda data from avro and plot
from avro.datafile import DataFileReader
from avro.io import DatumReader
import matplotlib.pyplot as plt
from datetime import datetime
import json
avro_file = "/Users/neilthomas/Downloads/1-1-PILOT_1675422454.avro"
# Read Avro file
reader = DataFileReader(open(avro_file, "rb"), DatumReader())