Issue with .surf files for mne.giu.coregistration - endings are missing + Attribute Error for

Hi all,

I am currently working on the MRI coregistration and forward modeling with MEG data.

  • MNE version: 0.24.0
  • operating system: Ubuntu 20.04

I created the scalp_surfaces and watershed_bem using following bash script in the command line:

export MNE_ROOT=/data/TOOLBOXES/MNE-2.7.0-3106-Linux-x86_64/
export MATLAB_ROOT=/usr/local/MATLAB/R2020b/
export FREESURFER_HOME=/usr/local/freesurfer/
source /data/TOOLBOXES/MNE-2.7.0-3106-Linux-x86_64/bin/mne_setup_sh
export SUBJECTS_DIR=/data/project_XX/derivatives/freesurfer

declare -a subj_list=('sub-XXXXXX' 'sub-XXXXX1' 'sub-XXXXXX2')
. $MNE_ROOT/bin/mne_setup_sh
for subject in ${subj_list[@]}; do	
	export SUBJECT=$subject
	echo $subject
	mne_setup_source_space --ico 5

after running this code, the bem/watershed/ directory with the brain_surface, inner_skull_surface, outer_skin_surface and outer_skull_surface files is created.
However, the .surf endings are missing (?!).

In the next step, I planned to run a) the automated coregistration and visualize the fits to check whether a manual correction via the gui gui is necessary.
The automated coregistration works well but the gui struggles in def_setup_bem(self) and does not find the surf information in the dictionary of the lh.seghead (high resultion head model; AttributeError: ‘dict’ object has no attribute ‘surf’)…

At a later stage when using the mne.make_bem_model method, my surf files created earlier only worked when I moved them one directory up into the bem folder and added the .surf end.

I considered using the new function mne.bem.make_scalp_surfaces() instead of the command line however, one challenge I face is that my data is not saved in the same directory as freesurfer.

Do you have any ideas how to fix this?
Could it be the version of MNE for the command line functions (MNE-2.7.0-3106-Linux-x86_64)?

Many thanks for your help and support!
Please let me know if some information is missing for a better understanding of the problem.

The old MNE-C mne_ commands are less well supported nowadays compared to their mne <whatever> counterparts, which use MNE-Python (as much as possible) under the hood. I think the MNE-Python ones will create the .surf files that you need.

Can you try using mne watershed_bem and mne make_scalp_surfaces instead? For the source space step, you can use mne.setup_source_space(...) directly. I think there are python-function equivalents to the command-line commands if you want to stay in Python for those, too.

1 Like