Hello everyone,
I am having issues with locating electrodes in my ecog data, following the tutorial in MNE’s webpage.
First of all, MNE and OS versions are:
- MNE version: e.g. 0.24.1
- operating system: Ubuntu 24
And the code I am using is:
raw = mne.io.read_raw_cnt(
'/place/where/ecog/is/located/ecog_file.cnt')
# estimate head->mri transform
CT = nibabel.load('/place/where/CT/file/is/CT_file.nii')
T1 = nibabel.load('/place/where/T1/is/fsaverage/subject/mri/T1.mgz')
reg_affine, _ = mne.transforms.compute_volume_registration(
CT, T1, pipeline='rigids')
CT_aligned = mne.transforms.apply_volume_registration(CT, T1, reg_affine)
subj_trans = mne.coreg.estimate_head_mri_t('subject', '/place/where/fsaverage/is/fsaverage', verbose= 5)
gui = mne.gui.locate_ieeg(raw.info, subj_trans, CT_aligned, subject='subject', subjects_dir= 'place/where/fsaverage/is/fsaverage', verbose= 5)
However, I get an error message at the line where variable “gui” is, as follows:
gui = mne.gui.locate_ieeg(raw.info, subj_trans, CT_aligned, subject='subject', subjects_dir= 'place/where/fsaverage/is/fsaverage', verbose= 5)
File "<decorator-gen-567>", line 22, in locate_ieeg
File "/home/beyond/.conda/envs/Ecog_EEG_MEG/lib/python3.9/site-packages/mne/gui/__init__.py", line 319, in locate_ieeg
gui = IntracranialElectrodeLocator(
File "/home/beyond/.conda/envs/Ecog_EEG_MEG/lib/python3.9/site-packages/mne/gui/_ieeg_locate_gui.py", line 168, in __init__
self._plot_images()
File "/home/beyond/.conda/envs/Ecog_EEG_MEG/lib/python3.9/site-packages/mne/gui/_ieeg_locate_gui.py", line 300, in _plot_images
ct_data = np.take(self._ct_data, self._current_slice[axis],
File "<__array_function__ internals>", line 180, in take
File "/home/beyond/.conda/envs/Ecog_EEG_MEG/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 190, in take
return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
File "/home/beyond/.conda/envs/Ecog_EEG_MEG/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
IndexError: index -806 is out of bounds for axis 0 with size 256
The main error message is: IndexError: index -806 is out of bounds for axis 0 with size 256
Anyone has any idea?
Thank you for your time.
Needle