MNE/Matplotlib-Visualisierung führt dazuPython

Python-Programme
Anonymous
 MNE/Matplotlib-Visualisierung führt dazu

Post by Anonymous »

Ich habe ein Problem, das MNE , Matplotlib und easyGui-qt kombiniert. Ich bin mir nicht sicher, wie das Problem genau ist. Ich möchte, dass der Benutzer so viel mit der Abbildung spielen kann, wie er möchte, und klicken Sie schließlich auf Eingaben über das Popup-Modal. Das Problem ist bei der Erzeugung der Abbildung den interaktiven Modus , der aus irgendeinem Grund EasyGui-Qt zu beendet (bearbeitet, bearbeitet, das Skript beendet aufhört, stürzt ab). # Kommentare), die input2 Zeile bewirkt, dass das Skript beendet wird, sobald der Benutzer eine Eingabe angibt (d. H. Nach dem Klicken auf eine der Schaltflächen) und nie die Druckzeile für den Druck erreicht.

Code: Select all

import matplotlib
import mne
from mne.datasets import sample
from mne.io import read_raw_fif
import easygui_qt.easygui_qt as gui
import matplotlib.pyplot as plt

matplotlib.use('Qt5Agg')
mne.viz.set_browser_backend('qt')   # or "matplotlib"

fname = sample.data_path() / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = read_raw_fif(fname, preload=False, verbose=False)
raw.crop(0, 60).pick("eeg")
raw.load_data(verbose=False)

input1 = gui.get_continue_or_cancel(title="Input 1", message="", continue_button_text="T", cancel_button_text="F")
fig = raw.plot(verbose=False, show=True)    # can set show=False with same downstream effect
# plt.ioff()                        # this has no effect
# matplotlib.interactive(False)     # this has no effect
input2 = gui.get_continue_or_cancel(title="Input 2", message="", continue_button_text="T", cancel_button_text="F")
print(f"In 1: {input1}\t\tIn 2: {input2}")
< /code>
Danke für die Hilfe :) < /p>
Paketversionen: < /p>
matplotlib:3.8.4
PyQt5: 5.15.11
easygui-qt: 0.9.3
mne: 1.9.0
mne-qt-browser: 0.6.3
< /code>
und andere Systeminformationen: < /p>
>>> mne.sys_info()
Platform             Windows-11-10.0.26100-SP0
Python               3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)]
Executable           C:\Path\To\venv\Scripts\python.exe
CPU                  13th Gen Intel(R) Core(TM) i7-13700 (24 cores)
Memory               63.7 GiB
Core
+ mne               1.9.0 (latest release)
+ numpy             2.1.1 (OpenBLAS 0.3.27 with 24 threads)
+ scipy             1.15.1
+ matplotlib        3.8.4Backend QtAgg is interactive backend. Turning interactive mode on.
(backend=QtAgg)
Numerical (optional)
+ sklearn           1.6.1
+ pandas            2.2.3
+ h5py              3.12.1
- unavailable       numba, nibabel, nilearn, dipy, openmeeg, cupy, h5io
Visualization (optional)
+ qtpy              2.4.3 (PyQt6=6.8.2)
+ pyqtgraph         0.13.7
+ mne-qt-browser    0.6.3
- unavailable       pyvista, pyvistaqt, vtk, ipympl, ipywidgets, trame_client, trame_server, trame_vtk, trame_vuetify
Ecosystem (optional)
+ mne-icalabel      0.7.0
- unavailable       mne-bids, mne-nirs, mne-features, mne-connectivity, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post