mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.7k stars 1.31k forks source link

Problems with 3 layer BEM surfaces (mne_watershed_bem) #5874

Closed Bromem1 closed 5 years ago

Bromem1 commented 5 years ago

Hi,

We have been trying to make 3 layer BEM surfaces (inner_skull, outer_skull and outer_skin) with mne_watershed_bem. However, when we visualize the obtained surfaces we can see a problem with the outer skull surface. It does not follow the same pattern as the inner skull surface, instead it looks like the skin surface. This result is very different from what you have here: https://martinos.org/mne/stable/auto_tutorials/plot_forward.html. Do you happen to know what might cause this problem? Could it be something related to the segmentation process? Any ideas?

Command used: mne_watershed_bem -atlas -useSRAS -surf

Here's also the log output

Running mri_watershed for BEM segmentation with the following parameters

SUBJECTS_DIR = /m/nbe/scratch/alex/private/maria/alex/anatomical
Subject      = d3a
Result dir   = /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/bem/watershed

Temporary files removed.

Mode:          use surfaceRAS to save surface vertex positions
Mode:          Saving out BEM surfaces

*********************************************************
The input file is /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz
The output file is /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/bem/watershed/ws

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

      Find the largest 110-component...
             heap usage = 328044 Kbytes.
             current max segment has 134832 voxels
             removing small segments (less than 1 percent of maxarea).
             heap usage = 328044 Kbytes.
             removing small segments (less than 1 percent of maxarea).done
      And identify it as the main brain basin...done
      Main component: 134832 voxels
      first estimation of the COG coord: x=126 y=88 z=118 r=94
      first estimation of the main basin volume: 3540870 voxels
      global maximum in x=146, y=79, z=77, Imax=255
      CSF=18, 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= 1602755 voxels, voxel volume =1.000 
                     = 1602755 mmm3 = 1602.755 cm3
done.
PostAnalyze...
      ***** 0 basin(s) merged in 1 iteration(s)
      ***** 0 voxel(s) added to the main basin
done.

****************TEMPLATE DEFORMATION****************

      second estimation of the COG coord: x=128,y=97, z=112, r=10062 iterations
^^^^^^^^ couldn't find WM with original limits - expanding ^^^^^^

   GLOBAL      CSF_MIN=1, CSF_intensity=2, CSF_MAX=37 , nb = 45189
 Problem with the least square interpolation in GM_MIN calculation.

                     CSF_MAX  TRANSITION  GM_MIN  GM
    GLOBAL     
  before analyzing :    37,      45,        50,   70
  after  analyzing :    37,      48,        50,   53
      mri_strip_skull: done peeling brain
      highly tesselated surface with 10242 vertices
      matching...67 iterations

*********************VALIDATION*********************
curvature mean = -0.013, std = 0.011
curvature mean = 69.502, std = 7.497

No Rigid alignment: -atlas Mode Off (basic atlas / no registration)
      before rotation: sse = 1.86, sigma = 3.13
      after  rotation: sse = 1.86, sigma = 3.13
Localization of inacurate regions: Erosion-Dilation steps
      the sse mean is  1.86, its var is  2.39   
      before Erosion-Dilatation  0.03% of inacurate vertices
      after  Erosion-Dilatation  0.00% of inacurate vertices
      Validation of the shape of the surface done.
Scaling of atlas fields onto current surface fields

********FINAL ITERATIVE TEMPLATE DEFORMATION********
Compute Local values csf/gray
Fine Segmentation...47 iterations

      mri_strip_skull: done peeling brain

Brain Size = 1659352 voxels, voxel volume = 1.000 mm3
           = 1659352 mmm3 = 1659.352 cm3

      outer skin surface matching...133 iterations

******************************
Saving /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/bem/watershed/ws
done
mri_watershed utimesec    502.752000
mri_watershed stimesec    0.428000
mri_watershed ru_maxrss   380600
mri_watershed ru_ixrss    0
mri_watershed ru_idrss    0
mri_watershed ru_isrss    0
mri_watershed ru_minflt   175777
mri_watershed ru_majflt   0
mri_watershed ru_nswap    0
mri_watershed ru_inblock  0
mri_watershed ru_oublock  35688
mri_watershed ru_msgsnd   0
mri_watershed ru_msgrcv   0
mri_watershed ru_nsignals 0
mri_watershed ru_nvcsw    7874
mri_watershed ru_nivcsw   8326
mri_watershed done

mne_convert_surface version 1.14 compiled at Jan  9 2014 04:23:07

surf input file       : d3a_brain_surface
surf output file      : d3a_brain_surface

Triangle file : created by bromane1 on Thu Jan 24 09:59:09 2019 nvert = 10242 ntri = 20480
Read d3a_brain_surface (10242 vertices 20480 triangles)
Reading /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz...[done]
Volume geometry information extracted from /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz
Did not ask to replace existing volume geometry

mne_convert_surface version 1.14 compiled at Jan  9 2014 04:23:07

surf input file       : d3a_inner_skull_surface
surf output file      : d3a_inner_skull_surface

Triangle file : created by bromane1 on Thu Jan 24 09:59:10 2019 nvert = 10242 ntri = 20480
Read d3a_inner_skull_surface (10242 vertices 20480 triangles)
Reading /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz...[done]
Volume geometry information extracted from /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz
Did not ask to replace existing volume geometry

mne_convert_surface version 1.14 compiled at Jan  9 2014 04:23:07

surf input file       : d3a_outer_skull_surface
surf output file      : d3a_outer_skull_surface

Triangle file : created by bromane1 on Thu Jan 24 10:02:41 2019 nvert = 10242 ntri = 20480
Read d3a_outer_skull_surface (10242 vertices 20480 triangles)
Reading /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz...[done]
Volume geometry information extracted from /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz
Did not ask to replace existing volume geometry

mne_convert_surface version 1.14 compiled at Jan  9 2014 04:23:07

surf input file       : d3a_outer_skin_surface
surf output file      : d3a_outer_skin_surface

Triangle file : created by bromane1 on Thu Jan 24 10:02:41 2019 nvert = 10242 ntri = 20480
Read d3a_outer_skin_surface (10242 vertices 20480 triangles)
Reading /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz...[done]
Volume geometry information extracted from /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/mri/T1.mgz
Did not ask to replace existing volume geometry

mne_surf2bem version 1.8 compiled at Jan  9 2014 04:22:52

input  file #   1 : /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/bem/watershed/d3a_outer_skin_surface / id = 4 / sigma N/A
output file       : d3a-head.fif

Triangle file : created by bromane1 on Thu Jan 24 10:02:41 2019 nvert = 10242 ntri = 20480
    Triangle and vertex normals and neighboring triangles...[done]
    Vertex neighbors...[done]
    Distances between neighboring vertices...[61440 distances done]
/m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/bem/watershed/d3a_outer_skin_surface read. id = 4

Topology checks skipped.
d3a-head.fif written.
Created /m/nbe/scratch/alex/private/maria/alex/anatomical/d3a/bem/d3a-head.fif

Complete.`

Thanks a lot! Emilia

agramfort commented 5 years ago

yes it's expected. The one on sample looks better because it's using MRI flash contrast image as extra image (not just watershed that works with T1 image)

Bromem1 commented 5 years ago

Thank you for your answer. Is it still possible to use an outer skull surface (made with watershed) like this in eeg source modelling?

agramfort commented 5 years ago

many people have used such models for EEG. I would not worry about this.

Bromem1 commented 5 years ago

Okay! Thank you!

agramfort commented 5 years ago

note for next time, please use the mailing list to ask usage question:

https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

thanks