BUG: One layer BEM construction fails for current ANTS6-0Months3T template

Aperta
#14,468 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sruthisureshkumar-arch ci sta già lavorando.

Dal 1/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start in mne/bem.py at _ico_downsample, reached through mne.make_bem_model, and inspect the triangle ordering check. Reproduce with the ANTS6-0Months3T template and the one-layer conductivity shown in the issue. Done means make_bem_model completes and returns a one-layer BEM for that template.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

BUG
Description of the problem

Our current ANTS templates ship with a three layer BEM. If you want to make a 1-layer BEM for MEG solutions, you should be able to make one, but calling mne.make_bem_model with a freshly installed template throws an error about triangle ordering.

Steps to reproduce
import mne
s_dir = mne.datasets.default_path()
mne.datasets.fetch_infant_template("6mo", subjects_dir=s_dir)
subject="ANTS6-0Months3T"
bem_one_layer = mne.make_bem_model(subject, conductivity=[0.3,], subjects_dir=sdir)
Link to data

No response

Expected results

The function should complete successfully, returning a one-layer BEM.

Actual results

Traceback (most recent call last):
File "/Users/nordme/miniconda3/envs/dev_2026/lib/python3.14/site-packages/IPython/core/interactiveshell.py", line 3775, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1, in
bem_one_layer = mne.make_bem_model(subject, conductivity=[0.3,], subjects_dir=sdir)
File "", line 12, in make_bem_model
File "/Users/nordme/github/mne-python/mne/bem.py", line 716, in make_bem_model
surfaces = _surfaces_to_bem(surfaces, ids, conductivity, ico)
File "/Users/nordme/github/mne-python/mne/bem.py", line 617, in _surfaces_to_bem
surfs[si] = _ico_downsample(surf, ico)
~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/nordme/github/mne-python/mne/bem.py", line 489, in _ico_downsample
raise RuntimeError(
...<2 lines>...
)
RuntimeError: The source surface has a matching number of triangles but ordering is wrong

Additional information

mne sys_info
Platform             Linux-6.8.0-147-generic-x86_64-with-glibc2.39 (X11)
Python               3.14.6 | packaged by conda-forge | (main, Jul 24 2026, 16:09:24) [GCC 14.3.0]
Executable           /home/erica/miniconda3/envs/bids_dev26/bin/python3.14
CPU                  AMD Ryzen 9 3900X 12-Core Processor (24 cores)
Memory               62.7 GiB

Core
├☑️ mne               1.14.0.dev113+g0616647f5 (development, latest release is 1.13.2)
├☑️ numpy             2.4.6 (OpenBLAS 0.3.33 with 12 threads via pthreads)
├☑️ scipy             1.18.0
└☑️ matplotlib        3.11.1 (backend=qtagg)

Numerical (optional)
├☑️ scikit-learn      1.9.0
├☑️ threadpoolctl     3.6.0
├☑️ numba             0.66.0
├☑️ nibabel           5.4.2
├☑️ nilearn           0.13.1
├☑️ dipy              1.12.1
├☑️ openmeeg          2.5.16
├☑️ pandas            3.0.3
├☑️ h5io              0.2.5
├☑️ h5py              3.16.0
└☐ unavailable       python-picard, jamica, cupy

Visualization (optional)
├☑️ pyvista           0.48.4 (OpenGL 4.6 (Core Profile) Mesa 25.2.8-0ubuntu0.24.04.4 via AMD Radeon RX 570 Series (radeonsi, polaris10, ACO, DRM 3.57, 6.8.0-147-generic))
├☑️ pyvistaqt         0.12.0
├☑️ vtk               9.6.2
├☑️ qtpy              2.4.3 (PySide6=6.11.1)
├☑️ pyqtgraph         0.14.0
├☑️ mne-qt-browser    0.7.5
├☑️ ipywidgets        8.1.8
├☑️ trame             3.13.2
├☑️ trame_client      3.13.2
├☑️ trame_server      3.12.5
├☑️ trame_vtk         2.11.14
├☑️ trame_vuetify     3.2.5
└☐ unavailable       ipympl, trame_pyvista

Ecosystem (optional)
├☑️ mne-bids          0.21.0.dev11+g085e309b9.d20261020
├☑️ mne-nirs          0.7.3
├☑️ mne-connectivity  0.8.1
├☑️ mne-icalabel      0.9.0
├☑️ mne-bids-pipeline 1.11.0.dev86+ge2a34cf44
├☑️ autoreject        0.4.4
├☑️ neo               0.14.5
├☑️ eeglabio          0.1.3
├☑️ edfio             0.4.14
├☑️ curryreader       0.1.2
├☑️ mffpy             0.11.0
├☑️ pybv              0.8.1
├☑️ pymef             1.4.8
├☑️ antio             0.7.1
├☑️ defusedxml        0.7.1
└☐ unavailable       mne-features

Lingua principale
Python
Stelle
3.6k
Fork
1.6k
Merge medio
1g 19h
PR unite (30g)
67

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mne-tools/mne-python

Tutte le issue di mne-tools/mne-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.