# Plot tmp_epochs = ic_rm_epochs.copy()[these_epochs] tmp_colors = [epoch_colors[x] for x in these_epochs] figs.append( tmp_epochs.plot(n_channels=66, n_epochs=epochs_per_plot, scalings=dict(eeg=100e-6, eog=200e-6), show=False, epoch_colors=tmp_colors, picks=['eeg', 'eog'])) print(f'Figs completed: {len(figs)}') # Add slidebar figs report.add_slider_to_section(figs, captions=captions, section='EEG', title='EEG: Cleaned Epochs', scale=2) plt.close() # ICA Section # Load ICA epochs ica_epoch_fif_file = deriv_path / \ f'{sub}_task-{task}_ref-FCz_desc-ica_epo.fif.gz' ica_epochs = mne.read_epochs(ica_epoch_fif_file, preload=True) # Load ICA ica_file = deriv_path / f'{sub}_task-{task}_ref-FCz_desc-ica_ica.fif.gz' ica = read_ica(ica_file) # Plot ICA Component maps
# Update caption captions.append(f'Epochs {these_epochs[0]}-{these_epochs[-1]}') # Plot tmp_epochs = ic_rm_epochs.copy()[these_epochs] tmp_colors = [epoch_colors[x] for x in these_epochs] figs.append( tmp_epochs.plot(n_channels=66, n_epochs=epochs_per_plot, scalings=dict(eeg=100e-6, eog=200e-6), show=False, epoch_colors=tmp_colors, picks=['eeg', 'eog']) ) print(f'Figs completed: {len(figs)}') # Add slidebar figs report.add_slider_to_section(figs, captions=captions, section='EEG', title='EEG: Cleaned Epochs', scale=2) plt.close() # ICA Section # Load ICA epochs ica_epoch_fif_file = deriv_path / \ f'{sub_string}_task-{task}_ref-FCz_desc-ica_epo.fif.gz' ica_epochs = mne.read_epochs(ica_epoch_fif_file, preload=True) # Load ICA ica_file = deriv_path / \ f'{sub_string}_task-{task}_ref-FCz_desc-ica_ica.fif.gz' ica = read_ica(ica_file) # Plot ICA Component maps figs = ica.plot_components(reject=None, psd_args=dict(fmax=70), show=False)