cortex-lab / phy

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

Set cluster views from URL of local file #1167

Closed szapp closed 1 year ago

szapp commented 2 years ago

This PR addresses and may resolve #1143, resolve #1151, resolve #1156, resolve #1159, and resolve #1165.

As @FranciscoNaveros and others have observed, the issue of blank cluster views occurs when the number of clusters or columns exceeds a certain limit. This seems to be due to the method setHtml of QWebEnginePage having a size limit of 2 MB for the HTML code to load.

The proposed fix here simply stores the HTML code to a temporary file and uses the method setUrl instead. The temporary files are cleared appropriately (when new HTML is set and when phy closes with _save_gui_state).

This works reliably and solves the issue on a branch of an older version of phy I tested it on. I would appreciate if someone could confirm this on the latest version of phy before a merge is considered. There might also be a more elegant way to implement the temporary file handling.

blinklab commented 1 year ago

I have tested this solution with different large files that I could not open before and now they work perfectly.

Francisco Naveros.

elladulko commented 1 year ago

Strangely we have one user where this fix appears to have worked but with an older user account CLusterView window and SimilarityView window are white despite both users using the same dataset in the same location (i.e., there is one dataset and not a copy of the dataset for the different users).

Antorithms commented 1 year ago

In our case this does not solve the issue. We experience blank CLusterView that is "solved" by removing the metrics csv from the folder (while losing some unit information, e.g. ISI violations). How should we go about solving this ? Thanks a lot!