Kilosort icon indicating copy to clipboard operation
Kilosort copied to clipboard

any news on when feature view will be back ?

Open jrnvndtslr opened this issue 3 years ago • 28 comments

I've noticed that KS3 outperforms older versions, but I'm having trouble doing the manual curation in Phy without the feature view (see issue #317).

Any news on when this functionality will be back? Or possibly a temporary workaround?

Thanks for the great program!

jrnvndtslr avatar Jul 23 '21 08:07 jrnvndtslr

@jrnvndtslr, #317 & Phy issue 1071,

Feature view is functional on KS25, a rewritten version based on Kilosort 2.5

czuba avatar Aug 17 '21 15:08 czuba

I'd like to also add the interest in an update on this. Yes, the feature view is functional in KS2.5, but for those of us who like the performance of KS3 and would like to use that for spike-sorting any idea of a potential timeline for the enabling of the remaining phy functionalities would help. When comparing KS2.5 with 3 I get better sorting results on my data, which is why going back to KS2.5 is something I would like to avoid. Your work is simply too good.

Idavr avatar Sep 10 '21 08:09 Idavr

Hi, is there any update on this issue? It would be very helpful to have the feature view for data sorted with kilosort3. Especially for splitting/merging units is essential. Any plans for adding it in the future?

mdiamantaki avatar Dec 10 '21 09:12 mdiamantaki

Hi, I am liking version 3 but I am having the same problem with FeatureView not opening. Thanks, Stephen

cowenowner avatar Dec 29 '21 19:12 cowenowner

It does seem to boil down to the rez.cProj and rez.cProjPC being empty. I think that the workaround is to generate the waveforms in phy. I did this and the FeatureView appeared. Do this through > phy extract-waveforms params.py

cowenowner avatar Dec 29 '21 23:12 cowenowner

Thank you so much @cowenowner , this workaround worked perfectly for me!

Idavr avatar Jan 03 '22 11:01 Idavr

Thank you very much @cowenowner.

FelixAntonSchneider avatar Feb 04 '22 11:02 FelixAntonSchneider

@cowenowner I ran the command but it is not showing the feature view. Do I need to do it prior to running kilosort or after?

benefron avatar Feb 10 '22 09:02 benefron

@benefron For me it only worked after resetting the gui state (--clear-state flag). Also, it didn't work if I ran it on a dataset that was sorted in Phy previously unless deleting the .phy folder and recovering the files from kilosort that get overwritten by phy (spike_clusters.npy etc.). Laurenz

LaurenzMuessig avatar Feb 10 '22 10:02 LaurenzMuessig

Still not giving me the feature view and the feature template view

benefron avatar Feb 10 '22 10:02 benefron

You can try and delete the .json file in C:\Users\Laurenz\.phy\TemplateGUI. Also when you run it, does it generate 3 npy files named _phy_...

LaurenzMuessig avatar Feb 10 '22 11:02 LaurenzMuessig

Nope it generates 2 files: spikes.waveformsChannels.npy spikes.waveforms.npy

benefron avatar Feb 10 '22 11:02 benefron

I get the same as @benefron. Same npy files and no feature/feature template view.

If I may ask, what files does it generate for you @LaurenzMuessig? I also tried deleting the .json file and using the --clear-state flag, the result was the same.

Any help is more than welcome!

mdiamantaki avatar Feb 10 '22 13:02 mdiamantaki

@cowenowner I ran the command but it is not showing the feature view. Do I need to do it prior to running kilosort or after?

Huh. I don't know. I just ran >phy extract-waveforms params.py after running kilosort and before running Phy. Maybe the waveform files are somehow going to a different directory?

cowenowner avatar Feb 10 '22 13:02 cowenowner

It generates 3 files for me: _phy_spikes_subset.channels.npy _phy_spikes_subset.spikes.npy _phy_spikes_subset.waveforms.npy

Otherwise I am doing the same as @coweowner. It only didn't work for me the first time, but either using the --clear-state flag or deleting the .json file solved this for me

LaurenzMuessig avatar Feb 10 '22 13:02 LaurenzMuessig

@cowenowner what npy files do you get?

when I run the phy extract-waveforms params.py (after Kilosort and before phy) I get this message in the terminal: model:1113 Extract waveforms to spikes.waveforms.npy and spikes.waveformsChannels.npy...

mdiamantaki avatar Feb 10 '22 13:02 mdiamantaki

Enter Path to Data: Z:\current_curation\r1010_20211007T033349 12:29:51.994 [W] model:591 Unreferenced clusters found in templates (generally not a problem) 12:29:53.045 [W] model:613 Unreferenced clusters found in spike_clusters (generally not a problem) 12:29:53.621 [W] model:655 Skipping spike waveforms that do not exist, they will be extracted on the fly from the raw data as needed. Extracting waveforms: 100%|██████████████████████████████████████████████████| 6192.64/6192.64 [01:15<00:00, 81.85it/s] 12:31:18.192 [W] model:591 Unreferenced clusters found in templates (generally not a problem) 12:31:19.227 [W] model:613 Unreferenced clusters found in spike_clusters (generally not a problem)

LaurenzMuessig avatar Feb 10 '22 13:02 LaurenzMuessig

this is my terminal output

LaurenzMuessig avatar Feb 10 '22 13:02 LaurenzMuessig

maybe it is different depending on the operating system? I use Linux. I will try to run it in a Windows pc and see what I get. thanks @LaurenzMuessig

mdiamantaki avatar Feb 10 '22 13:02 mdiamantaki

I am also using linux

benefron avatar Feb 10 '22 14:02 benefron

FYI - I use Windows10

cowenowner avatar Feb 10 '22 14:02 cowenowner

@benefron, for me the feature view did not automatically show after running the waveform extraction, I had to go to view, add feature view. Apologies if this is obvious but thought it was worth to mention just in case.

Zoe0793 avatar Apr 14 '22 20:04 Zoe0793

Thanks for sharing this great workaround. I was finally able to get the feature view back for KS3. I however noticed that when I split a cluster using the K command after drawing a polygon in the feature view, the coloring in the different view windows doesn't agree (it's somehow inverse). The cluster that I select, which should be blue and have the most datapoints, appears as highlighted in red in all other views. Also, the WaveformView for the splitted cluster with the more datapoints then shows only a few spike waveforms as if some files are not correctly updated. Any ideas what happens before_splitting after_splitting ?

