Hi Britta,
Thanks for your input.
overlapping L/R surfaces
For the white
surfaces I couldnāt fit an overlap, only the medial walls are essentially touching. However for the pial
surfaces, there seem to be overlaps:
.
Besides, in setup_source_space
the left and right white surfaces are processed individually (in a loop), starting with the left one. If I change the order, the right surface is processed just fine. Would that be possible if an overlap between the hemispheres causes the issue?
you could try and get some deeper insights when exactly the computation spirals (maybe during one of our office hours if you are not sure yourself)
Okay, I tried to dig down the rabbit hole. It seems the script crashes for one particular vertex. during the Dijkstra algorithm at https://github.com/mne-tools/mne-python/blob/89b5a533867012a122fc43dfe57a18ad530c5906/mne/source_space/_source_space.py#L2793
The vertex in question is this one here (see the red little cross hairs). I donāt see anything that is obviously wrong with it (I plot the left white and pial surfaces, the crosshair is on the white)
Unfortunately, I canāt get more specific that this (bc the source code in scipy is compiled?). In the debugger the last lines I get are these:
> <ipython-input-1-254ab182b81c>(22)_do_src_distances()
-> out = func(con, indices=idx)
(Pdb) s
--Call--
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/scipy/sparse/csgraph/_validation.py(9)validate_graph()
-> def validate_graph(csgraph, directed, dtype=DTYPE,
(Pdb) n
--Return--
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/scipy/sparse/csgraph/_validation.py(56)validate_graph()-><137840x13784...se Row format>
-> return csgraph
(Pdb)
--Call--
> <__array_function__ internals>(177)any()
(Pdb)
> <__array_function__ internals>(179)any()
(Pdb)
> <__array_function__ internals>(180)any()
(Pdb)
> <__array_function__ internals>(181)any()
(Pdb)
> <__array_function__ internals>(180)any()
(Pdb)
--Return--
> <__array_function__ internals>(180)any()->False
(Pdb)
--Call--
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/scipy/sparse/_base.py(119)get_shape()
-> def get_shape(self):
(Pdb)
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/scipy/sparse/_base.py(121)get_shape()
-> return self._shape
(Pdb)
--Return--
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/scipy/sparse/_base.py(121)get_shape()->(137840, 137840)
-> return self._shape
(Pdb)
--Call--
> <__array_function__ internals>(177)atleast_1d()
(Pdb)
> <__array_function__ internals>(179)atleast_1d()
(Pdb)
> <__array_function__ internals>(180)atleast_1d()
(Pdb)
> <__array_function__ internals>(181)atleast_1d()
(Pdb)
> <__array_function__ internals>(180)atleast_1d()
(Pdb)
--Return--
> <__array_function__ internals>(180)atleast_1d()->array([130388], dtype=int32)
(Pdb)
--Call--
> <__array_function__ internals>(177)any()
(Pdb)
> <__array_function__ internals>(179)any()
(Pdb)
> <__array_function__ internals>(180)any()
(Pdb)
> <__array_function__ internals>(181)any()
(Pdb)
> <__array_function__ internals>(180)any()
(Pdb)
--Return--
> <__array_function__ internals>(180)any()->False
(Pdb)
--Call--
> <__array_function__ internals>(177)any()
(Pdb)
> <__array_function__ internals>(179)any()
(Pdb)
> <__array_function__ internals>(180)any()
(Pdb)
> <__array_function__ internals>(181)any()
(Pdb)
> <__array_function__ internals>(180)any()
(Pdb)
--Return--
> <__array_function__ internals>(180)any()->False
(Pdb)
--Call--
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/numpy/core/numeric.py(289)full()
-> @set_array_function_like_doc
(Pdb) s
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/numpy/core/numeric.py(337)full()
-> if like is not None:
(Pdb)
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/numpy/core/numeric.py(340)full()
-> if dtype is None:
(Pdb)
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/numpy/core/numeric.py(343)full()
-> a = empty(shape, dtype, order)
(Pdb)
> /home/user/tools/miniconda3/envs/mne/lib/python3.10/site-packages/numpy/core/numeric.py(344)full()
-> multiarray.copyto(a, fill_value, casting='unsafe')
(Pdb)
-> return a
(Pdb) a
shape = (1, 137840)
fill_value = inf
dtype = <class 'numpy.float64'>
order = 'C'
like = None
(Pdb) fill_value
As soon as I continue from here, I get stuck. So, I guess the problem occurs after. When I try this debugging for a vertex that has no issue, I donāt see any difference up to the point before it starts to spiral.
Is this helpful in any way? Or should I just give up that subject?
Thanks,
Eduard