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

SS toolbox #50

Open
AnnaCastelnovo opened this issue Feb 5, 2017 · 8 comments
Open

SS toolbox #50

AnnaCastelnovo opened this issue Feb 5, 2017 · 8 comments

Comments

@AnnaCastelnovo
Copy link

Hey Armand,

I ran you SS_template for sleep spindles, and I wanted to visualize results as for slow waves. Which script do I have to use? I found one specific for theta waves (swa_ST_explorer), but not a swa_SS_explorer.

Anna

@Mensen
Copy link
Owner

Mensen commented Feb 6, 2017

Hey Anna!

You should be able to load the results file into swa_Explorer... the same as with slow waves (and also saw-tooth actually so I should remove the ST_explorer specifically).

Let me know if there are any errors loading the spindles into the explorer but I use it all the time so it should be fine.

@Mensen Mensen closed this as completed Feb 6, 2017
@AnnaCastelnovo
Copy link
Author

AnnaCastelnovo commented Feb 7, 2017 via email

@Mensen
Copy link
Owner

Mensen commented Feb 7, 2017

Hmmm... that's odd. Could you post the error you received in Matlab and then we can fix it together.

@Mensen Mensen reopened this Feb 7, 2017
@AnnaCastelnovo
Copy link
Author

Hey Armand, it was very likely my bad and/or just the matlab version bc now it's working fine! :)

I'd like to keep the info for cycles, stages and possibly bad epochs (e.g. for each spindles the stage and cycle where its peak was).
I can also retail segments (like first cycle N2) and than run your toolbox instead, but it seems much more convenient to work the other way round, i.e. extract cycle stage and bad epoch info and pick only waves I need (it's better in terms of space, time and also quality of data - to avoid bumps when filtering data created by segmentation of data).
Which is the best way you suggest to proceed to make this implementation?

See you at the Benesco meeting if you re going there!

@AnnaCastelnovo
Copy link
Author

Hi Armand,

I think I succeeded in doing this basic implementation. I added the cycle, stage and arousal info as fields in Data and then I calculated the index between the beginning and the end of each spindles in the reference and added the fields cycle_ref, stage_ref and arousals_ref in SS.

I hope it's fine ...

@AnnaCastelnovo
Copy link
Author

However,

(sorry for writing so much) I'm having another issue:

for 1 subject out of 30 I have this error:

loading data file: WB136_N23_f1-40_i_a.set...done
Calculating: Canonical wave (midline)
Information: 1357 spindle bursts found in reference wave
Error using -
Matrix dimensions must agree.

Error in swa_FindSSRef (line 186)
SS_lengths = spindle_end - spindle_start;

I added this in order to avoid the error:

% if rem(length(spindle_end), length(spindle_start))
% length_min = min(length(spindle_end), length(spindle_start));
% spindle_end = spindle_end(1:length_min);
% spindle_start = spindle_start(1:length_min);
% end

but I am not sure if it's ok, and if it ever happened to anybody else to have this error. If not, maybe there is simply something wrong in my data...

@Mensen
Copy link
Owner

Mensen commented Mar 18, 2017

Hey Anna!

Since I'm not sure how the fields cycle_ref, stage_ref and arousals_ref are used, I can't comment whether this works for your purposes or not.

As for the error, I assume its because there is a different number of potential spindle starting points and end points. This can happen where there is a spindle that starts very early and only the end of it is in the recording, or at the very end of your data, a spindle starts but the data ends before the spindle ends.

This scenario is checked for and corrected though, so I'm not sure if that one data file has some other special scenario case that I've not thought of yet.

However, I see that your error for that line is in line 186, but for the current toolbox that command is at line 179 ... so are you using the latest version, and if you are did you change any other lines that might have caused that problem?

@AnnaCastelnovo
Copy link
Author

I was using the last version I think: the line number is different just bc I added (and commented) the lines I wrote you before (to make the two variables of the same length).

I finally discovered that git is integrated in matlab, which makes everything much easier for me! I added and synchronized your toolbox, in order to avoid these annoying problems of versions and in order to show you directly where I have problems or where I'd like to add some lines in order to get the info I need (about time, I know, I should have done long before!). Tomorrow I'll try to show you this way. Thanks for all your help!

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