cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
314 stars 157 forks source link

Make TraceView use vertical spatial channel order #717

Closed mspacek closed 7 years ago

mspacek commented 7 years ago

Unless I'm doing something wrong with my custom .prb file, it seems that the TraceView channels are sorted in numerical order. It would be much better to sort them in vertical spatial order, so that spikes show up as spatially localized events. Depending on the channel mapping, the waveforms of a multichannel spike can end up scattered across the probe. Vertical spatial order would also make the TraceView more directly comparable to the WaveformView.

rossant commented 7 years ago

I think it could be a good idea. @nsteinme @yger ?

nsteinme commented 7 years ago

I definitely think it's best to sort them in vertical spatial order - as @mspacek says, that makes it comparable to the waveform view, and matches your logical conception of the relationship between channels. I thought that's how it already was! Mine come out that way - but for my recent recordings, the two are identical so I guess I just didn't notice it was doing something different.

yger commented 7 years ago

Indeed, I also think this has to be the case. It would be easier to read for vertical probes layout. For square MEA/probes, this will still be annoying, but I do not think there is much you can do about that.

mspacek commented 7 years ago

Thanks Cyrille, but from what I can tell, the TraceView is not in vertical spatial order. Here's a screenshot:

screenshot - 16-10-27 - 04 17 22 pm

The channel labels in the TraceView don't match vertically with those in the WaveformView. Also, each spike in the TraceView is scattered across the probe, instead of being spatially localized. Here are my crresponding .prm and .prb files:

prm_prb_files.zip

rossant commented 7 years ago

could you send me the full dataset?

mspacek commented 7 years ago

Sure. Here's a 10 sec excerpt of data from a single column A1x32 NeuroNexus probe. All the relevant files should be there. Let me know once you've downloaded it, so I can delete it from this file sharing site:

https://mega.nz/#!tRtD1LTS!mG6cGNiKv-m-P9yAK4o6frNgUDJWFKWWuB6WMlYkdik

rossant commented 7 years ago

Thanks. Downloaded, I'll have a look.

rossant commented 7 years ago

OK I pushed a fix on master, can you try again?

micheleacox commented 7 years ago

For clarification, to pull fixes from the master, do we use:

pip install phy phycontrib --upgrade

rossant commented 7 years ago

No, this will upgrade to the latest release. Use the following command to upgrade to the development version on master:

pip install git+https://github.com/kwikteam/phy.git git+https://github.com/kwikteam/phycontrib.git --upgrade
mspacek commented 7 years ago

Yup, that did it. Thanks! Ha, having to argsort an argsort sounds familiar.