cortex-lab / phy

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

Loading Plugin #1173

Open Zoe0793 opened 2 years ago

Zoe0793 commented 2 years ago

Hello, I am working with tetrode data and therefore only want 4 channels to be highlighted at any one time. I have the .py saved in the 'plugins' folder

from phy import IPlugin, connect

class FourColouredChans(IPlugin):
    def attach_to_controller(self, controller):
        controller.model.n_closest_channels = 4

    def attach_to_controller(self, controller):
        print ("FourcolouredChansDetected")

I added a print at the end to check it was finding the plugin okay, and the print appears on the terminal when I open phy, however I still see 16 channels highlighted in every cluster.

I am using Spike Interface and running phy via


folderPhy = r'C:\Users\Analysis\Documents\Code\SpikeInterface95\BySplit\phy_for_sc'

import os
os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--single-process"
os.chdir(folderPhy)
# from phy.utils
# from phy extract-waveforms params.py 

from phy.apps.template import template_gui 
template_gui(".\params.py")

The os.environ here was copied from their tutorial re SI.095.

Can you help with this? Many thanks, Zoe