<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</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="">I have never worked with ‘yokogawa’ data myself, so I can’t be of much help. The documentation you point to is already several years old, and appears not to have been actively maintained. Most likely the error you get is caused by incompatibility
 between the current version of the FieldTrip code, and the example code provided. Perhaps someone that has recently done coregistration between anatomical data and yokogawa data can chime in?</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>
<blockquote type="cite" class="">
<div class="">On 08 Mar 2017, at 09:03, 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="">Hi <span style="font-size:13px" class="">Jan-Mathijs</span>
<div class="">Thanks for getting back to me so quickly. I originally used Ft_sensoralign, but I got the error messages one of which said </div>
<div class="">'FT_SENSORREALIGN is deprecated, please use FT_ELECTRODEREALIGN instead' so thats why I used electrode realign instead, even though it's MEG data.  </div>
<div class=""><br class="">
</div>
<div class="">I've been following this page to do the realignment. </div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.fieldtriptoolbox.org/getting_started/yokogawa?s[]=yokogawa" class="">http://www.fieldtriptoolbox.org/getting_started/yokogawa?s[]=yokogawa</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">if I use sensorrealign how should I deal with these error messages? </div>
<div class=""><br class="">
</div>
<div class="">
<div style="font-size:13px" class="">Undefined function or variable 'lab'.</div>
<div style="font-size:13px" class=""><br class="">
</div>
<div style="font-size:13px" class="">Error in channelposition (line 314)</div>
<div style="font-size:13px" class="">n   = size(lab,2);</div>
<div style="font-size:13px" class=""><br class="">
</div>
<div style="font-size:13px" class="">Error in ft_datatype_sens (line 328)</div>
<div style="font-size:13px" class="">        [chanpos, chanori, lab] = channelposition(sens);</div>
<div style="font-size:13px" class=""><br class="">
</div>
<div style="font-size:13px" class="">Error in ft_sensorrealign (line 212)</div>
<div style="font-size:13px" class="">elec_original = ft_datatype_sens(elec_<wbr class="">original); % ensure up-to-date sensor description (Oct 2011)</div>
</div>
<div style="font-size:13px" class=""><br class="">
</div>
<div style="font-size:13px" class=""><br class="">
</div>
<div style="font-size:13px" class="">is there another way to realign my anatomical with my MEG sensors without using ft_sensorrealign?</div>
<div style="font-size:13px" class=""><br class="">
</div>
<div style="font-size:13px" class="">Thanks,</div>
<div style="font-size:13px" class="">Ainsley </div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Wed, Mar 8, 2017 at 11:26 AM, Schoffelen, J.M. (Jan Mathijs)
<span dir="ltr" class=""><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank" class="">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" 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" class="">J.M.Schoffelen, MD PhD<br class="">
Senior Researcher, VIDI-fellow - PI, language in interaction<br class="">
Telephone: <a href="tel:+31%2024%20361%204793" value="+31243614793" target="_blank" class="">
+31-24-3614793</a></div>
<div style="word-wrap:break-word" class="">Physical location: room 00.028</div>
<div style="word-wrap:break-word" 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 class="">
<blockquote type="cite" class="">
<div class="">
<div class="h5">
<div class="">On 08 Mar 2017, at 07:52, Ainsley Temudo <<a href="mailto:ainsley.temudo@nyu.edu" target="_blank" class="">ainsley.temudo@nyu.edu</a>> wrote:</div>
<br class="m_-4831077437308618983Apple-interchange-newline">
</div>
</div>
<div class="">
<div class="">
<div class="h5">
<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+<wbr class="">t1mprage.nii'</span>);</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier" class="">
mri = ft_determine_coordsys(<wbr class="">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 class=""><br class="">
</span></div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier" class="">
<span class="">grad=ft_read_sens(</span><span style="color:rgb(178,69,243)" class="">'<wbr class="">srcLocTest01_FT_01.con'</span><span class="">);</span><br class="">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier; min-height: 12px;" class="">
 <br class="m_-4831077437308618983webkit-block-placeholder">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier; min-height: 12px;" class="">
 <br class="m_-4831077437308618983webkit-block-placeholder">
</div>
<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>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier; min-height: 12px;" class="">
 <br class="m_-4831077437308618983webkit-block-placeholder">
</div>
<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>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier; min-height: 12px;" class="">
 <br class="m_-4831077437308618983webkit-block-placeholder">
</div>
<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>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: courier; min-height: 12px;" class="">
 <br class="m_-4831077437308618983webkit-block-placeholder">
</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="">
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_<wbr class="">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>
</div>
</div>
______________________________<wbr class="">_________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" class="">https://mailman.science.ru.nl/<wbr class="">mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<br class="">
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
J.M.Schoffelen, MD PhD<br class="">
Senior Researcher, VIDI-fellow - PI, language in interaction<br class="">
Telephone: <a href="tel:+31%2024%20361%204793" value="+31243614793" target="_blank" class="">
+31-24-3614793</a></div>
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
Physical location: room 00.028</div>
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br class="">
<br class="">
<br class="">
</div>
</div>
</div>
</div>
<br class="">
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">https://mailman.science.ru.nl/<wbr class="">mailman/listinfo/fieldtrip</a><br class="">
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,Tahoma,sans-serif;font-size:12px;font-stretch:inherit;line-height:16px;vertical-align:baseline;color:rgb(64,63,71)" class="">
<b class="">Ainsley Temudo</b><br class="">
Research Assistant </div>
<div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,Tahoma,sans-serif;font-size:12px;font-stretch:inherit;line-height:16px;vertical-align:baseline;color:rgb(64,63,71)" class="">
Sreenivasan Lab<br class="">
NYU Abu Dhabi<br class="">
Office Tel (UAE): +971 2 628 4764<br class="">
Mobile (UAE): +971 56 664 6952<br class="">
</div>
<span title="Saadiyat" style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,Tahoma,sans-serif;font-size:12px;font-stretch:inherit;line-height:16px;vertical-align:baseline;display:block;color:rgb(64,63,71)" class=""><br class="">
NYU Abu Dhabi, Saadiyat Campus<br class="">
P.O. Box 129188<br class="">
Abu Dhabi, United Arab Emirates</span></div>
</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>
</body>
</html>