Store the scores alongside the components chosen by find_bads_eXg methods.
See original GitHub issueFollowing a discussion on the forum with @hoechenberger I could not find a way to recover the information I was looking for.
Following an ICA, I saved to disk both the ICA
instance and the raw
instance on which the ICA is applied.
ica = mne.preprocessing.ICA(method='picard', max_iter='auto', random_state=101)
ica.fit(raw, picks='eeg')
eog_idx, eog_scores = ica.find_bads_eog(raw)
ecg_idx, ecg_scores = ica.find_bads_ecg(raw)
ica.exclude = eog_idx + ecg_idx
ica.apply(raw)
ica.save()
raw.save()
I wanted to check how well the adaptative Z-score threshold worked (I like smart algo, but I don’t trust them blindly). After posting on the forum, and looking for a while, I could retrieve the separation between excluded components corresponding to EOG-related activity and ECG-related activity. This information is stored in ica.labels_
. However, I could not recover the scores that lead to this component selection.
I ended up rerunning part of my pipeline and saving the scores separately, but it was very surprising for me that I could not recover this information from the ICA
instance. After looking a bit into the code, it was clear to me that the scores were not saved anywhere. I propose to add an additional attribute similar to labels_
but for the scores.
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (22 by maintainers)
Top GitHub Comments
Once that’s done, LMK and I can create a
conda-forge
package too, so we can include this in the installer!Ok transfer done