ibl_alignment_gui.plugins.allen.custom_filters
Functions
Register custom unit filters. |
|
Keep the units that pass the AIND default QC. |
|
Keep the units UnitRefine considered neural, i.e. everything but noise. |
|
Keep only the units UnitRefine labelled as single-unit activity. |
|
Show how to add custom unit filters to the GUI. |
- ibl_alignment_gui.plugins.allen.custom_filters.add_filters(controller)[source]
Register custom unit filters.
Each entry maps a filter name (shown in the dropdown) to a predicate. The predicate receives the clusters
metricstable (a pandas DataFrame, one row per cluster) and returns a boolean mask selecting the clusters to keep. If a metric is missing or the predicate raises, the GUI falls back to showing all units (seePlotLoader.filter_units()).Add your own filters by extending the dictionary below.
- Parameters:
_ (AlignmentGUIController) – The main application controller (unused).
- Return type:
None
- ibl_alignment_gui.plugins.allen.custom_filters.filter_aind_qc(metrics)[source]
Keep the units that pass the AIND default QC.
- Parameters:
metrics (pd.DataFrame) – The per-cluster metrics table.
- Returns:
Boolean mask of the units that pass
default_qc.- Return type:
np.ndarray
- ibl_alignment_gui.plugins.allen.custom_filters.filter_unit_refine_neural(metrics)[source]
Keep the units UnitRefine considered neural, i.e. everything but noise.
- Parameters:
metrics (pd.DataFrame) – The per-cluster metrics table.
- Returns:
Boolean mask of the units whose
unitrefine_labelis not ‘noise’.- Return type:
np.ndarray
- ibl_alignment_gui.plugins.allen.custom_filters.filter_unit_refine_sua(metrics)[source]
Keep only the units UnitRefine labelled as single-unit activity.
- Parameters:
metrics (pd.DataFrame) – The per-cluster metrics table.
- Returns:
Boolean mask of the units whose
unitrefine_labelis ‘sua’.- Return type:
np.ndarray
- ibl_alignment_gui.plugins.allen.custom_filters.setup(controller)[source]
Show how to add custom unit filters to the GUI.
The filters registered here appear as extra options in the ‘Filter units’ dropdown menu, alongside the built-in ‘All’, ‘KS good’, ‘KS mua’ and ‘IBL good’ filters. Selecting one keeps only the clusters (and their spikes) for which the filter’s predicate is True.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
- Return type:
None