<div dir="ltr">Hi <span style="font-size:13px">Jan-Mathijs,</span><div>I managed to get the ft_electoderealign to work after some debugging, which involved commenting out parts of the script. Could you take a look at the two images I've attached. The first is my volume conduction model and the sensors before realignment (unaligned.fig) and the second is after realignment (aligned.fig). </div><div>any idea why the MRI markers which were used as the template (green) are so far apart from the MEG marker coil positions( red)? also it seems that before realignment everything looks okay, but how is that possible if my volume conduction model is in CTF and my MEG sensors are not?</div><div>thanks</div><div>Ainsley</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 8, 2017 at 12:15 PM, Schoffelen, J.M. (Jan Mathijs) <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hi Ainsley,
<div><br>
</div>
<div>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><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div><div><div class="h5">
<div><br>
</div>
<div> <br>
<div>
<blockquote type="cite">
<div>On 08 Mar 2017, at 09:03, Ainsley Temudo <<a href="mailto:ainsley.temudo@nyu.edu" target="_blank">ainsley.temudo@nyu.edu</a>> wrote:</div>
<br class="m_-312920127925551152Apple-interchange-newline">
<div>
<div dir="ltr">Hi <span style="font-size:13px">Jan-Mathijs</span>
<div>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>'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><br>
</div>
<div>I've been following this page to do the realignment. </div>
<div><br>
</div>
<div><a href="http://www.fieldtriptoolbox.org/getting_started/yokogawa?s[]=yokogawa" target="_blank">http://www.fieldtriptoolbox.<wbr>org/getting_started/yokogawa?<wbr>s[]=yokogawa</a><br>
</div>
<div><br>
</div>
<div>if I use sensorrealign how should I deal with these error messages? </div>
<div><br>
</div>
<div>
<div style="font-size:13px">Undefined function or variable 'lab'.</div>
<div style="font-size:13px"><br>
</div>
<div style="font-size:13px">Error in channelposition (line 314)</div>
<div style="font-size:13px">n   = size(lab,2);</div>
<div style="font-size:13px"><br>
</div>
<div style="font-size:13px">Error in ft_datatype_sens (line 328)</div>
<div style="font-size:13px">        [chanpos, chanori, lab] = channelposition(sens);</div>
<div style="font-size:13px"><br>
</div>
<div style="font-size:13px">Error in ft_sensorrealign (line 212)</div>
<div style="font-size:13px">elec_original = ft_datatype_sens(elec_original<wbr>); % ensure up-to-date sensor description (Oct 2011)</div>
</div>
<div style="font-size:13px"><br>
</div>
<div style="font-size:13px"><br>
</div>
<div style="font-size:13px">is there another way to realign my anatomical with my MEG sensors without using ft_sensorrealign?</div>
<div style="font-size:13px"><br>
</div>
<div style="font-size:13px">Thanks,</div>
<div style="font-size:13px">Ainsley </div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Mar 8, 2017 at 11:26 AM, Schoffelen, J.M. (Jan Mathijs)
<span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi Ainsley,
<div><br>
</div>
<div>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><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap:break-word">J.M.Schoffelen, MD PhD<br>
Senior Researcher, VIDI-fellow - PI, language in interaction<br>
Telephone: <a href="tel:+31%2024%20361%204793" value="+31243614793" target="_blank">
+31-24-3614793</a></div>
<div style="word-wrap:break-word">Physical location: room 00.028</div>
<div style="word-wrap:break-word">Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite">
<div>
<div class="m_-312920127925551152h5">
<div>On 08 Mar 2017, at 07:52, Ainsley Temudo <<a href="mailto:ainsley.temudo@nyu.edu" target="_blank">ainsley.temudo@nyu.edu</a>> wrote:</div>
<br class="m_-312920127925551152m_-4831077437308618983Apple-interchange-newline">
</div>
</div>
<div>
<div>
<div class="m_-312920127925551152h5">
<div dir="ltr">
<div>Hi FieldTrip Experts,</div>
<div><br>
</div>
<div>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><br>
</div>
<div>first I read in my MRI and determine the coordinate system which is LPS.</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
mriunknown = ft_read_mri(<span style="color:rgb(178,69,243)">'WMCP1011+22+t1mpr<wbr>age.nii'</span>);</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
mri = ft_determine_coordsys(mriunkno<wbr>wn, <span style="color:rgb(178,69,243)">
'interactive'</span>,<span style="color:rgb(178,69,243)">'yes'</span>)</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<br>
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<span style="font-family:arial,sans-serif;font-size:small"> next I realign to the CTF coordinate system by marking the NAS LPA, RPA </span><br>
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<span style="font-family:arial,sans-serif;font-size:small"><br>
</span></div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
cfg = [];</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
cfg.method = <span style="color:rgb(178,69,243)">'interactive'</span>;</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
cfg.coordsys = <span style="color:rgb(178,69,243)">'ctf'</span>;</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
</p>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
mri_ctf = ft_volumerealign(cfg, mir);</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<br>
</div>
<div style="margin:0px;line-height:normal">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">
<span><br>
</span></div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<span>grad=ft_read_sens(</span><span style="color:rgb(178,69,243)">'srcLocTest0<wbr>1_FT_01.con'</span><span>);</span><br>
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px">
 <br class="m_-312920127925551152m_-4831077437308618983webkit-block-placeholder">
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px">
 <br class="m_-312920127925551152m_-4831077437308618983webkit-block-placeholder">
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
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">
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">
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">
 <br class="m_-312920127925551152m_-4831077437308618983webkit-block-placeholder">
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
grad.fid.label = {<span style="color:rgb(178,69,243)">'NAS'</span> <span style="color:rgb(178,69,243)">'LPA'</span> <span style="color:rgb(178,69,243)">'RPA'</span>};</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<br>
</div>
<div style="margin:0px;line-height:normal;min-height:12px">I then put the template marker point cordinates  into the configuration which were taken from the mri_ctf <br>
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
<br>
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
cfg = [];</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
cfg.method = <span style="color:rgb(178,69,243)">'fiducial'</span>;</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
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">
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">
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">
 <br class="m_-312920127925551152m_-4831077437308618983webkit-block-placeholder">
