visbrain icon indicating copy to clipboard operation
visbrain copied to clipboard

PSD in scored sleep data so in SLEEP module

Open movivi opened this issue 5 years ago • 7 comments

Hi! I have been using the SLEEP module of visbrain for quite a while and use it to score my PSG data. It's really nice that it can visualize the power spectrum on the topoplot for different frequency bands. However, I wanted to know how I can calculate PSD for each sleep stage across different frequency bands and be able to export the results in a .csv format for further statistical analyses.

Your help is very much appreciated!

Regards,

Mo

movivi avatar Jan 10 '19 08:01 movivi

GitMate.io thinks a possibly related issue is https://github.com/EtienneCmb/visbrain/issues/35 ([Sleep] Generalize Sleep module to facilitate sleep scoring of non-human EEG/LFP data ).

EtienneCmb avatar Jan 10 '19 08:01 EtienneCmb

Hello @movivi ,

Thanks for your feedback, appreciate. For now, we didn't provide such tools but indeed it would be a nice add-on. I add it on my todo list but to be honnest, both @raphaelvallat and I are running out of time so I can't give you a date. But I'll keep you updated !

EtienneCmb avatar Jan 10 '19 08:01 EtienneCmb

Thank you @EtienneCmb :)

movivi avatar Jan 10 '19 08:01 movivi

Btw I tried using the Signal module to generate the plots for PSD but it cannot load my .EDF files (the same format used to score the sleep stages on the Sleep module). It has array restrictions on the data format. Hence I even cannot open the GUI for Signal module. Is there an alternative way to actually load the sleep data on to the Signal module?

movivi avatar Jan 10 '19 09:01 movivi

It could be possible yes but you'll not have your PSD power per stage. I think the best way would be to include it inside Sleep.

@raphaelvallat do you have suggestions for the integration inside Sleep?

EtienneCmb avatar Jan 10 '19 09:01 EtienneCmb

Hi @movivi and @EtienneCmb!

I also think that adding a "Spectral analysis" module would be a huge plus for Sleep. We could integrate it as a new tab in the quick display panel and then provides the user with several options to define:

  1. the desired epoch (could be either the current epoch or all the epochs of a specific sleep stage)
  2. the frequency bands
  3. the PSD estimation parameters

And then the user would be able to export the results in .csv and plot the PSD using matplotlib-style graphics.

This would require a lot of work in both the GUI and the code, and as @EtienneCmb said earlier we are both very busy at the time. However, in the long term, this is definitely something we can & should add to Sleep.

raphaelvallat avatar Jan 10 '19 19:01 raphaelvallat

No worries! It would be great if @EtienneCmb and @raphaelvallat can include PSD into the sleep module since right now I need to export the hypnogram time codes as events to EEGLAB on MATLAB to analyze my data.

movivi avatar Jan 16 '19 12:01 movivi