open-ephys / plugin-GUI

Software for processing, recording, and visualizing multichannel electrophysiology data
https://open-ephys.org/gui
GNU General Public License v3.0
193 stars 683 forks source link

Improve scatter plots of spikes (SpikeViewer) #404

Open TamirEliav opened 3 years ago

TamirEliav commented 3 years ago

It could be very helpful to use some transparency for the dots plotted in the SpikeViewer scatter plots. Currently, it feels very hard to see nicely isolated clusters in this viewer - it looks like a uniform blob of white dots (that merge with adjacent clusters), instead of a 2D gaussian blob. I think adding transparency will resolve this problem and will enable seeing the gaussian shape of the cluster. Attached is an example (plotted in matlab) that compares using transparency or not. Using transparency you can clearly see the two 2D gaussians, while without the transparency it is much harder to see it. image

jsiegle commented 3 years ago

This is a good suggestion, and pretty easy to implement! We will likely add a transparency option in a future release.

TamirEliav commented 3 years ago

Great! Can you give a quick pointer to where and how to set transparency? We have now an implanted animal that we carry tests using the OpenEphys system, and it would be great to add and test this functionality as long as we have nice clusters.

ANickerson commented 3 years ago

I think this is the line -

https://github.com/open-ephys/plugin-GUI/blob/be5c2e4842a3cc8b4d3e6fa5ca8ac5d0b826df75/Plugins/BasicSpikeDisplay/SpikeDisplayNode/SpikeDisplayCanvas.cpp#L1309

or the one above it.

I made a branch with the change. Untested as I dont have any file to check - https://github.com/open-ephys/plugin-GUI/compare/master...ANickerson:patch-1

jsiegle commented 3 years ago

Yeah, it's actually line 1308...just change it to g.setColour(col.withAlpha(0.2)); (or substitute whatever alpha value looks reasonable).