buzsakilab / buzcode

Code for internal lab sharing - polishing has started but is by no means complete
http://www.buzsakilab.com/
GNU General Public License v3.0
119 stars 127 forks source link

Extraction of NREM ripples in bz_findRipple #408

Open Baiguo0016 opened 3 years ago

Baiguo0016 commented 3 years ago

Hi, developer, when I was doing SWR detection by bz_findRipple.m I found that there is no extraction of the NREM state from the whole signal and instead the detection is run on the whole signal regardless of sleep state. Is this correct? Should one detect ripples on the whole signal and then take only those from the NREM states? Or should one first extract NREM bouts and run the detection on the NREM bouts? I notice there is a .mat file in your example which provided the notation of states which animals are in. I also see in the database that ripples are saved as ALL and as NREM. May I ask what is your script which extracts sleep stages from the recording and groups ripples into NREM only? Thanks in advance!

brendonw1 commented 3 years ago

Thanks for trying it out! To detect states, including NREM, you can run SleepScoreMaster.m. After that is complete, you can visualize and manually edit thresholds (press a key) and specific epochs by running TheStateEditor.m