<div dir="ltr">Hi Everyone,<div><br></div><div>New to fieldtrip. My headmodel looks pretty good except for a couple vertices that are poking in. Is there any way to address them specifically? The code I used is similar to one provided by someone who was successful. As follows</div><div><br></div><div><div>mri.coordsys        ='SPM'</div><div>cfg                 = [];</div><div>cfg.brainthreshold  = 0.15;</div><div>cfg.scalpthreshold  = 0.3;</div><div>cfg.downsample      = 1; %no downsampling</div><div>cfg.output          = {'brain' 'scalp' 'skull'};</div><div>segment                 = ft_volumesegment(cfg, mri);</div></div><div><br></div><div><div>cfg = [];</div><div>cfg.method = 'projectmesh';</div><div>cfg.numvertices = 10000;</div><div>bnd = ft_prepare_mesh( cfg, seg);</div><div><br></div><div>% fix mesh</div><div>[ bnd( 1).pnt, bnd( 1).tri] = meshresample( bnd( 1).pnt, bnd( 1).tri, 1000/size( bnd( 1).pnt, 1));</div><div>[ bnd( 2).pnt, bnd( 2).tri] = meshresample( bnd( 2).pnt, bnd( 2).tri, 2000/size( bnd( 2).pnt, 1));</div><div>[ bnd( 3).pnt, bnd( 3).tri] = meshresample( bnd( 3).pnt, bnd( 3).tri, 3000/size( bnd( 3).pnt, 1));</div><div>for ii = 1:size( bnd),</div><div>    [ bnd( ii).pnt, bnd( ii).tri] = meshcheckrepair( bnd( ii).pnt, bnd( ii).tri, 'dup');</div><div>    [ bnd( ii).pnt, bnd( ii).tri] = meshcheckrepair( bnd( ii).pnt, bnd( ii).tri, 'isolated');</div><div>    [ bnd( ii).pnt, bnd( ii).tri] = meshcheckrepair( bnd( ii).pnt, bnd( ii).tri, 'deep');</div><div>    [ bnd( ii).pnt, bnd( ii).tri] = meshcheckrepair( bnd( ii).pnt, bnd( ii).tri, 'meshfix');</div><div>end</div><div><br></div><div>% calculate headmodel % reordered to brain skull scalp</div><div>cfg = [];</div><div>cfg.method = 'bemcp'; %openmeeg doesnt work with multiple output from ft_volumesegment</div><div>vol = ft_prepare_headmodel(cfg, bnd);</div><div>clear bnd</div></div><div><br></div><div><br></div><div>Thanks!</div><div><br></div></div>