[FieldTrip] ft_prepare_neighbours
Max Cantor
mcantor at umich.edu
Fri Mar 7 04:26:24 CET 2014
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.
On Thu, Mar 6, 2014 at 7:41 PM, Beom Jun Min <mbj0310 at gmail.com> wrote:
> Dear Jörn and Max
>
> Thank you for your help.
> However, another error occurred.
>
> >>>
> cfg = [];
> cfg.method = 'triangulation'; %'distance', 'triangulation' or
> 'template' (default = 'distance')
> cfg.layout = lay;
> cfg.channel = {'all',
> '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'};
> cfg.feedback = 'yes';
> neighbours = ft_prepare_neighbours(cfg);
> >>>
> These work successfully.
>
> But
> >>>
> cfg = [];
> cfg.neighbours = neighbours;
> cfg.enableedit = 'yes';
> neighbours = ft_neighbourplot(cfg);
> >>>
> ??? Error using ==> ft_fetch_sens at 179
> no electrodes or gradiometers specified.
>
> Error in ==> ft_neighbourplot at 85
> sens = ft_fetch_sens(cfg);
>
> In addition,
> >>>
> cfg = [];
> cfg.method = 'spline'; %'nearest', 'spline' or 'slap'
> (default='nearest')
> cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for
> details
> cfg.neighbours = neighbours;
> cfg.trials = 'all';
> % cfg.lambda = % regularisation parameter (default = 1e-5, not for
> method 'distance')
> % cfg.order = % order of the polynomial interpolation (default =
> 4, not for method 'distance')
> interpolated = ft_channelrepair(cfg, final)
> >>>
> ??? Error using ==> ft_fetch_sens at 179
> no electrodes or gradiometers specified.
>
> Error in ==> ft_channelrepair at 112
> sens = ft_fetch_sens(cfg, data);
>
> It seems the problem is associated with position of electrode. But I do
> not have manufacture's file.
> Do I have to make the positions of electrodes manually?
> Actually, I do not understand the information from help*
> ft_datatype_sens, and ft_read_sens.*
>
> With regards
>
>
>
>
>
> 2014-03-06 23:19 GMT+09:00 Max Cantor <mcantor at umich.edu>:
>
> 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.
>>
>> I talk about it in this thread:
>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html
>>
>> Here is the conclusion I came to:
>>
>> "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 (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) 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."
>>
>> 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.
>>
>>
>> On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" <
>> jm.horschig at donders.ru.nl> wrote:
>>
>>> Hi Beom,
>>>
>>> did your code produce an error?
>>>
>>> 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:
>>>
>>> cfg = [];
>>> cfg.method = 'triangulation';
>>> cfg.layout = lay;
>>> cfg.channel = 'all'; % that way you only need to run this once for
>>> *all* your subjects
>>> cfg.feedback = 'yes';
>>> neighbours = ft_prepare_neighbours(cfg);
>>>
>>> Then, if you are unhappy with the result, for modifcation you can use
>>> cfg = [];
>>> cfg.neighbours = neighbours;
>>> cfg.enableedit = 'yes';
>>> neighbours = ft_neighboursplot(cfg);
>>>
>>> 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.
>>>
>>> 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).
>>>
>>> And finally, yes, using preprocessed data is possible.
>>>
>>> Should you have any other questions, feel free to ask.
>>>
>>> Best,
>>> Jörn
>>>
>>>
>>>
>>> On 3/6/2014 2:09 AM, Beom Jun Min wrote:
>>>
>>>>
>>>> Hello
>>>>
>>>> I have a problem with channel repair.
>>>>
>>>> Firstly, I created my own layout because I cannot apply my data into
>>>> the offered layout files.
>>>> 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.
>>>> QuikCap_NSL_128 does not match either.
>>>>
>>>> Anyway, I created own customized layout, and usual preprocessing steps
>>>> were done.
>>>> However, there were some bad recording channels so I removed them
>>>> during preprocessing.
>>>> Moreover, the removed channels are different among the subjects, and
>>>> now it becomes a big problem for analyzing the data.
>>>>
>>>> So I tried channel repair process, but encountered with errors.
>>>>
>>>> >>>
>>>> cfg = [];
>>>> cfg.method = 'template';
>>>> cfg.template = 'bj_plot.mat';
>>>> cfg.layout = lay;
>>>> cfg.channel = 'T7'; % channels for which neighbours should be
>>>> found
>>>> cfg.feedback = 'yes';
>>>> neighbours = ft_prepare_neighbours(cfg, data);
>>>> >>>
>>>>
>>>> I think I have to use 'template' method because, there are some missing
>>>> channels serially.
>>>> And here are my question.
>>>> 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.
>>>> 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.)
>>>> Finally, at 'data' field, is it possible to assign a finalized
>>>> preprocessed data?
>>>>
>>>> And after ft_prepare_neighbours,
>>>>
>>>> >>>
>>>> cfg = [];
>>>> cfg.method = 'spline'
>>>> % cfg.badchannel = 'T7';
>>>> cfg.missingchannel = 'T7';
>>>> cfg.neighbours = neighbours;
>>>> cfg.trials = 'all'
>>>> interpolated = ft_channelrepair(cfg, data)
>>>>
>>>> Is that right?
>>>>
>>>>
>>>> --
>>>> BeomJun Min, M.D.
>>>>
>>>> Department of Medical System Engineering (DMSE)
>>>> Gwangju Institute of Science and Technology (GIST)
>>>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju
>>>> 500-712, Republic of Korea (South)
>>>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244
>>>> E-mail: mbj0310 at gmail.com <mailto:mbj0310 at gmail.com>,
>>>> http://bmssa.gist.ac.kr <http://bmssa.gist.ac.kr/>
>>>>
>>>>
>>>> _______________________________________________
>>>> fieldtrip mailing list
>>>> fieldtrip at donders.ru.nl
>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>>
>>>
>>>
>>> --
>>> Jörn M. Horschig
>>> PhD Student
>>> Donders Institute for Brain, Cognition and Behaviour
>>> Centre for Cognitive Neuroimaging
>>> Radboud University Nijmegen
>>> Neuronal Oscillations Group
>>> FieldTrip Development Team
>>>
>>> P.O. Box 9101
>>> NL-6500 HB Nijmegen
>>> The Netherlands
>>>
>>> Contact:
>>> E-Mail: jm.horschig at donders.ru.nl
>>> Tel: +31-(0)24-36-68493
>>> Web: http://www.ru.nl/donders
>>>
>>> Visiting address:
>>> Trigon, room 2.30
>>> Kapittelweg 29
>>> NL-6525 EN Nijmegen
>>> The Netherlands
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
>
> --
> BeomJun Min, M.D.
>
> Department of Medical System Engineering (DMSE)
> Gwangju Institute of Science and Technology (GIST)
>
> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju
> 500-712, Republic of Korea (South)
> Phone: +82-62-715-3266 / Fax: +82-62-715-3244
> E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140306/40cdd7cf/attachment-0002.html>
More information about the fieldtrip
mailing list