Skip to content

Commit

Permalink
double check
Browse files Browse the repository at this point in the history
  • Loading branch information
colehank committed Oct 18, 2024
1 parent 6f272b1 commit b3433c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mne_icalabel/megnet/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _get_topomaps(ica: ICA, pos_new: NDArray, outlines: dict):
sample_fname = sample_dir / "MEG" / "sample" / "sample_audvis_raw.fif"

raw = mne.io.read_raw_fif(sample_fname).pick_types("mag")

raw.resample(250)
ica = mne.preprocessing.ICA(n_components=20, method="infomax")
ica.fit(raw)

Expand All @@ -192,4 +192,4 @@ def _get_topomaps(ica: ICA, pos_new: NDArray, outlines: dict):
ax.imshow(comp)
ax.axis("off")
fig.tight_layout()
fig.show()
plt.show()
6 changes: 5 additions & 1 deletion mne_icalabel/megnet/label_componets.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _get_chunk_start(

sample_dir = mne.datasets.sample.data_path()
sample_fname = sample_dir / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = mne.io.read_raw_fif(sample_fname).pick_types("mag")
raw = mne.io.read_raw_fif(sample_fname).pick("mag")
raw.resample(250)
raw.filter(1, 100)
ica = mne.preprocessing.ICA(
Expand All @@ -143,3 +143,7 @@ def _get_chunk_start(
ica.fit(raw)

res = megnet_label_components(raw, ica)
print(res)
ica.exclude = [i for i, label in enumerate(res["labels"]) if label != "brain/other"]
ica.plot_components()

0 comments on commit b3433c8

Please sign in to comment.