metmic avatar Apr 21 '22 17:04 metmic

Just to confirm, I also have the same problem as described by @metmic above regarding the workaround so be wary of any manually defined cluster boundaries and clusters in Phy if using the 'extract-waveforms' workaround. I will probably avoid cutting in FeatureView as a result. As another work-around, I will likely write a post-kilosort matlab function that will allow users to do a final convex-hull clean-up of the clusters previously identified and merged in Phy.

cowenowner avatar Jul 07 '22 17:07 cowenowner

Thanks for your advice, I have been trying to get this working for a while! @cowenowner I would be really interested in using the post-processing script you mentioned when you get it finished if you do not mind sharing it.

GrimmSnark avatar Aug 25 '22 08:08 GrimmSnark

Hi, I have reached the same problem! @cowenowner @metmic Did you find a way to fix it?

farazmoradi avatar Sep 22 '22 19:09 farazmoradi

@farazmoradi Sadly, no progress on my end.

cowenowner avatar Sep 22 '22 22:09 cowenowner

@marius10p Could you please let us know when this feature will be added to KS3?

farazmoradi avatar Sep 23 '22 03:09 farazmoradi

The workaround only works for FeatureView and not TemplateFeatureView. Is there another recommended workaround for the latter?

Datamance avatar Mar 28 '23 17:03 Datamance

Agree with all of the above (especially the issues using 'K' in FeatureView) - makes phy2 much less useful. Has anyone made progress - or should I revert back to phy1 ?

kipkeller avatar Aug 21 '23 18:08 kipkeller