Cannot run spike sorting ephys tutorials

Hello, I am trying Brainstorm's ephys functions. I went through this tutorial to import an example plexon file ytu288c-01.plx

I can view the traces just fine (though unless I am missing something, it is impossible to view the spike times - they are all crowded into a tiny box at the bottom).

When I try to do the spike sorting tutorial, I installed WaveClus using Brainstorm, clicked the Run bottom in the bottom left to open the Pipeline Editor, moused over Electrophysiology, and all of the options are grayed out.

The same happens when I try to load an NWB file I have.

When I try to click Unsupervised Spike Sorting > WaveClus anyway, I get a prompt with options but also a red Error message, which if I click says "Error: Data type mismatch. Invalid inputs for process "WaveClus""

How do I get spike sorting to work in Brainstorm? Thanks!

Actually I figured it out. I missed a critical step in the tutorial "users have to drag and drop the links to the raw files into the Files to process box, press RUN, and navigate to the Electrophysiology toolbox". Sorry about the noise!

New error! I can run WaveClus on the example plx file but double clicking "WaveClus Spike Sorting" in the left pane results in the error:

** Error: Line 307: Array indices must be positive integers or logical values.
** Call stack:
** >panel_spikes.m>OpenFigure at 307
** >panel_spikes.m>OpenSpikeFile at 292
** >panel_spikes.m at 27
** >tree_callbacks.m at 309
** >bst_call.m at 28
** >panel_protocols.m>CreatePanel/protocolTreeClicked_Callback at 125
** >bst_call.m at 28
** >panel_protocols.m>@(h,ev)bst_call(@protocolTreeClicked_Callback,h,ev) at 75

Running WaveClus on an NWB file with raw ephys data results in this error:

** Error: [process_spikesorting_waveclus]  Electrophysiology > Unsupervised Spike Sorting > WaveClus
** Line 126: Dot indexing is not supported for variables of this type.
** Call stack:
** >in_fread_nwb.m at 126
** >in_fread.m at 234
** >out_demultiplex.m at 86
** >process_spikesorting_waveclus.m>Run at 137
** >process_spikesorting_waveclus.m at 33
** >bst_process.m>Run at 203
** >bst_process.m at 38
** >panel_process1.m>RunProcess at 138
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 777
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 298
** File: Subject03/@rawsub-MEAREC-250neuron-Neuropixels_ses-20200727T094620_ecephys/data_0raw_sub-MEAREC-250neuron-Neuropixels_ses-20200727T094620_ecephys.mat

The file is sub-MEAREC-250neuron-Neuropixels_ses-20200727T094620_ecephys.nwb (29.5 GB) from

It seems there was an error during the WaveClus execution.
Did you get any message in Matlab's Command Window?

I got the same message as the popup error. Here's a 1 min screen recording:

It looks like the issue might be with the NWB file reading and not the spike sorting. This is surprising because this file is a barebones NWB file with raw ecephys data. The only data it has are:

  • ElectricalSeries with raw data
  • Device
  • ElectrodeGroup
  • DynamicTable with electrodes
  • Subject

I work with the matnwb developers and can help resolve the issue, but I do not know anything about brainstorm internals to diagnose the issue further.

Reading NWB files is carried on with the scripts in_fopen_nwb.m and in_fread_nwb.m
Both of them rely on MatNWB

Can you provide us an short example of a problematic NWB file?