Skip to content

TypeErrors in gazeplotter.draw_heatmap #9

@pashultz

Description

@pashultz

Hello! I'm trying to produce a heatmap from an EyeTribe data file. The data seems to load and parse correctly, but gazeplotter.draw_heatmap keeps throwing TypeErrors.

import eyetribereader, gazeplotter, detectors
sub = eyetribereader.read_eyetribe("**********/subject-502.tsv", "start_trial", "stop_trial")
t = sub[15]
fixations = detectors.fixation_detection(t['x'], t['y'], t['time'])
gazeplotter.draw_heatmap(fixations[1], (1280, 1024))

In Python 2.7.13, this results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gazeplotter.py", line 227, in draw_heatmap
    heatmap[y:y+gwh,x:x+gwh] += gaus * fix['dur'][i]
TypeError: slice indices must be integers or None or have an __index__ method

And in Python 3.6.0, it gives:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "************/PyGazeAnalyser/pygazeanalyser/gazeplotter.py", line 199, in draw_heatmap
    heatmap = numpy.zeros(heatmapsize, dtype=float)
TypeError: 'float' object cannot be interpreted as an integer

Can you tell what I'm doing wrong? I'm on Arch Linux, with matplotlib 2.0.0 and numpy 1.12.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions