<div dir="ltr"><div><div><div><div>       </div>Dear all<br><br></div>I have a problem that single subject headmodel and the warped its grid to template grid do not fit, as attached figure. I expected they are exactly fit each other but it seems not.<br>


<br>I generated this figure by following steps. MEG system is yokogawa.<br>Any advices I should check will be very helpful and appreciated.<br></div><br></div>Yuka<br><br><div>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><div><div>load('~\fieldtrip\template\sourcemodel\standard_sourcemodel3d10mm.mat')<br>


template_grid  = sourcemodel;<br><br>% Read mri data<br>mri2nifti('subject.mri', 'mri.nii');<br>mri_nifti = ft_read_mri('mri.nii');<br><br>% Define fiducial position in MRI coordinate<br>cfg = [];<br>


cfg.method = 'interactive';<br>mri = ft_volumerealign(cfg, mri_nifti); <br><br>% segment the anatomical MRI<br>cfg = [];<br>cfg.coordsys = 'ctf';<br>seg = ft_volumesegment(cfg, mri);<br><br>% construct volume conductor model (i.e. head model) for each subject<br>


cfg = [];<br>cfg.method = 'singleshell';<br>vol = ft_prepare_headmodel(cfg, seg);<br>vol = ft_convert_units(vol, 'cm');<br><br>% create the subject specific grid, using the template grid that has just been created<br>


cfg = [];<br>cfg.grid.warpmni   = 'yes';<br>cfg.grid.template  =  template_grid; %sourcemodel%<br>cfg.grid.nonlinear = 'yes'; % use non-linear normalization<br>cfg.mri            = mri;<br>grid               = ft_prepare_sourcemodel(cfg);<br>


<br>% make a figure of the single subject headmodel, and grid positions<br>figure;<br>ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4;<br>ft_plot_mesh(grid.pos(grid.inside,:),'vertexcolor','r');<img alt="Inline image 1" src="cid:ii_13ef930c4dddf789" height="327" width="437"><br>


<br>
</div></div></div></div>