Git Product home page Git Product logo

Comments (13)

marius10p avatar marius10p commented on August 22, 2024

I think the channel number is decided by Phy, which takes them consecutively from the channel map of connected channels. When KS2 sets a channel as bad, it just sets connected to 0.

@rossant, do you think Phy could show the original channel number?

from kilosort.

Sepidak avatar Sepidak commented on August 22, 2024

Thank you for your quick reply Marius. Yes, that makes sense. Channel depths are shown correctly though, so should be possible to include the correct channel numbers in Phy too.

from kilosort.

rossant avatar rossant commented on August 22, 2024

I think phy already shows the channel numbers that appear in channel_map.npy

from kilosort.

marius10p avatar marius10p commented on August 22, 2024

I don't think so, I just looked.

from kilosort.

nsteinme avatar nsteinme commented on August 22, 2024

channel_map refers to the rows of the data file, and this doesn't necessarily correspond to anything the user cares about. Perhaps we should make this more clear by introducing a "channel_numbers.npy" or "channel_names.npy"? The labels in phy would be taken from this new file, though the channel_map would still be used as it currently is to read the file.

from kilosort.

rossant avatar rossant commented on August 22, 2024

are you saying that the requested information is currently not saved anywhere?

from kilosort.

marius10p avatar marius10p commented on August 22, 2024

but the GUI doesn't actually show the channel map numbers from channel_map.npy.

from kilosort.

rossant avatar rossant commented on August 22, 2024

Right, the raw data file is swapped according to channel_map, and the displayed channels are just 0..nchannels-1. If you want different channel labels you need another channel_names.tsv (could be names also, I guess?)

from kilosort.

marius10p avatar marius10p commented on August 22, 2024

Ok, I can output that from Kilosort2. How is the tsv file formatted? I tried a few things that gave an error:

phy template-gui params.py
14:43:38 [E] cli:36 An error has occurred (ValueError): axes don't match array

from kilosort.

rossant avatar rossant commented on August 22, 2024

I think this should work (where \t is a tab character)

cluster_id\tchannel_name
0\tmychannelname
...

but the logic to display this is not yet implemented in phy

from kilosort.

marius10p avatar marius10p commented on August 22, 2024

Thanks Cyrille. I think the defaults for channel number should be the ones from the channel map file, because those are the actual, original channels in the data file.

If you don't think it should be that way, I can open an issue in Phy to add arbitrary user-defined labels, and then output the correct channel numbers from Kilosort itself.

from kilosort.

rossant avatar rossant commented on August 22, 2024

Thanks Cyrille. I think the defaults for channel number should be the ones from the channel map file, because those are the actual, original channels in the data file.

sounds good!

from kilosort.

xy103 avatar xy103 commented on August 22, 2024

Hi I was seeing this exact issue on my data, where the best channel based on template and raw waveforms don't match up. For context, I'm running kilosort 2.5 wrapped through ecephys pipeline, and visualizing results in phy2. This error occurs especially obviously in sessions some noisy channels were extracted before running kilosort.

I've tracked down the issue to channel_map.npy too. Currently this channel map saves chanMap0ind = int32([1:rez.ops.Nchan]-1); regardless of channel connectivity situation in rezToPhy.m. And immediately before this line chanMap0ind = int32(chanMap0ind); was commented out. I saw that if I rewrite channel_map.npy with results from chanMap0ind = int32(chanMap0ind); I get the correct channel mappings displayed in phy. @marius10p Was there any particular reason that chanMap0ind = int32(chanMap0ind); was commented out in the first place?

from kilosort.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.