-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
ENH: Make number of ICA components plotted in reports dynamic #13958
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
base: main
Are you sure you want to change the base?
Changes from all commits
35cce40
0c6ab92
926ea7c
89a9ba6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,6 +40,7 @@ def plot_ica_sources( | |||||||||||||
| picks=None, | ||||||||||||||
| start=None, | ||||||||||||||
| stop=None, | ||||||||||||||
| n_channels=None, | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| title=None, | ||||||||||||||
| show=True, | ||||||||||||||
| block=False, | ||||||||||||||
|
|
@@ -70,6 +71,7 @@ def plot_ica_sources( | |||||||||||||
| inst : instance of Raw, Epochs or Evoked | ||||||||||||||
| The object to plot the sources from. | ||||||||||||||
| %(picks_ica)s | ||||||||||||||
| : int | None | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cruft? |
||||||||||||||
| start, stop : float | int | None | ||||||||||||||
| If ``inst`` is a `~mne.io.Raw` or an `~mne.Evoked` object, the first and | ||||||||||||||
| last time point (in seconds) of the data to plot. If ``inst`` is a | ||||||||||||||
|
|
@@ -78,6 +80,8 @@ def plot_ica_sources( | |||||||||||||
| `~mne.Evoked`, ``None`` refers to the beginning and end of the evoked | ||||||||||||||
| signal. If ``inst`` is an `~mne.Epochs` object, specifies the index of | ||||||||||||||
| the first and last epoch to show. | ||||||||||||||
| n_channels : int | None | ||||||||||||||
| The number of ICA components to plot. If None, defaults to 20. | ||||||||||||||
|
Comment on lines
+83
to
+84
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Suggested change
|
||||||||||||||
| title : str | None | ||||||||||||||
| The window title. If None a default is provided. | ||||||||||||||
| show : bool | ||||||||||||||
|
|
@@ -142,6 +146,7 @@ def plot_ica_sources( | |||||||||||||
| exclude, | ||||||||||||||
| start=start, | ||||||||||||||
| stop=stop, | ||||||||||||||
| n_channels=n_channels, | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And I'd update this everywhere
Suggested change
|
||||||||||||||
| show=show, | ||||||||||||||
| title=title, | ||||||||||||||
| block=block, | ||||||||||||||
|
|
@@ -1292,6 +1297,7 @@ def _plot_sources( | |||||||||||||
| psd_args, | ||||||||||||||
| theme=None, | ||||||||||||||
| overview_mode=None, | ||||||||||||||
| n_channels=20, | ||||||||||||||
| splash=True, | ||||||||||||||
| ): | ||||||||||||||
| """Plot the ICA components as a RawArray or EpochsArray.""" | ||||||||||||||
|
|
@@ -1348,7 +1354,9 @@ def _plot_sources( | |||||||||||||
| data = np.append(data, eog_ecg_data, axis=0) | ||||||||||||||
| picks = np.concatenate((picks, ica.n_components_ + np.arange(len(extra_picks)))) | ||||||||||||||
| ch_order = np.arange(len(picks)) | ||||||||||||||
| n_channels = min([20, len(picks)]) | ||||||||||||||
| if n_channels is None: | ||||||||||||||
| n_channels = 20 | ||||||||||||||
| n_channels = min([n_channels, len(picks)]) | ||||||||||||||
| ch_names_picked = [ch_names[x] for x in picks] | ||||||||||||||
|
|
||||||||||||||
| # create info | ||||||||||||||
|
|
||||||||||||||
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.
Update this too, etc.