@@ -105,6 +105,10 @@ def _qt_make_layout(self):
105105 self .shortcut_mua = None
106106 self .shortcut_noise = None
107107 if self .controller .has_default_quality_labels :
108+ self .shortcut_clear = QT .QShortcut (self .qt_widget )
109+ self .shortcut_clear .setKey (QT .QKeySequence ('c' ))
110+ self .shortcut_clear .activated .connect (lambda : self ._qt_set_default_label (None ))
111+
108112 self .shortcut_good = QT .QShortcut (self .qt_widget )
109113 self .shortcut_good .setKey (QT .QKeySequence ('g' ))
110114 self .shortcut_good .activated .connect (lambda : self ._qt_set_default_label ('good' ))
@@ -212,7 +216,7 @@ def _qt_full_table_refresh(self):
212216 self .table .clear ()
213217
214218
215- internal_column_names = ['unit_id' , 'visible' , 'channel_id' , 'sparsity' ]
219+ internal_column_names = ['unit_id' , 'visible' , 'channel_id' ]
216220
217221 # internal labels
218222 column_labels = list (internal_column_names )
@@ -272,11 +276,6 @@ def _qt_full_table_refresh(self):
272276 item = CustomItem (f'{ channel_id } ' )
273277 item .setFlags (QT .Qt .ItemIsEnabled | QT .Qt .ItemIsSelectable )
274278 self .table .setItem (i , 2 , item )
275-
276- num_chan = np .sum (self .controller .get_sparsity_mask ()[i , :])
277- item = CustomItem (f'{ num_chan } ' )
278- item .setFlags (QT .Qt .ItemIsEnabled | QT .Qt .ItemIsSelectable )
279- self .table .setItem (i , 3 , item )
280279
281280 n_first = len (internal_column_names )
282281 self .label_columns = list (range (n_first , n_first + num_labels ))
@@ -476,20 +475,15 @@ def _panel_make_layout(self):
476475 if label == "quality" :
477476 frozen_columns .append (label )
478477 data ["channel_id" ] = []
479- data ["sparsity" ] = []
480478
481479 self .main_cols = list (data .keys ())
482- sparsity_mask = self .controller .get_sparsity_mask ()
483480 for unit_index , unit_id in enumerate (unit_ids ):
484481 data ["unit_id" ].append (
485482 {"id" : str (unit_id ), "color" : mcolors .to_hex (self .controller .get_unit_color (unit_id ))}
486483 )
487484 data ["channel_id" ].append (
488485 self .controller .channel_ids [self .controller .get_extremum_channel (unit_id )]
489486 )
490- data ["sparsity" ].append (
491- np .sum (sparsity_mask [unit_index , :])
492- )
493487 for col in self .controller .displayed_unit_properties :
494488 data [col ] = self .controller .units_table [col ]
495489
@@ -563,6 +557,7 @@ def _panel_make_layout(self):
563557 if self .controller .has_default_quality_labels :
564558 shortcuts .extend (
565559 [
560+ KeyboardShortcut (name = "clear" , key = "c" , ctrlKey = False ),
566561 KeyboardShortcut (name = "good" , key = "g" , ctrlKey = False ),
567562 KeyboardShortcut (name = "mua" , key = "m" , ctrlKey = False ),
568563 KeyboardShortcut (name = "noise" , key = "n" , ctrlKey = False ),
@@ -772,6 +767,12 @@ def _panel_handle_shortcut(self, event):
772767 self .controller .set_visible_unit_ids (selected_unit_ids )
773768 self .notify_unit_visibility_changed ()
774769 self .refresh ()
770+ elif event .data == "clear" :
771+ for unit_id in selected_unit_ids :
772+ self .controller .set_label_to_unit (unit_id , "quality" , None )
773+ self .table .value .loc [selected_unit_ids , "quality" ] = ""
774+ self .notify_manual_curation_updated ()
775+ self .refresh ()
775776 elif event .data == "good" :
776777 for unit_id in selected_unit_ids :
777778 self .controller .set_label_to_unit (unit_id , "quality" , "good" )
@@ -805,6 +806,7 @@ def _panel_handle_shortcut(self, event):
805806* **ctrl + arrow up/down** : select next/previous unit and make it visible alone
806807* **press 'ctrl+d'** : delete selected units (if curation=True)
807808* **press 'ctrl+m'** : merge selected units (if curation=True)
809+ * **press 'c'** : clear label of selected units (if curation=True)
808810* **press 'g'** : label selected units as good (if curation=True)
809811* **press 'm'** : label selected units as mua (if curation=True)
810812* **press 'n'** : label selected units as noise (if curation=True)
0 commit comments