Unfortunately, the coordinate of the stc.peak is only displayed in MNI-coordinates and the RAS vertex (=vertno_max) is given.
I already tried to convert the RAS vertex on the right hemisphere to RAS coordinates using:
ras_coor = [1]['rr'][stc.rh_vertno[vertno_max]]
but this raises an ‘IndexError: index 123816 is out of bound for axis with size 4098’.
After computation of the forward solution, I checked whether the amount of vertices has declined compared to src. It has not. But the right hemisphere (in both src and fwd) seems to contain n_vertices=127113 of which only n_used=4098 are utilized.
Is there any way, I can get the x,y,z RAS coordinates from the RAS vertex?
unfortunately this also does not work.
I then receive the following ERROR:
TypeError Traceback (most recent call last)
Input In [44], in <cell line: 1>()
----> 1 ras_coor=[1][‘rr’][vertno_max]
TypeError: list indices must be integers or slices, not str
I also tried using: ras_coor = src[1]['rr'][stc.rh_vertno[vertno_max]]
since the stc object only contains information about the Amplitudes over time whereas the src should contain information about source location (see: https://mne.tools/dev/auto_tutorials/inverse/10_stc_class.html). But nonetheless - it did not work since the index is still out of bound…
@brainfreeze1212 - I dont’ know if it fixes it, but what if you set vert_as_index to True. I think this gives you the index on source space versus the original freesurfer vertex index.