</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
cfg.target.label = {<span style="color:rgb(178,69,243)">'NAS'</span> <span style="color:rgb(178,69,243)">
'LPA'</span> <span style="color:rgb(178,69,243)">'RPA'</span>};</div>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px">
 <br class="m_-312920127925551152m_-4831077437308618983webkit-block-placeholder">
</div>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
</p>
<div style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
grad_aligned = ft_sensorrealign(cfg, grad);</div>
</div>
<div><br>
</div>
<div>when I use ft_sensorrealign I get the following errors  :</div>
<div><br>
</div>
<div>
<div>Undefined function or variable 'lab'.</div>
<div><br>
</div>
<div>Error in channelposition (line 314)</div>
<div>n   = size(lab,2);</div>
<div><br>
</div>
<div>Error in ft_datatype_sens (line 328)</div>
<div>        [chanpos, chanori, lab] = channelposition(sens);</div>
<div><br>
</div>
<div>Error in ft_sensorrealign (line 212)</div>
<div>elec_original = ft_datatype_sens(elec_original<wbr>); % ensure up-to-date sensor description (Oct 2011)</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>when I use ft_electroderealign I get the following errors: </div>
<div><br>
</div>
<div>
<div>Error using ft_fetch_sens (line 192)</div>
<div>no electrodes or gradiometers specified.</div>
<div><br>
</div>
<div>Error in ft_electroderealign (line 195)</div>
<div>  elec_original = ft_fetch_sens(cfg);</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Hope you can help me figure out why I'm getting these errors.</div>
<div>Thanks,</div>
<div>Ainsley </div>
</div>
</div>
</div>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br>
</div>
<br>
<br>
<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">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
J.M.Schoffelen, MD PhD<br>
Senior Researcher, VIDI-fellow - PI, language in interaction<br>
Telephone: <a href="tel:+31%2024%20361%204793" value="+31243614793" target="_blank">
+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">
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">
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br>
<br>
<br>
</div>
</div>
</div>
</div>
<br>
</div>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_-312920127925551152gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<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)">
<b>Ainsley Temudo</b><br>
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)">
Sreenivasan Lab<br>
NYU Abu Dhabi<br>
Office Tel (UAE): <a href="tel:+971%202%20628%204764" value="+97126284764" target="_blank">+971 2 628 4764</a><br>
Mobile (UAE): <a href="tel:+971%2056%20664%206952" value="+971566646952" target="_blank">+971 56 664 6952</a><br>
</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)"><br>
NYU Abu Dhabi, Saadiyat Campus<br>
P.O. Box 129188<br>
Abu Dhabi, United Arab Emirates</span></div>
</div>
</div>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br>
</div>
</div></div></div>

<br>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><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)"><b>Ainsley Temudo</b><br>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)">Sreenivasan Lab<br>NYU Abu Dhabi<br>Office Tel (UAE): +971 2 628 4764<br>Mobile (UAE): +971 56 664 6952<br></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)"><br>NYU Abu Dhabi, Saadiyat Campus<br>P.O. Box 129188<br>Abu Dhabi, United Arab Emirates</span></div></div>
</div>