<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Dear all,<br><br>I have trouble finding the right alignment for my head models and individual grids<br>with the MEG channel array.<br><br>The code I use is the following:<br><br>addpath('/data/common/FieldtripCurrent/fieldtrip-20120105/');<br>addpath('/data/common/FieldtripCurrent/fieldtrip-20120105/fieltdrip_private/');<br>ft_defaults;<br><br>spm2path = '/data/common/FieldtripCurrent/fieldtrip-20120105/external/spm2/';<br>spm8path = '/data/common/FieldtripCurrent/fieldtrip-20120105/external/spm8/';<br><br>rmpath(spm2path,spm8path);<br><br><br>mri = ft_read_mri('ID_V2.mri');<br><br>cfg = [];<br>cfg.coordsys = 'ctf';<br>seg = ft_volumesegment(cfg,mri);<br><br>cfg = [];<br>hdm = ft_prepare_singleshell(cfg,seg);<br><br>cfg = [];<br>cfg.template = '/data/common/SPM8current/spm8/canonical/single_subj_T1.nii';<br>cfg.coordsys = 'ctf';<br>cfg.nonlinear = 'no';<br><br>norm = ft_volumenormalise(cfg,mri);<br><br>load template_grid.mat % template created from the SPM8 single_subj_T1.nii template located in the canonical folder of SPM8<br><br>grid = [];<br>grid.pos = warp_apply(inv(norm.cfg.final), template_grid.pos, 'homogenous')/10;<br>grid.inside = template_gird.inside;<br>grid.outside = template_grid.outside;<br><br>transfrom_ctf2spm = norm.cfg.final;<br><br>figure;<br>hold on;<br>ft_plot_sens(ft_read_sens('ID.ds'));<br>ft_plot_vol(hdm);<br>ft_plot_mesh(grid.pos(grid.inside,:));<br><br><br>Would be great if you could help me to figure out what is going wrong here.<br><br>Best,<br>Fred<br><br><br>-- <br>Frédéric Roux, PhD student<br>Department of Neurophysiology<br>Max Planck Institute for Brain Research<br>D-60529 Frankfurt am Main<br>Frederic.Roux@brain.mpg.de<br>+49(0)69630183225<br><br><br>                                        </div></body>
</html>