Skip to content

Adapted rej_eyecontin.m to work on epoched data#29

Open
Dyschezia wants to merge 1 commit intoolafdimigen:masterfrom
Dyschezia:master
Open

Adapted rej_eyecontin.m to work on epoched data#29
Dyschezia wants to merge 1 commit intoolafdimigen:masterfrom
Dyschezia:master

Conversation

@Dyschezia
Copy link
Copy Markdown

The code works the same, but now initially loops over epochs when searching for bad_ET intervals and when adding the additional windowsize samples (to not cause spill between epochs). Can return a similar seq_bad struct with an additional 'epoch' column, or a third output that contains seq_bad like structures per epoch. Will not reject bad data from epoched data. An additional small change in rejectionmethod == 2: code checks if bad_ET events already exist in EEG.event (e.g., from running the function previously on the continuous data) and if so, removes them. Also removed line calculating duration, as it is already calculated by findsequence2.m.

The code works the same, but now initially loops over epochs when searching for bad_ET intervals and when adding the additional windowsize samples (to not cause spill between epochs). Can return a similar seq_bad struct with an additional 'epoch' column, or a third output that contains seq_bad like structures per epoch. Will not reject bad data from epoched data.

% Update march 2018 (OD)
% Do not remove data, but introduce new bad_ET events in EEG.event
fprintf('\nAdding %i bad_ET markers to the EEG.event structure...\nNot removing any data.\n\n',size(seq_bad,1))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seq_bad needs to be changed to seq_bad_overall. Sorry for missing that.

@olafdimigen
Copy link
Copy Markdown
Owner

fantastic! (I will need a few days to find time to look into this and to merge)

@Dyschezia
Copy link
Copy Markdown
Author

I now noticed that in detecteyemovement.m, if there are epochs with no good samples at all, and the SD threshold is computed over all epochs, the mean of the msdx/msdy over epochs is NaN. This happens because the msdx/y for that epoch is NaN and then the mean is computed over values, which have a NaN in them. This can be solved by computing the mean while ignoring NaNs, but I'm not confident enough in my understanding of the plugin and possible dependencies within it to suggest more changes. Maybe lmk what you think.

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

Successfully merging this pull request may close these issues.

2 participants