<div dir="ltr">I think the neighborplot not working may have to do with the cfg.elec parameter not being set in ft_prepareneighbours, though I'm not sure why you don't get the error there. You should try contacting the manufacturer, otherwise you may have to make the electrode positions manually. As I mentioned, I was able to take the phi/theta coordinates provided by the manufacturer to determine the electrode positions, but if you have literally nothing to go by you may have to measure it by hand. If the electrodes are equidistant, finding the measurement between any two should be able to inform the position of all of them, otherwise I'm not sure what you could do.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 7:41 PM, Beom Jun Min <span dir="ltr"><<a href="mailto:mbj0310@gmail.com" target="_blank">mbj0310@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Dear <span style="font-family:arial,sans-serif;font-size:14px">Jörn and Max</span></div><div><br></div><div>Thank you for your help. <br></div><div>However, another error occurred.</div><div><br></div>
<div>
>>></div><div><div>cfg = [];</div><div>cfg.method = 'triangulation'; %'distance', 'triangulation' or 'template' (default = 'distance')</div><div>cfg.layout = lay; <br>
</div><div>cfg.channel = {'all', '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; </div><div class=""><div>cfg.feedback = 'yes';</div><div>neighbours = ft_prepare_neighbours(cfg);</div>
</div></div><div>>>> </div><div>These work successfully.</div><div><br></div><div>But</div><div>>>></div><div><div class=""><div>cfg = [];</div><div>cfg.neighbours = neighbours;</div><div>cfg.enableedit = 'yes';</div>
</div><div>neighbours = ft_neighbourplot(cfg);</div></div><div>>>></div><div><div>??? Error using ==> ft_fetch_sens at 179</div><div>no electrodes or gradiometers specified.</div><div><br></div><div>Error in ==> ft_neighbourplot at 85</div>
<div> sens = ft_fetch_sens(cfg);</div></div><div><br></div><div>In addition,</div><div>>>></div><div><div>cfg = [];</div><div>cfg.method = 'spline'; %'nearest', 'spline' or 'slap' (default='nearest')</div>
<div>cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for details<br></div><div>cfg.neighbours = neighbours; </div><div>cfg.trials = 'all';</div><div>% cfg.lambda = % regularisation parameter (default = 1e-5, not for method 'distance')</div>
<div>% cfg.order = % order of the polynomial interpolation (default = 4, not for method 'distance')</div><div>interpolated = ft_channelrepair(cfg, final)</div></div><div>>>> </div><div><div>??? Error using ==> ft_fetch_sens at 179</div>
<div>no electrodes or gradiometers specified.</div><div><br></div><div>Error in ==> ft_channelrepair at 112</div><div> sens = ft_fetch_sens(cfg, data);</div></div><div><br></div><div>It seems the problem is associated with position of electrode. But I do not have manufacture's file. </div>
<div>Do I have to make the positions of electrodes manually?</div><div>Actually, I do not understand the information from help<i> ft_datatype_sens, and ft_read_sens.</i> </div><div><br></div><div>With regards</div><div><br>
</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-06 23:19 GMT+09:00 Max Cantor <span dir="ltr"><<a href="mailto:mcantor@umich.edu" target="_blank">mcantor@umich.edu</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Alternatively, you could create a .sfp file for cfg.elecfile of the ft_channelrepair. If your channels are equidistant the equation for determining the neighbours should be fairly straightforward, as long as you have at least the phi and theta coordinates.<br>
<br>I talk about it in this thread:<br><a href="http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html</a><br>
<br></div>Here is the conclusion I came to: <br>
<br><pre>"For future reference, because I don't remember seeing anything on the
fieldtrip FAQ about this and it may be useful to somebody else, the
important thing is to turn the phi/theta from degrees into radians, and
then applying a trigonometric function to get the X, Y, and Z coordinates.
You can do all of these steps in 3 excel functions:
X = COS(RADIANS(Phi))*SIN(RADIANS(Theta))
Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi))
Z = =COS(RADIANS(Theta))
This link on the easycap website (
<a href="http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm" target="_blank">http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm</a>) explains the
coordinate system.
I then typed up the channel name, x, y, and z coordinates in a four column
notepad document saved as a .sfp file, and used that as my cfg.elecfile."
</pre>I'm not sure if this is your problem, but I didn't see a cfg.elecfile parameter in your code, so hopefully this helps.<br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" <span dir="ltr"><<a href="mailto:jm.horschig@donders.ru.nl" target="_blank">jm.horschig@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">Hi Beom,<br>
<br>
did your code produce an error?<br>
<br>
Generally, the 'template' method tries to look for already defined 'template' neighbours. However, as far as I understoog you only created a 'layout', which define where electrodes are placed, but not whether they are neighbours or not. I would advice you to use these settings:<br>
<br>
cfg = [];<br>
cfg.method = 'triangulation';<br>
cfg.layout = lay;<br>
cfg.channel = 'all'; % that way you only need to run this once for *all* your subjects<br>
cfg.feedback = 'yes';<br>
neighbours = ft_prepare_neighbours(cfg);<br>
<br>
Then, if you are unhappy with the result, for modifcation you can use<br>
cfg = [];<br>
cfg.neighbours = neighbours;<br>
cfg.enableedit = 'yes';<br>
neighbours = ft_neighboursplot(cfg);<br>
<br>
in that plot, you can click around to mark channels as being neighbours or not. When you are happy, save that neighbour structure and make sure to use it for all your subjects, so that there is no bias for individual subjects.<br>
<br>
Note that the data variable is used nowhere now, because that would cause missing sensors to be removed from the neighbour structure, but you probably do not want that (or if you do, then use it).<br>
<br>
And finally, yes, using preprocessed data is possible.<br>
<br>
Should you have any other questions, feel free to ask.<br>
<br>
Best,<br>
Jörn<div><div><br>
<br>
<br>
On 3/6/2014 2:09 AM, Beom Jun Min wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<br>
Hello<br>
<br>
I have a problem with channel repair.<br>
<br>
Firstly, I created my own layout because I cannot apply my data into the offered layout files.<br>
As far as I know, my EEG data was acquired through SynAmps 2 system with 128 electrodes, but I cannot find a suitable layout files.<br>
QuikCap_NSL_128 does not match either.<br>
<br>
Anyway, I created own customized layout, and usual preprocessing steps were done.<br>
However, there were some bad recording channels so I removed them during preprocessing.<br>
Moreover, the removed channels are different among the subjects, and now it becomes a big problem for analyzing the data.<br>
<br>
So I tried channel repair process, but encountered with errors.<br>
<br>
>>><br>
cfg = [];<br>
cfg.method = 'template';<br>
cfg.template = 'bj_plot.mat';<br>
cfg.layout = lay;<br>
cfg.channel = 'T7'; % channels for which neighbours should be found<br>
cfg.feedback = 'yes';<br>
neighbours = ft_prepare_neighbours(cfg, data);<br>
>>><br>
<br>
I think I have to use 'template' method because, there are some missing channels serially.<br>
And here are my question.<br>
Is it possible to assign my own layout in the cfg.template or cfg.layout? Actually at this step, I do not understand how to proceed.<br>
Also, there are many missing channels differ from each subject, but I am not sure which channels should be placed in the cfg.channel. (T7 is one of the missing channel in a subject in my case.)<br>
Finally, at 'data' field, is it possible to assign a finalized preprocessed data?<br>
<br>
And after ft_prepare_neighbours,<br>
<br>
>>><br>
cfg = [];<br>
cfg.method = 'spline'<br>
% cfg.badchannel = 'T7';<br>
cfg.missingchannel = 'T7';<br>
cfg.neighbours = neighbours;<br>
cfg.trials = 'all'<br>
interpolated = ft_channelrepair(cfg, data)<br>
<br>
Is that right?<br>
<br>
<br>
-- <br>
BeomJun Min, M.D.<br>
<br>
Department of Medical System Engineering (DMSE)<br>
Gwangju Institute of Science and Technology (GIST)<br>
261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju<br>
500-712, Republic of Korea (South)<br>
Phone: <a href="tel:%2B82-62-715-3266" value="+82627153266" target="_blank">+82-62-715-3266</a> / Fax: <a href="tel:%2B82-62-715-3244" value="+82627153244" target="_blank">+82-62-715-3244</a><br></div></div>
E-mail: <a href="mailto:mbj0310@gmail.com" target="_blank">mbj0310@gmail.com</a> <mailto:<a href="mailto:mbj0310@gmail.com" target="_blank">mbj0310@gmail.com</a>>, <a href="http://bmssa.gist.ac.kr" target="_blank">http://bmssa.gist.ac.kr</a> <<a href="http://bmssa.gist.ac.kr/" target="_blank">http://bmssa.gist.ac.kr/</a>><br>
<br>
<br>
______________________________<u></u>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/<u></u>mailman/listinfo/fieldtrip</a><br>
</blockquote>
<br>
<br>
-- <br>
Jörn M. Horschig<br>
PhD Student<br>
Donders Institute for Brain, Cognition and Behaviour<br>
Centre for Cognitive Neuroimaging<br>
Radboud University Nijmegen<br>
Neuronal Oscillations Group<br>
FieldTrip Development Team<br>
<br>
P.O. Box 9101<br>
NL-6500 HB Nijmegen<br>
The Netherlands<br>
<br>
Contact:<br>
E-Mail: <a href="mailto:jm.horschig@donders.ru.nl" target="_blank">jm.horschig@donders.ru.nl</a><br>
Tel: <a href="tel:%2B31-%280%2924-36-68493" value="+31243668493" target="_blank">+31-(0)24-36-68493</a><br>
Web: <a href="http://www.ru.nl/donders" target="_blank">http://www.ru.nl/donders</a><br>
<br>
Visiting address:<br>
Trigon, room 2.30<br>
Kapittelweg 29<br>
NL-6525 EN Nijmegen<br>
The Netherlands<br>
<br>
______________________________<u></u>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/<u></u>mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div></div></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">
<div><font face="arial, helvetica, sans-serif">BeomJun Min, M.D.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><div><div class="h5"><span style="color:rgb(51,51,51);line-height:18px">Department of Medical System Engineering (DMSE)<br>
</span><span style="color:rgb(51,51,51);line-height:18px">Gwangju Institute of Science and Technology (GIST)</span><span style="color:rgb(51,51,51);line-height:18px"> </span></div></div><span style="color:rgb(51,51,51);line-height:18px"><div>
<div class="h5"><br>
261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju <br>500-712, Republic of Korea (South) <br>Phone: <a href="tel:%2B82-62-715-3266" value="+82627153266" target="_blank">+82-62-715-3266</a> / Fax: <a href="tel:%2B82-62-715-3244" value="+82627153244" target="_blank">+82-62-715-3244</a> <br>
</div></div>E-mail: </span><a href="mailto:mbj0310@gmail.com" style="text-decoration:none;line-height:18px" target="_blank"><span>mbj0310@gmail.com</span></a><span style="color:rgb(51,51,51);line-height:18px">, <a href="http://bmssa.gist.ac.kr/" style="text-decoration:none" target="_blank">http://bmssa.gist.ac.kr</a></span></font><br>
</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" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>