-
Notifications
You must be signed in to change notification settings - Fork 32
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
add excluded channels back to data after preprocessing #66
base: development
Are you sure you want to change the base?
add excluded channels back to data after preprocessing #66
Conversation
…sing and adapt channel indices (shifting)
as for the GUI implementation:
should be easy for you to retrieve it from defaults or the GUI :) |
…hed after preprocessing
the code also handles Eye tracking data now (it can add the loaded channels and events to the output data, without taking it into account for the quality assessment etc). maybe this feature isnt really ready to merge, as |
…luded channels into account when calculating quality assessment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where and how is this done?
In a separate script outside of Automagic : )
Regarding the first few commits: What if someone wants to definitely remove specific channels and reattach only a part of them? For example, high density EEG systems have channels located on a chin or neck. Some researchers exclude those channels already before preprocessing and do not reattach later.
Further, if there are any ECG etc. channels, they should be removed before importing channel information in systemDependentParse, otherwise readlocs won't import the chanlocs - ECG don't have coordinates in .loc file. The mismatch in data/chanlocs dimension will result in an error. |
thanks for your comments @ksgfan !
partial reattachment would be straight forward to implement, just need an explicit field for indices in the gui / as input parameter.
actually, i cannot reproduce this behavior: working with BIDS data in BrainVision format, all channels I do not explicitly exclude via automagic are imported and part of the but maybe i misunderstand what you mean?
most of the time it shouldnt be a problem, anyway, as the the problem with eeglab complaining about dimension mismatch appeared to me only with the ET channels during channel interpolation (as here the chanlocs are actually empty if there are other crucial positions where channel locations are needed, please let me know!
jup, that's what this pr is about :) |
yes, please dont merge yet! i strongly advice for testing first ;) |
..talking about channel interpolation: maybe a question for another issue, though :) |
If the number of rows in EEG.data don't match the number of rows in e.g. chanlocs.loc file, the .loc file will not be imported. The mismatch might occur, because e.g. Biosemi64 has 8 Ext channels (72 channels in EEG.data in total), but only 64 channels in .loc file. Similar, if some EEG systems have VEOG or HEOG channels in EEG.data, but no coordinates in the .loc file, the loc file won't be imported. On the other hand, EEG system such as EGI has coordinates for the EOG channels, so there is no problem with the .loc (or in this case .sfp) import. so far you skip interpolation only if all channels are marked bad. The number of required channels for meaningful interpolation may vary based on EEG.system (number of electrodes) and position of removed channels. I think it should be the users responsibility to decide, whether the interpolation results make sense. Btw, if the number of removed channels exceeds a given threshold, the file will be marked as 'bad' and should be excluded from analysis. |
ok, kind of makes sense.. in the case of my BIDS data it wasnt a problem, as i digitized individual channel locations and these are loaded without problems. what i still dont understand from your explanation is, how the code can work with EOG channels then? shouldnt this cause the same errors you expect? |
do you have a small example dataset (with misc/ext channels) that i could use to troubleshoot? Sure: https://www.dropbox.com/sh/osbe0qm07a2eb8k/AADDVpDWzHthQoLM70lU6ijca?dl=0 EOG works in some EEG systems (e.g. EGI), because they have coordinates for EOG electrodes. For other systems it is necessary to add coordinates of the EOG electrodes to the .loc file manually. In my opinion your solution adds to much complexity to the code. It would be much simpler, if the misc channels would be separated and stored in e.g. |
thanks!
i think you're right. i'll change the code and get back to you soon! |
closes #61
I mimicked the treatment of the EOG channels for EXCLUDED channels
where and how is this done?
I didnt find it in the code (only the code where EOG is seperated in
systemDependentParse.m
)let's check this with the new PR i did not encounter problems so far..