Public Member Functions | |
| __init__ (self, logfilename='default', host='localhost', port=6555) | |
| start_recording (self) | |
| stop_recording (self) | |
| log_message (self, message) | |
| sample (self) | |
| pupil_size (self) | |
| close (self) | |
Public Attributes | |
| calibration = calibration(self._connection) | |
Protected Member Functions | |
| _pause_sample_processing (self) | |
| _unpause_sample_processing (self) | |
| _heartbeater (self, heartbeatinterval) | |
| _stream_samples (self, queue) | |
| _process_samples (self, queue) | |
| _log_sample (self, sample) | |
| _log_header (self) | |
Protected Attributes | |
| _logfile = codecs.open('%s.tsv' % (logfilename), 'w', u'utf-8') | |
| str | _separator = u'\t' |
| _queue = Queue() | |
| _connection = connection(host=host, port=port) | |
| _tracker = tracker(self._connection) | |
| _heartbeat = heartbeat(self._connection) | |
| _lock = Lock() | |
| bool | _beating = True |
| float | _heartbeatinterval = self._tracker.get_heartbeatinterval() / 1000.0 |
| _hbthread = Thread(target=self._heartbeater, args=[self._heartbeatinterval]) | |
| bool | _streaming = True |
| _samplefreq = self._tracker.get_framerate() | |
| float | _intsampletime = 1.0 / self._samplefreq |
| _clockdiff = None | |
| _newestframe = self._tracker.get_frame() | |
| _ssthread = Thread(target=self._stream_samples, args=[self._queue]) | |
| bool | _processing = True |
| bool | _processing_paused = False |
| bool | _logdata = False |
| _currentsample = copy.deepcopy(self._newestframe) | |
| _dpthread = Thread(target=self._process_samples, args=[self._queue]) | |
| bool | _firstlog = False |
class for eye tracking and data collection using an EyeTribe tracker
| pygaze._eyetracker.pytribe.EyeTribe.__init__ | ( | self, | |
| logfilename = 'default', | |||
| host = 'localhost', | |||
| port = 6555 ) |
Initializes an EyeTribe instance
keyword arguments
logfilename -- string indicating the log file name, including
a full path to it's location and an extension
(default = 'default.txt')
|
protected |
Continuously sends heartbeats to the tracker, to let it know the
connection is still alive (it seems to think we could die any
moment now, and is very keen on reassurance of our good health;
almost like my grandparents...)
arguments
heartbeatinterval -- float indicating the heartbeatinterval in
seconds; note that this is different from
the value that the EyeTribe tracker reports:
that value is in milliseconds and should be
recalculated to seconds here!
|
protected |
Logs a header to the data file
|
protected |
Writes a sample to the log file
arguments
sample -- a sample dict, as is returned by
tracker.get_frame
|
protected |
Halts the processing of samples. Make sure to call this when
you calibrate the tracker.
|
protected |
Continuously processes samples, updating the most recent sample
and writing data to a the log file when self._logdata is set to True
arguments
queue -- a multithreading.Queue instance, to read samples
from
|
protected |
Continuously polls the device, and puts all new samples in a
Queue instance
arguments
queue -- a multithreading.Queue instance, to put samples
into
|
protected |
Continues the processing of samples. Make sure to call this when
you are done calibrating the tracker.
| pygaze._eyetracker.pytribe.EyeTribe.close | ( | self | ) |
Stops all data streaming, and closes both the connection to the
tracker and the logfile
| pygaze._eyetracker.pytribe.EyeTribe.log_message | ( | self, | |
| message ) |
Logs a message to the logfile, time locked to the most recent
sample
| pygaze._eyetracker.pytribe.EyeTribe.pupil_size | ( | self | ) |
Returns the most recent pupil size sample (an average of the size
of both pupils)
arguments
None
returns
pupsize -- a float indicating the pupil size (in arbitrary units)
| pygaze._eyetracker.pytribe.EyeTribe.sample | ( | self | ) |
Returns the most recent point of regard (=gaze location on screen)
coordinates (smoothed signal)
arguments
None
returns
gaze -- a (x,y) tuple indicating the point of regard
| pygaze._eyetracker.pytribe.EyeTribe.start_recording | ( | self | ) |
Starts data recording
| pygaze._eyetracker.pytribe.EyeTribe.stop_recording | ( | self | ) |
Stops data recording
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| pygaze._eyetracker.pytribe.EyeTribe.calibration = calibration(self._connection) |