swa-matlab icon indicating copy to clipboard operation
swa-matlab copied to clipboard

SS toolbox

Open AnnaCastelnovo opened this issue 8 years ago • 8 comments

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

AnnaCastelnovo avatar Feb 05 '17 17:02 AnnaCastelnovo

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 avatar Feb 06 '17 16:02 Mensen

Actually I tried before asking you, but it didn't work. I'll try again and try to understand why, if the toolbox is the right one.

Thanks for the answer!

2017-02-06 17:00 GMT+01:00 Armand Mensen [email protected]:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Sinergia-BMZ/swa-matlab/issues/50#issuecomment-277726254, or mute the thread https://github.com/notifications/unsubscribe-auth/AH2KqzzuRvCgWa9gKgTh9HmKmjNxtsklks5rZ0OAgaJpZM4L3jxZ .

AnnaCastelnovo avatar Feb 07 '17 07:02 AnnaCastelnovo

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

Mensen avatar Feb 07 '17 09:02 Mensen

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 avatar Mar 04 '17 11:03 AnnaCastelnovo

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 avatar Mar 17 '17 18:03 AnnaCastelnovo

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...

AnnaCastelnovo avatar Mar 18 '17 09:03 AnnaCastelnovo

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?

Mensen avatar Mar 18 '17 16:03 Mensen

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!

AnnaCastelnovo avatar Mar 19 '17 22:03 AnnaCastelnovo