mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.67k stars 1.31k forks source link

Problem with brain.add_volume_labels in tutorial 'Working with sEEG data' #10426

Closed RuxueG closed 2 years ago

RuxueG commented 2 years ago

Hi, I met a problem when running tutorial Jupyter notebook scripts of 'Working with sEEG data'. I cannot plot out the labels in 3D head model when running the command brain.add_volume_labels(aseg='aparc+aseg', labels=labels). There's a TypeError: SetColor argument 1: expected a sequence of 3 values, got 4 values. A document for the details of the error was attached here. error.pdf Could you help me solve the problem? Thanks!

By the way, I worked with the Windows system and MNE-python in Anaconda environment.

welcome[bot] commented 2 years ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

zhengliuer commented 2 years ago

Please update all the packages to the latest. Use

mne.sys_info()

to see the version of your package.

RuxueG commented 2 years ago

I tried to update all the packages but I still meet the same problem. Here is the info

Platform: Windows-10-10.0.22000-SP0 Python: 3.9.10 | packaged by conda-forge | (main, Feb 1 2022, 21:22:07) [MSC v.1929 64 bit (AMD64)] Executable: F:\anaconda\anaconda\envs\mne\python.exe CPU: Intel64 Family 6 Model 142 Stepping 10, GenuineIntel: 8 cores Memory: 7.9 GB

mne: 0.24.1 numpy: 1.22.3 {} scipy: 1.8.0 matplotlib: 3.5.1 {backend=QtAgg}

sklearn: 1.0.2 numba: 0.53.1 nibabel: 3.2.2 nilearn: 0.9.0 dipy: 1.4.1 cupy: Not found pandas: 1.4.1 mayavi: 4.7.4 pyvista: 0.33.3 {OpenGL 4.5.0 - Build 25.20.100.6576 via Intel(R) UHD Graphics 620} pyvistaqt: 0.7.0 ipyvtklink: 0.2.2 vtk: 9.1.0 PyQt5: 5.15.6 ipympl: 0.8.8 mne_qt_browser: 0.2.5 pooch: v1.6.0

Is there anything that I missed?

zhengliuer commented 2 years ago

How do you create your environment? Try this first to see if there is any problem.https://mne.tools/stable/install/index.html

conda create --name=mne --channel=conda-forge mne
RuxueG commented 2 years ago

This is exactly what I did in the beginning. At the first time, I got information as below:

Platform: Windows-10-10.0.22000-SP0 Python: 3.9.10 | packaged by conda-forge | (main, Feb 1 2022, 21:22:07) [MSC v.1929 64 bit (AMD64)] Executable: F:\anaconda\anaconda\envs\mne\python.exe CPU: Intel64 Family 6 Model 142 Stepping 10, GenuineIntel: 8 cores Memory: 7.9 GB

mne: 0.24.1 numpy: 1.22.3 {blas=NO_ATLAS_INFO, lapack=lapack} scipy: 1.8.0 matplotlib: 3.5.1 {backend=module://matplotlib_inline.backend_inline}

sklearn: 1.0.2 numba: 0.53.1 nibabel: 3.2.2 nilearn: 0.9.0 dipy: 1.4.1 cupy: Not found pandas: 1.4.1 mayavi: 4.7.2 pyvista: 0.33.3 {OpenGL 4.5.0 - Build 25.20.100.6576 via Intel(R) UHD Graphics 620} pyvistaqt: 0.7.0 ipyvtklink: Not found vtk: 9.0.3 PyQt5: 5.12.3 ipympl: Not found mne_qt_browser: 0.2.5 pooch: v1.6.0

Then I checked every package and tried to update them to the latest version as shown in my comment #2. But none of the two settings solve the problem in the 'brain.add_volume_labels()'.

Before the error prompt up, there's a warning: F:\anaconda\anaconda\envs\mne\lib\site-packages\mne\viz\backends_pyvista.py:192: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(pyvista.version) >= '0.27.0':

I was wondering if this warning matters. And how should I deal with it?

Thank you for your help!

larsoner commented 2 years ago

In this case I think it's because MNE is out of date. Can you try:

conda remove -f mne
pip install https://github.com/mne-tools/mne-python/zipball/main

And see if it helps?

larsoner commented 2 years ago

(... out of date in the sense that it's installing the stable version, and to deal with this particular problem you need the dev version. FYI, the next MNE version should come out next week!)

RuxueG commented 2 years ago

Thank you! It works now!

Looking forward to the new MNE version!