<div dir="ltr"><div><div><div><div><div><div>Hi Jia,<br></div>Thanks so much for getting back to me. If you have a free moment, would you mind looking over my code? I have tried the tutorial steps many times, even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',  but seem to keep getting the same incorrect results.<br><br>% ALIGN ELECTRODES TO STANDARD_BEM<br><br>% read electrode coordinates<br>elec = ft_read_sens('GSN-HydroCel-129.sfp');<br><br>% convert units to mm to match units of headmodel<br>elec = ft_convert_units(elec, 'mm');<br><br>% change label of fiducials<br>elec.label{1} = 'Nz';<br>elec.label{2} = 'LPA'<br>elec.label{3} = 'RPA';<br><br>% create fiducial structure<br>% draw fiducial coordinates from mri<br>nas = standard_mri.hdr.fiducial.mri.nas;<br>lpa = standard_mri.hdr.fiducial.mri.lpa;<br>rpa = standard_mri.hdr.fiducial.mri.rpa;<br> <br>transm = standard_mri.transform;<br> <br>nas = ft_warp_apply(transm, nas, 'homogenous');<br>lpa = ft_warp_apply(transm, lpa, 'homogenous');<br>rpa = ft_warp_apply(transm, rpa, 'homogenous');<br><br>% create a structure similar to a template set of electrodes<br>fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials<br>fid.label = {'Nz','LPA','RPA'}; % same labels as in elec <br>fid.unit = 'mm'; % same units as mri<br> <br>% alignment<br>cfg = [];<br>cfg.method = 'fiducial';            <br>cfg.template = fid; % see above<br>cfg.elec = elec;<br>cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec<br>elec_aligned = ft_electroderealign(cfg);<br><br>% plot to check<br>figure;<br>ft_plot_mesh(standard_bem.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); <br>hold on;<br>ft_plot_sens(elec_aligned,'style', 'sk');<br><br></div>For reference, the coordinates I get in the structure fid are the following:<br>fid = <br><br>    chanpos: [3x3 double]<br>      label: {'Nz'  'LPA'  'RPA'}<br>       unit: 'mm'<br><br>fid.chanpos<br><br>ans =<br><br>    35   -36     0<br>   118   -35     0<br>   -82   -35     0<br><br><br></div>If those are different from yours, would you let me know? I'm trying to find out at which step I went wrong. <br></div>Again, thank you very much!<br><br></div>Best,<br></div>Helen<br><div><div><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <span dir="ltr"><<a href="mailto:jia.wu@yale.edu" target="_blank">jia.wu@yale.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Helen,
<div><br>
<div>What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i
 suspect that alignment did not happen. </div>
<div><br>
</div>
<div>I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called '<font size="2">FidNz', 'FidT9', 'FidT10', instead of <span style="text-align:justify;white-space:pre-wrap;background-color:rgb(247,249,250)">'Nz','LPA','RPA'
 as in the tutorial. So they need to be changed. Then the alignment should work.</span></font></div>
<div><br>
</div>
<div style="text-align:justify"><font size="2"><span style="white-space:pre-wrap;background-color:rgb(247,249,250)">best,</span></font></div>
<div style="text-align:justify"><font size="2"><span style="white-space:pre-wrap;background-color:rgb(247,249,250)">-jia</span></font></div>
<div><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" color="#000000" size="2"><b>From:</b> <a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a> [<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>] on behalf of Helen Wieffering [<a href="mailto:helen.wieffering@gmail.com" target="_blank">helen.wieffering@gmail.com</a>]<br>
<b>Sent:</b> Monday, September 14, 2015 4:46 PM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> [FieldTrip] Aligning electrodes to template head model<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">
<div>
<div>
<div>Hello all,<br>
<br>
</div>
I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server.
<br>
<br>
</div>
<div>Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri,
 I get very strange results: (image below and attached)<br>
<br>
<img alt="Inline image 1" src="cid:ii_14fcd98ad69b9786" style="margin-right:0px" height="251" width="334"> <br>
<br>
I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes.
<br>
I've been following the tutorial at <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=" target="_blank">
http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg</a> and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.<br>
</div>
<br>
</div>
Any help is appreciated - thanks in advance!<br>
<div>
<div><br>
</div>
<div>Helen Wieffering<br>
</div>
<div>Bowdoin College<br>
</div>
</div>
</div>
</div>
</div></div></div>
</div>
</div>
</div>
</div>

<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>