TarekLaj / SPINKY

Other
7 stars 6 forks source link

Index Error #1

Open arojas3552 opened 3 years ago

arojas3552 commented 3 years ago

Hi! I was recently going through the tutorial with the test data for setting up Spinky. When running auto detection, computing thresholds and run detection, an error pops up on Matlab. I will attach it down below. Is there anything that can be done about this?

Thank you!

Capture

jtlechem commented 2 years ago

I'm having this same error. I get the same error with the test data and with my own data (which I made to be the same format as the test data, a single row of eeg data). If I choose "Enter thresholds and run detection" it will run for a couple minutes then throw this error. If I choose "Compute thresholds and run detection" it will throw this error immediately. Any help?

isaaczhao23 commented 7 months ago

SOLUTION FOUND

This may be due to Matlab's Signal Processing Toolbox cwt function (or another function) changing syntax around the time Spinky was published (Mar 2017). cwt function history of changes

Screenshot 2024-04-01 at 11 39 31 AM

When Spinky was demonstrated, they used Matlab 2015a as seen from running on Jupyter Notebook. I received the same error as above using different Matlab versions 2018, 2022, 2024. My 2019 MacBook Pro Sonoma 14.4 version was unable to run any previous Matlab versions before 2018, but I used the Mac Bootcamp to install a Windows 10 partition. Switching to Windows 10 running on my Mac, I was able to install Matlab 2016a and successfully run spindle detection.

Steps:

  1. When installing Matlab < 2016a, it will ask which toolboxes you want to also download. Uncheck all, and only select Matlab, Signal Processing Toolbox, and Wavelet Toolbox.
  2. Once you open Matlab, click set path -> add with subfolders -> select the downloaded spinky-master GitHub folder.
  3. when running command "spinky" in the Matlab command interface and selecting automated detection, select the testing Matlab dataset in the stinky-master Github folder, 1000 Hz, 30 sec windows, 151 spindle threshold. It takes like half an hour to run.

Note:

I encountered errors if the threshold chosen is too small such as values of 10, 20, etc. I also encountered errors if the sleep spindle was partially clipped on the far left or right of my entire epoch.