예제 #1
0
    def __init__(self, config_path:str=None, sorters:list=[]) -> None:
        config_path = Path(config_path)
        self._config_files = [config_path / f for f in os.listdir(config_path) if os.path.isfile(config_path / f)]

        assert set(sorters).issubset(set(ss.available_sorters())), """
            Please check the input sorter names and the installed sorters.
        """
        self._sorter_names = sorters
##############################################################################
# Using the :code:`toolkit`, you can perform pre-processing on the recordings. Each pre-processing function also returns
# a :code:`RecordingExtractor`, which makes it easy to build pipelines. Here, we filter the recording and apply common
# median reference (CMR)

recording_f = st.preprocessing.bandpass_filter(recording,
                                               freq_min=300,
                                               freq_max=6000)
recording_cmr = st.preprocessing.common_reference(recording_f,
                                                  reference='median')

##############################################################################
# Now you are ready to spikesort using the :code:`sorters` module!
# Let's first check which sorters are implemented and which are installed

print('Available sorters', ss.available_sorters())
print('Installed sorters', ss.installed_sorter_list)

##############################################################################
# The :code:`ss.installed_sorter_list` will list the sorters installed in the machine. Each spike sorter
# is implemented as a class. We can see we have Klusta and Mountainsort4 installed.
# Spike sorters come with a set of parameters that users can change. The available parameters are dictionaries and
# can be accessed with:

print(ss.get_default_params('mountainsort4'))
print(ss.get_default_params('klusta'))

##############################################################################
# Let's run mountainsort4 and change one of the parameter, the detection_threshold:

sorting_MS4 = ss.run_mountainsort4(recording=recording_cmr, detect_threshold=6)
예제 #3
0
"""

import spikeinterface.extractors as se
import spikeinterface.sorters as ss

##############################################################################
# First, let's create a toy example:

recording, sorting_true = se.example_datasets.toy_example(duration=10, seed=0)

##############################################################################
# Check available sorters
# --------------------------
#

print(ss.available_sorters())

##############################################################################
# This will list the sorters available through SpikeInterface. To see which sorters are installed on the machine
# you can run:

print(ss.installed_sorters())

##############################################################################
# Change sorter parameters
# -----------------------------------
#

default_ms4_params = ss.Mountainsort4Sorter.default_params()
print(default_ms4_params)
def list_sorters():
    """Print a list of spikeinterface sorters."""
    print('Available sorters', ss.available_sorters())
    print('Installed sorters', ss.installed_sorter_list)