methlabUZH / automagic

Automagic
GNU General Public License v3.0
89 stars 32 forks source link

possible enhancement: option to add excluded channels back to data after preprocessing #61

Open dominikwelke opened 2 years ago

dominikwelke commented 2 years ago

hi all,

I am missing an option to exclude misc channels (EOG, ECG, EMG, or the like) only temporarily during preprocessing. so far this data is removed from the file.

it's easy to fix this later on, but i think it would be an improvement for automagic if the pipeline could handle this.

the simplest implementation would be to store all excluded channel data (in memory or better on disc) and reattach them to the preprocessed file before saving. this could be controlled with a checkbox in the gui.

alternatives:

I'd be happy to implement this functionality if you are interested (not the gui, though). one would need to pay attention to the channel indices. especially if automagic adds a reference channel to the dataset

cheers, Dominik

ksgfan commented 2 years ago

Hi Dominik,

it is a good idea, however as you said, it may be tricky to implement. Especially, when user exclude some channels, add new reference or perform EOG Regression. For EOG regression, the user has to specify EOG channels that are removed from EEG before preprocessing and regressed out from EEG later.

Additionally, one needs to be careful, when providing channel location file, because if the dimensions of data and channels do not agree, automagic won't load the channel information.

Up until now, we were simply splitting the data and saving ECG, etc. temporarily on disc (or e.g. in EEG.ecg) before preprocessing in automagic.

If you are willing to write the code, I am happy to implement the GUI part :)

Best, Dawid

dominikwelke commented 2 years ago

hi @ksgfan sorry for the delayed response, i had some busy months in between but finally found the time to work on this :)

it is a good idea, however as you said, it may be tricky to implement. Especially, when user exclude some channels, add new reference or perform EOG Regression. For EOG regression, the user has to specify EOG channels that are removed from EEG before preprocessing and regressed out from EEG later.

I just created a PR. lets discuss there

ksgfan commented 2 years ago

Hi Dominik,

Thank you very much! I am on vacation until 17.07. but will check the PR after i am back.

Best, Dawid