Comments (3)
Can you precise this a bit? I'm not sure I'm following
from mne-icalabel.
It's mainly code like this in the GUI:
for label, comp_list in labels2save.items():
mne_label = ICLABEL_LABELS_TO_MNE[label]
if mne_label not in self._ica.labels_:
self._ica.labels_[mne_label] = comp_list
continue
for comp in comp_list:
if comp not in self._ica.labels_[mne_label]:
self._ica.labels_[mne_label].append(comp)
and code like this in write_components_tsv
# extract the component labels if they are present in the ICA instance
if ica.labels_:
for label, comps in ica.labels_.items():
this_status = "good" if label == "brain" else "bad"
if label in ICLABEL_LABELS_TO_MNE.values():
for comp in comps:
status[comp] = this_status
ic_type[comp] = label
and we'll probably want to modify the ICA instance in place when running the automated models, so like in ICLabel:
if inplace:
from mne_icalabel.config import ICLABEL_LABELS_TO_MNE
ica.labels_scores_ = labels_pred_proba
argmax_labels = np.argmax(labels_pred_proba, axis=1)
# add labels to the ICA instance
for idx, (_, mne_label) in enumerate(ICLABEL_LABELS_TO_MNE.items()):
auto_labels = argmax_labels.index[idx]
if mne_label not in ica.labels_:
ica.labels_[mne_label] = auto_labels
continue
for comp in auto_labels:
if comp not in ica.labels_[mne_label]:
ica.labels_[mne_label].append(comp)
These I just wrote up for the sake of making it work, but prolly best to have a private API for interfacing the conversion between MNE and our ICA label semantics.
from mne-icalabel.
OK sure!
from mne-icalabel.
Related Issues (20)
- [DOC] License link in documentation 404's HOT 1
- [GUI] Additional PyQt5 dependency? HOT 2
- [GUI] Missing or non-expandable ICA properties HOT 1
- [DOC] Clarify the types of data to be used HOT 2
- [JOSS] Nitpicks on the paper HOT 1
- No module named 'numpy.typing' HOT 2
- mne_icalabel ImportError HOT 4
- Example render for 0.4 stable website HOT 4
- Possibly want to freeze GH actions at Ubuntu 20.04? HOT 1
- ValueError: need at least one array to concatenate HOT 6
- ONNX/Tensorflow Port HOT 3
- "arrays used as indices must be of integer (or boolean) type" HOT 14
- Set black to max_chars=88 per line
- ICLabel doesn't work with combined MEG/EEG data
- Evaluate and support MEGNet HOT 2
- Guidelines to contribute a new model HOT 4
- Dropdown version selector is broken HOT 1
- Use of IClabel with MEG data. HOT 2
- DOC: tables in dark mode are unreadable HOT 1
- Outdated docs for label_components() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mne-icalabel.