<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Ainsley,
<div class=""><br class="">
</div>
<div class="">Why would you want to use sensorrealign/electroderealign since you have MEG-data? The former functions may be needed for EEG electrodes, not for MEG sensors.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
J.M.Schoffelen, MD PhD<br class="">
Senior Researcher, VIDI-fellow - PI, language in interaction<br class="">
Telephone: +31-24-3614793</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Physical location: room 00.028</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br class="">
</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 08 Mar 2017, at 07:52, Ainsley Temudo <<a href="mailto:ainsley.temudo@nyu.edu" class="">ainsley.temudo@nyu.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Hi FieldTrip Experts,</div>
<div class=""><br class="">
</div>
<div class="">I am trying to perform source reconstruction, and I am having trouble with coregistering my anatomical with the sensors. The MEG system we're using is Yokogawa and the anatomical is a NIFTI file. I get some errors when using  ft_sensorrealign
 and ft_electroderealign. I will go through the steps I took before getting to this stage, as maybe I have done something wrong. </div>
<div class=""><br class="">
</div>
<div class="">first I read in my MRI and determine the coordinate system which is LPS.</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
mriunknown = ft_read_mri(<span style="color:rgb(178,69,243)" class="">'WMCP1011+22+t1mprage.nii'</span>);</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
mri = ft_determine_coordsys(mriunknown, <span style="color:rgb(178,69,243)" class="">
'interactive'</span>,<span style="color:rgb(178,69,243)" class="">'yes'</span>)</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<span style="font-family:arial,sans-serif;font-size:small" class=""> next I realign to the CTF coordinate system by marking the NAS LPA, RPA </span><br class="">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<span style="font-family:arial,sans-serif;font-size:small" class=""><br class="">
</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.method = <span style="color:rgb(178,69,243)" class="">'interactive'</span>;</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.coordsys = <span style="color:rgb(178,69,243)" class="">'ctf'</span>;</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier" class="">
</p>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
mri_ctf = ft_volumerealign(cfg, mir);</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<br class="">
</div>
<div style="margin: 0px; line-height: normal;" class="">I read in the sensor information and added in the coordinates for the marker positions. we have five marker positions, the three I picked were the left and right ear markers and the middle forehead marker.
  </div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<span style="" class=""><br class="">
</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<span style="" class="">grad=ft_read_sens(</span><span style="color:rgb(178,69,243)" class="">'srcLocTest01_FT_01.con'</span><span style="" class="">);</span><br class="">
</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px" class="">
 <br class="webkit-block-placeholder">
</p>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
grad.fid.pnt(1,:) = [96.07 3.11 -5.32]./10;</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
grad.fid.pnt(2,:) = [11.13 75.50 -78.23]./10;</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
grad.fid.pnt(3,:) = [8.50 -75.09 -64.60]./10;</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
grad.fid.label = {<span style="color:rgb(178,69,243)" class="">'NAS'</span> <span style="color:rgb(178,69,243)" class="">'LPA'</span> <span style="color:rgb(178,69,243)" class="">'RPA'</span>};</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<br class="">
</div>
<div style="margin: 0px; line-height: normal; min-height: 12px;" class="">I then put the template marker point cordinates  into the configuration which were taken from the mri_ctf <br class="">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.method = <span style="color:rgb(178,69,243)" class="">'fiducial'</span>;</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.target.pnt(1,:) = [91.1 3.0 49.2]./10;</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.target.pnt(2,:) = [-0.1 70.5 0.0]./10;</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.target.pnt(3,:) = [0.1 -70.5 0.0]./10;</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
cfg.target.label = {<span style="color:rgb(178,69,243)" class="">'NAS'</span> <span style="color:rgb(178,69,243)" class="">
'LPA'</span> <span style="color:rgb(178,69,243)" class="">'RPA'</span>};</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px" class="">
 <br class="webkit-block-placeholder">
</p>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier" class="">
</p>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier;" class="">
grad_aligned = ft_sensorrealign(cfg, grad);</div>
</div>
<div class=""><br class="">
</div>
<div class="">when I use ft_sensorrealign I get the following errors  :</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">Undefined function or variable 'lab'.</div>
<div class=""><br class="">
</div>
<div class="">Error in channelposition (line 314)</div>
<div class="">n   = size(lab,2);</div>
<div class=""><br class="">
</div>
<div class="">Error in ft_datatype_sens (line 328)</div>
<div class="">        [chanpos, chanori, lab] = channelposition(sens);</div>
<div class=""><br class="">
</div>
<div class="">Error in ft_sensorrealign (line 212)</div>
<div class="">elec_original = ft_datatype_sens(elec_original); % ensure up-to-date sensor description (Oct 2011)</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">when I use ft_electroderealign I get the following errors: </div>
<div class=""><br class="">
</div>
<div class="">
<div class="">Error using ft_fetch_sens (line 192)</div>
<div class="">no electrodes or gradiometers specified.</div>
<div class=""><br class="">
</div>
<div class="">Error in ft_electroderealign (line 195)</div>
<div class="">  elec_original = ft_fetch_sens(cfg);</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Hope you can help me figure out why I'm getting these errors.</div>
<div class="">Thanks,</div>
<div class="">Ainsley </div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<br class="">
<div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
J.M.Schoffelen, MD PhD<br class="">
Senior Researcher, VIDI-fellow - PI, language in interaction<br class="">
Telephone: +31-24-3614793</div>
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Physical location: room 00.028</div>
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br class="">
<br class="">
<br class="">
</div>
</div>
</div>
</div>
<br class="">
</body>
</html>