SpikeSort
SpikeSort copied to clipboard
plotting spikes takes very long
plotting large number of spikes >10000 by PlotSpikes component takes a couple of seconds and significantly affects spike sorting experience
The problem was investigated and it turns out that it lies in the c library used by matplotlib for plotting: AGG that applies antialiasing and complex path rendering (like bezier curves). We plan to use an alternative plotting package optimised for plotting large dataset.
Benchmark of popular graphical libraries
I performed tests of different plotting frameworks: matplotlib, pygames (based on sdl), opengl (using pyopengl bindings), python image library and html5 canvas. The task was to plot 50000 lines, 34 points long each (for some benchmarks points were uniformly distributed, while for others they were sines, which is not completely fair). Link to files: https://gist.github.com/1716954
- test_mpl - matplotlib (TkAgg): 13 s (total)
- test_canvas.html (Chrome): 7 s
- test_pygames: 3.8 s
- test_pil - python image library: 1 s (total)
- test_opengl: 0.7 s
I've created an "opengl_plotting" branch
Have you thought about using glumpy?
@cpcloud yeah, that's what we're planning to use. The problem, however, is that most of the glumpy's functionality is dedicated for plotting large 2D data arrays, whereas we are interested in plotting lines. So the only feature we need from glumpy is it's ability to create nice forms with subplots using GLUT. So here's a tradeoff:
glumpy:
- no mess with low-level GLUT stuff
- redundant features
- another dependency
- the project is not on the github and it's hard to contribute (afaik)
pure PyOpenGL:
- only one (pretty common) dependency
- requires effort to write the UI with subplots and events
So I was thinking that we probably could just take what we need from glumpy and incorporate that in SpikeSort. I'm not sure about the licensing stuff though...
Any other ideas?