Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use your toolbox with my .edf documents? #57

Open
JJL2018 opened this issue Aug 22, 2018 · 2 comments
Open

Can I use your toolbox with my .edf documents? #57

JJL2018 opened this issue Aug 22, 2018 · 2 comments

Comments

@JJL2018
Copy link

JJL2018 commented Aug 22, 2018

I want to use your toolbox to detect spindles automatically. Now I have some EEG documents (.edf). Can I use your toolbox to do that? How can I transmit the edf document to MATLAB, then do the analysis?

@Mensen
Copy link
Owner

Mensen commented Aug 23, 2018

If you have the EEGLAB toolbox in your path, you can use their function to import the EDF file...

For example:

[filename, filepath] = uigetfile('*.edf', 'Choose an edf data file -- pop_biosig()');
EEG = pop_biosig(fullfile(filepath, filename));

Once its in the EEGLAB format (two files .set / .fdt), you can load these into the swa toolbox directly and detect spindles... just follow the steps in the template file in the "SS" folder (swa_SS_template.m)

However, you didn't mention whether these EDF files has been preprocessed already. Do they only contain data from sleep stages NREM 2 and/or 3? Bad channels and time points identified? Rereferenced to either average or linked mastoids? This should all be done before trying to detect spindles (but you can of course run the scripts anyway and see what happens).

But essentially the steps would be:

[Data, Info] = swa_convertFromEEGLAB();

% or if you have previously analysed some data
[Data, Info, SS] = swa_load_previous();

% Spindle Detection %
% ----------------- %
% get the default settings for spindle detection
Info = swa_getInfoDefaults(Info, 'SS');

% calculate the canonical / reference / prototypical / representative / model / illustrative wave
[Data.SSRef, Info]  = swa_CalculateReference(Data.Raw, Info);
    
% find the spindles in the reference
[Data, Info, SS] = swa_FindSSRef(Data, Info);

% find the waves in all channels
[Data, Info, SS] = swa_FindSSChannels(Data, Info, SS);

% save the data
swa_saveOutput(Data, Info, SS, [], 1, 0)

Good luck with your analysis!

@JJL2018
Copy link
Author

JJL2018 commented Aug 28, 2018

Thank you very much! Now I can use your toolbox to detect sleep spindles.
Could you please tell me exactly what method you used to detect the spindles? What are your specific detect steps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants