Some time ago I posted the following discussion regarding the extraction of manually identified sleep spindles for further analysis. Down this discussion, @Raymundo.Cassani gave me a good idea to "would be read the data from each of the imported spindle instances (trials), and compute the features for each one of the instances."
I made a custom process for sleep researchers out there interested in sleep spindles to calculate sleep duration, frequency, amplitude and symmetry. Hope it becomes useful. @Raymundo.Cassani if you wish to add this process to GitHub my user name is mcp0228 .
Sampling frequency is hardcoded, that would difficult the use for other users.
It can be read from the data
Used channels, it seems the spindle identification run channels that are not EEG (e.g., EOG, EMG and the status). It is possible to add a channel selection parameter in the options so the user can select the set of channels to be used.
Thanks for your ideas, Raymundo!
Please find the updated process where I've made the following amendments:
Sampling frequency is no longer hardcoded but calculated by the number of time samples-1 divided by the duration
Counting the number of zeros and sign changes for calculation of frequency has been removed.
This is now replaced by counting the number of spindle peaks.
I've decided not to add a channel selection parameter in the options because spindles are by definition an EEG phenomenon therefore it wouldn't make sense for a user to select EOG or EMG for this process. process_sleepspindle_parameters.m (12.4 KB)
Hello @chanakyareddy thank you for your question
Firstly, the custom-process that I wrote is for analysing already identified and extracted individual/discrete spindles so the process of manually extracting sleep spindles is independent of the process.
Now, onto your question, it's not naive at all, no worries.
The reasons for manual extraction is as follows:
It is well known from articles like Warby et al. (2014) and its related papers that automatic detection of spindles, while useful, is actually not as great as people assume. Therefore automatic detection algorithms are usually used in conjunction with visual re-checking of the spindles identified by the algorithms - i.e. a semi-automatic process. Therefore at this stage our group decided to just manually identify the discrete spindles if we eventually have to recheck the spindles identified by the algorithms.
There is a plan in place to implement an automatic detection algorithm eventually but that is in due course. Due to where we are at in our data preprocessing and analysis we decided to manually identify the spindles first and compare its results to the (eventual) automatic detection algorithm - therefore think of the current methods as stage 1 in our spindle analysis pipeline.
One of the main issues with visual identification of spindles is the large quantity of time spent in visual identification. Fortunately, our sleep research is a nap study meaning the quantity of data to visually identify the spindles is not much compared to overnight noctural studies.
One of the other main issues with visual identification of spindles is the aspect of subjectivity, which is the case with sleep staging as well. Therefore we decided to cross-check the visually identified spindles in the time domain (which is the gold standard for identifying spindles) with spindles in the time-frequency domain. This allowed our team to check the spindles we've identified subjectively in the time domain from a different perspective. While the element of subjectivity would still be present, by implementing this method, we can reduce the degree of subjectivity. If you wish to know more about this check my other forum post down below.