Filter for Visualization Bug in Compiled Brainstorm

"Notch" runs fine, and no problem with the Matlab version 20-Mar-2023 Matlab version. But the compiled versions have a bug when High-Pass or Low-Pass filtering for visualization.

bst_bin_R2022b_230130
bst_bin_R2020a_230223:

Confirmed on two different Windows 10 machines, two different types of data. When visualizing the data, under the Tab "Filter" (For visualization only), any attempt to run high pass or low pass results in below

For bst_bin_R2022b_230130

SWITCH expression must be a scalar or a character vector.
Error in fir1 (line 80)
Error in bst_bandpass_hfilter (line 183)
Error in process_bandpass>Compute (line 230)
Error in process_bandpass (line 29)
Error in bst_memory>FilterLoadedData (line 1008)
Error in bst_memory>LoadRecordingsMatrix (line 934)
Error in bst_memory>ReloadAllDataSets (line 1029)
Error in bst_memory (line 73)
Error in panel_filter>ApplyFilters (line 257)
Error in panel_filter>CreatePanel/CheckLowPass_Callback (line 114)

Same error for bst_bin_R2020a_230223, slightly different line numbers:

SWITCH expression must be a scalar or a character vector.
Error in fir1 (line 80)
Error in bst_bandpass_hfilter (line 183)
Error in process_bandpass>Compute (line 230)
Error in process_bandpass (line 29)
Error in bst_memory>FilterLoadedData (line 1011)
Error in bst_memory>LoadRecordingsMatrix (line 937)
Error in bst_memory>ReloadAllDataSets (line 1032)
Error in bst_memory (line 73)
Error in panel_filter>ApplyFilters (line 257)
Error in panel_filter>CreatePanel/CheckLowPass_Callback (line 114)
  • John

The replacement functions for missing Signal Processing Toolbox from FieldTrip where added to the compiled package. The fir1 function that is called in your bug reports is not the correct one.
I fixed this by removing explicitly the external/signal functions from the SPM/FieldTrip package added to the compiled Brainstorm distribution: https://github.com/brainstorm-tools/brainstorm3/commit/ff27de63023838465eb7a121e177d4316f4d37cf

I recompiled Brainstorm and the new package available from the Download page should not have this problem anymore.
Can you please confirm?

Hi Francois,

Back from a conference, where I got to meet up again with Christoph Grova. We had nice presentations telling the audience about how well Brainstorm does beamforming, dipole modeling, MEM, and NIRS processing!

But more to your question, yes, the binary version brainstorm_230327_bin, downloaded from the top of the downloads page, worked just fine when filtering the data visually.

Thanks!