issue with make_watershed_bem

  • MNE version: e.g. 1.3.0
  • operating system: Ubuntu 18.04
  • FreeSurfer Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
    Greetings all,
    I want to creat the BEM surfaces for MEG forward model, so I first do surface reconstruction using FreeSurfer and MNE.
    First using FreeSurfer,and successfully achieved all the results
recon-all -i sub-01_ses-01_T1w.nii.gz -s sub-01 -all

then using the mne functions(I saved the script as meg.py then run $python meg.py in terminal )

make_scalp_surfaces(subject='sub-01', subjects_dir='/data/TEST/derivatives/FreeSurfer', overwrite=True)
make_watershed_bem(subject='sub-01', subjects_dir='/data/TEST/derivatives/FreeSurfer', overwrite=True)
model = mne.make_bem_model('sub-01',
                           ico=4,
                           conductivity=0.3,
                           subjects_dir='/data/TEST/derivatives/FreeSurfer')
bem = mne.make_bem_solution(model)

make_ scalp_ surfaces can run successfully, but run make_ watershed_ bem reported a mistake:

Running mri_watershed for BEM segmentation with the following parameters:

Results dir = /data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed
Command = mri_watershed -useSRAS -surf /data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/sub-01 /data/TEST/derivatives/FreeSurfer/sub-01/mri/T1.mgz /data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/ws.mgz

Running subprocess: mri_watershed -useSRAS -surf /data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/sub-01 /data/TEST/derivatives/FreeSurfer/sub-01/mri/T1.mgz /data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/ws.mgz
Mode:          use surfaceRAS to save surface vertex positions
Mode:          Saving out BEM surfaces

*********************************************************
The input file is /data/TEST/derivatives/FreeSurfer/sub-01/mri/T1.mgz
The output file is /data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/ws.mgz

*************************WATERSHED**************************
Sorting...
      T1-weighted MRI image
      modification of the preflooding height to 15 percent
      Count how many 110 voxels are present :  313159

      Find the largest 110-component...
             heap usage = 2414996 Kbytes.
             current max segment has 236187 voxels
             removing small segments (less than 1 percent of maxarea).
             heap usage = 2201964 Kbytes.
             removing small segments (less than 1 percent of maxarea).done
      And identify it as the main brain basin...done
      Main component: 236187 voxels
      first estimation of the COG coord: x=128 y=111 z=102 r=85
      first estimation of the main basin volume: 2628051 voxels
      global maximum in x=151, y=88, z=61, Imax=255
      CSF=21, WM_intensity=110, WM_VARIANCE=5
      WM_MIN=110, WM_HALF_MIN=110, WM_HALF_MAX=110, WM_MAX=110 
      preflooding height equal to 15 percent
done.
Analyze...

      main basin size= 3041424 voxels, voxel volume =1.000 
                     = 3041424 mmm3 = 3041.424 cm3
done.
PostAnalyze...
      ***** 0 basin(s) merged in 1 iteration(s)
      ***** 0 voxel(s) added to the main basin
done.

****************TEMPLATE DEFORMATION****************
Traceback (most recent call last):
  File "py_watershed.py", line 5, in <module>
    make_watershed_bem(subject='sub-01', subjects_dir='/data/TEST/derivatives/FreeSurfer', overwrite=True)
  File "<decorator-gen-74>", line 12, in make_watershed_bem
  File "/home/mri/anaconda3/envs/mri/lib/python3.7/site-packages/mne/bem.py", line 1283, in make_watershed_bem
    run_subprocess_env(cmd)
  File "<decorator-gen-2>", line 12, in run_subprocess
  File "/home/mri/anaconda3/envs/mri/lib/python3.7/site-packages/mne/utils/misc.py", line 203, in run_subprocess
    p.returncode, command, output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['mri_watershed', '-useSRAS', '-surf', '/data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/sub-01', '/data/TEST/derivatives/FreeSurfer/sub-01/mri/T1.mgz', '/data/TEST/derivatives/FreeSurfer/sub-01/bem/watershed/ws.mgz']' died with <Signals.SIGSEGV: 11>.

I also tried directly use command-line to process make_ watershed_ bem,and I got the same wrong message. $SUBJECTS_DIR no problem.

mne watershed_bem --overwrite --subject sub-01

I cannot search for and solve this problem. It looks like something wrong with subprocess that watershed_bem must use.Maybe the issue can be solved like mentioned in this post:

But I still cant solve my issue here.I hope I could get some help. Thank you all very much!!