From nuria.donamayor at neuro.uni-luebeck.de Fri Mar 1 11:02:55 2013 From: nuria.donamayor at neuro.uni-luebeck.de (=?iso-8859-1?Q?Nuria_Do=F1amayor_Alonso?=) Date: Fri, 1 Mar 2013 11:02:55 +0100 Subject: [FieldTrip] units Message-ID: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> Hey guys, just two very simple questions regarding units. I am calculating dipoles using planar gradiometer data from a 306 Neuromag system (input units T/cm), what are the units of the dipole moment? Also, what are the units of the LCMV beamformer? Thanks! Nuria From konklone at gmail.com Sat Mar 2 03:12:18 2013 From: konklone at gmail.com (Eric Mill) Date: Fri, 1 Mar 2013 20:12:18 -0600 Subject: [FieldTrip] Getting started with realtime EEG data Message-ID: Hi all, My apologies if this is off-topic here, since you all seem like very busy experts! I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. I see that FieldTrip has a realtime acquisition modulefor NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Sun Mar 3 10:58:36 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 3 Mar 2013 10:58:36 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: Message-ID: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Hi Eric, I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. best regards, Robert On 2 Mar 2013, at 3:12, Eric Mill wrote: > Hi all, > > My apologies if this is off-topic here, since you all seem like very busy experts! > > I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. > > I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? > > Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? > > My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. > > Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. > > -- Eric > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Sun Mar 3 11:35:37 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 3 Mar 2013 11:35:37 +0100 Subject: [FieldTrip] units In-Reply-To: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> References: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> Message-ID: <6A809326-5C8C-49E8-B826-0B39600409F0@donders.ru.nl> On 1 Mar 2013, at 11:02, Nuria Doñamayor Alonso wrote: > Hey guys, > just two very simple questions regarding units. I am calculating dipoles using planar gradiometer data from a 306 Neuromag system (input units T/cm), what are the units of the dipole moment? Also, what are the units of the LCMV beamformer? The beamformer spatial filter boils down to this equation w = inv(h' * inv(c) * h) * h' * inv(c) where the data covariance c c = d*d'/(n-1) and d is the data expressed in units of signal strength. Furthermore, h is the lead field expressed in "fieldstrength / dipole strength". If you combine all, you see that w is expressed in dipole strength / signal strength. So multiplying w with d you get dipole strength. Or with (w' * c * w) you get squared dipole strength (i.e. dipole power). Sofar the theory, Regretfully the practice aint so nice. Have a look at http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 or more in general http://bugzilla.fcdonders.nl/buglist.cgi?quicksearch=units There are a number of issues due to inconsistent dealing with units, which is largely due to the code not knowing about the units. One is that the neuromag data is in fieldstrentgh/distance for the planar channels, but fieldstrength for the magnetometers. The leadfield has always been computed as fieldstrength (i.e. the difference between the two coils, not divided by the distance). So the leadfield (which is in "fieldstrength" for all 306 channels) is inconsistent with the data (which is in "fieldstrength" for 102 and "fieldstrength/distance" for 204 channels). This results (as others have reported in the past) in the situation that magnetometers and planar gradiometers don't combine well in a single source reconstruction. If you consider converting units from m to cm or mm, i.e. expressing data in different geometrical units, you have to consider that not onlt the coil poisitions change, but also the signal strength (1 T/mm = 10 T/cm). That has never been considered in the code, so there are also bugs related to this. Finally, the units of conductivity in the volume conduction model is not properly scaled with units (although I think that that does not affect MEG, but it does EEG). So there are issues due to inconsistencies in units of signal strength, units of distance and units of conductivity. There are a number of action points defined in our bugzilla and I am working on getting them resolved together with Vladimir (also for SPM). At the moment I suggest you just to be careful with interpreting absolute units. Relative units (changes between conditions) and statistics are not affected. best Robert > Thanks! > Nuria > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stefan.debener at uni-oldenburg.de Sun Mar 3 13:26:35 2013 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Sun, 03 Mar 2013 13:26:35 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: <5133417B.8020901@uni-oldenburg.de> Hi Eric, We recently modified the Emotiv Epoc system and are very happy with the resulting data quality. The modifications & a truly mobile, outdoor walking, single-trial EEG evaluation study are published here: http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/abstract We have also performed more evaluation studies (unpublished) with this system and it performs very competitive for online P3 speller tasks (e.g. via BCI2000) and online motor imagery (e.g. via openvibe). Moreover, it is possible to read the data on Android smartphones/tablets, which is very promising: http://milab.imm.dtu.dk/eeg All necessary spare parts (electrodes, cap, box, connector, wiring information) can be purchased from www.easycap.de, and assembly is pretty straightforward and done in a few hours if you know how to use a soldering iron. Best, Stefan Am 3/3/13 10:58 AM, schrieb Robert Oostenveld: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. > > I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. > > I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each transl > ate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > >> Hi all, >> >> My apologies if this is off-topic here, since you all seem like very busy experts! >> >> I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. >> >> I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? >> >> Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? >> >> My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. >> >> Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. >> >> -- Eric >> _______________________________________________ >> 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 -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de From stefan.debener at uni-oldenburg.de Sun Mar 3 13:30:39 2013 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Sun, 03 Mar 2013 13:30:39 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: <5133426F.7060700@uni-oldenburg.de> Hoops, forgot to include this link, if you want to know how the modified Emotiv system looks like: http://www.youtube.com/watch?v=TLTko4AGmdk Best, Stefan Am 3/3/13 10:58 AM, schrieb Robert Oostenveld: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. > > I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. > > I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each transl > ate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > >> Hi all, >> >> My apologies if this is off-topic here, since you all seem like very busy experts! >> >> I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. >> >> I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? >> >> Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? >> >> My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. >> >> Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. >> >> -- Eric >> _______________________________________________ >> 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 -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de From konklone at gmail.com Sun Mar 3 23:26:15 2013 From: konklone at gmail.com (Eric Mill) Date: Sun, 3 Mar 2013 17:26:15 -0500 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: This is extremely helpful, and just what I was looking for, thank you (both Robert and Stefan). I have a few followup questions you've inspired. How "swappable" is the hardware? Do all EEG's fundamentally produce the same data from the same brain activity? And/or, does FieldTrip always expose data in its buffer in the same format? For example, I would be fine investing the $750 for an Emotiv 14-channel EEG, or even the $1200 for a KT88-1016, but not until after I've done some development with a cheaper device first. However, I would not want to have to rewrite all my code, or much of it, if I switch devices. I do have a requirement that I can have the same code work with either live or replayed data. From how you describe its buffer approach, it sounds like that's a core value of FieldTrip, and will make that requirement much easier to satisfy. Also, I do have one peculiar requirement, which is that the hardware be suitable for wearing during ordinary sleeping at home. This is more a requirement for the final (potentially more expensive) device, than the development device. The promotional photo for the Emotiv EEG, for example, looks like it might not be so great for that. I think I will be using WebSockets, but there will be an intermediate server. So, I will have a computer (perhaps a Raspberry Pi) receive data from the EEG, and then immediately stream it up an open TCP connection to a web server. This server will then stream it down to the individual browsers of visiting users, and JavaScript will do the visualization, in something like Three.js or Processing.js. So I don't think I'd be making a JavaScript implementation of FieldTrip, but I believe the server software could be made to be general purpose, and reusable in the work of others like yourselves. That would be a satisfying byproduct. The idea here is that the resulting website will show fully live and real time EEG data, specifically while I am sleeping. Since I only sleep for ~1/3 of any given day, the ability to replay things will be helpful in giving the site utility during the other 2/3. I've never done any signal processing before, not even so much as a fast Fourier transform. But I'm willing to learn! I'll be consulting the tutorial you've kindly written, but if you have any suggestions of learning material I should look at when figuring out how to (for example) detect when a subject has entered levels of sleep given streams of EEG data, it would be a lot of help to me. Unfortunately, the paper you linked to ( http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) is behind a paywall and is $35, but if you recommend it highly enough, I'll check it out. Again, thank you for being so welcome to a newbie, and for the recommendations and links. -- Eric On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products > since we made the initial implementation of the ThinkCap. I am still able > to find documentation here > http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdfand > http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell > whether the complete sets now sold by NeuroSky still use the same software > interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The > Epoc has more channels and a head mount for the electrodes. For the Epoc > you have to look into teh different SDK options, the cheapest version only > gives access to processed data, not to the raw data. For both the Epoc and > openeeg a implementation of a stand-allone executable is available in > http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke > for the ThinkCap, this copies the data to a "fieldtrip buffer", where > another (c/c++/java/python/matlab) application can easily read it from and > do the signal processing, not having to worry about the buffering and data > representation any more. > > I know it falls outside your budget, but have a look at > http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. > These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The > rationale for the fieldtrip buffer is that it allows us to develop analysis > pipelines using EEG data files on disk (using ft_read_data). Once the > offline analysis pipeline performs as desired, we just switch from reading > to disk to reading from the buffer (also ft_read_data). We happen to do > this using MATLAB for the rapid application development, but the same > strategy (develop for file, run in real-time) can be used with another > programming environment. > > I think that for signal processing you'll better off if you develop the > code using some good quality data from a file on disk. You can always enact > a real-time data stream by replaying data from that EEG file, or using the > sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, > constantly having to wear the headset. That is fine for artefact detection > (you can blink while you code), but not if the tasks get more complicated, > e.g. relaxing to increase your occipital alpha/10Hz won't work well if you > also have in realtime have to monitor whether your applications picks up > the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the > possibilities of a web-standards implementation. Web Sockets would be > needed in Javascript if we want to have the browser connect to a > "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky > w.r.t. it working on all platforms. A server-side implementation offers > more choice, python/java/php reading the data from a FT buffer or from the > device, and then pass it on in html format to the connected web ) but would > not scale as easily with multiple client connections if data processing > needs to be done on the server. We then considered the best option to be > to implement a RESTless server implementation. The server would one the one > hand contains the FT buffer (where it receives the data over low-level TCP) > and on the other hand have a web server with the RESTless interface. I.e. > the requests that are represented here > http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would > each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" > and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You > can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > > > Hi all, > > > > My apologies if this is off-topic here, since you all seem like very > busy experts! > > > > I'm trying to figure out what I need to get started with capturing > real-time EEG data using consumer-priced headsets (<$200). I don't actually > have any interest in using MATLAB, though - I just want to capture the raw > data, in real time. > > > > I see that FieldTrip has a realtime acquisition module for NeuroSky's > "ThinkCap", though I can't find a current product by NeuroSky called that. > Is there something else of theirs I could buy that would work with > FieldTrip? > > > > Or, should I be looking elsewhere entirely? What should someone who > wants real-time EEG data do? > > > > My plan is to stream this data and visualize it on the web in real time. > My background is in web development, not cognitive science, but I'm willing > to learn what I have to make something interesting. I'd also love to have > the project result in libraries useful for other people in the field. > > > > Thanks for any advice you can give on what EEG to buy, and/or where to > learn the core concepts I'll need to use the data. > > > > -- Eric > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 4 07:16:04 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 4 Mar 2013 07:16:04 +0100 Subject: [FieldTrip] troubles while reading 4D MEG files in getting the MEG channels In-Reply-To: References: <1538559706.484002.1361969272444.JavaMail.root@bureau-frontal1> Message-ID: Hi Sophie, That's strange. I assume that the same problem occurs when you try it with the xxx.COH dataset? Could you create yourself an account on our bugzilla.fcdonders.nl website, and file a bug about this? If you then upload one of the xxx.COH datasets (along with the config-file), as well as the MEG_LABEL variable we can have a look at it. Best wishes, Jan-Mathijs On Feb 27, 2013, at 1:51 PM, sophie chen wrote: > Dear all, > > I am trying to read MEG 4D files with Fieldtrip version 20130226 using ft_preprocessing file with a preselection of MEG channels ( 'MEG' or a cell array of channel names, here is MEG_LABEL) but the output > data contains only 152 channels while I have 248 channels... I tried the same code with Fieldtrip version 20121015, and I get everything properly (i.e. 248 channels) > Following the script I am running and the corresponding results in matlab. > > > cfg = []; > cfg.dataset = 'c,rfDC'; > cfg.trialdef.eventtype = 'TRIGGER'; > cfg.trialdef.eventvalue = 2; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim = 2; > [cfg] = ft_definetrial(cfg); > > % cfg.channel = 'MEG'; > cfg.channel = MEG_LABEL; > cfg.continous = 'yes'; > data_2 = ft_preprocessing (cfg) > > I get this >> > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 123 > evaluating trialfunction 'ft_trialfun_general' > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_trialfun_general at 71 > In ft_definetrial at 162 > undoing the Supine balancing > reading the events from 'c,rfDC' > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_read_event at 174 > In ft_trialfun_general at 80 > In ft_definetrial at 162 > found 677 events > created 249 trials > the call to "ft_definetrial" took 5 seconds > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_preprocessing at 394 > processing channel { 'A2' 'A104' 'A241' 'A138' 'A71' 'A125' 'A20' 'A65' 'A9' 'A114' 'A175' 'A228' 'A35' 'A191' 'A37' 'A170' 'A207' 'A224' 'A82' 'A238' 'A28' 'A239' 'A13' 'A165' 'A204' 'A25' 'A70' 'A11' 'A47' 'A64' 'A177' 'A127' 'A247' 'A194' 'A5' 'A242' 'A168' 'A31' 'A245' 'A219' 'A105' 'A222' 'A76' 'A188' 'A215' 'A235' 'A181' 'A38' 'A230' 'A91' 'A212' 'A24' 'A96' 'A57' 'A86' 'A116' 'A141' 'A120' 'A80' 'A210' 'A113' 'A27' 'A135' 'A167' 'A206' 'A100' 'A43' 'A200' 'A102' 'A132' 'A122' 'A62' 'A21' 'A229' 'A55' 'A32' 'A85' 'A58' 'A60' 'A88' 'A79' 'A203' 'A145' 'A139' 'A156' 'A68' 'A159' 'A236' 'A161' 'A6' 'A126' 'A94' 'A15' 'A193' 'A150' 'A36' 'A225' 'A195' 'A172' 'A108' 'A81' 'A171' 'A218' 'A173' 'A201' 'A74' 'A29' 'A164' 'A232' 'A69' 'A157' 'A97' 'A124' 'A40' 'A178' 'A179' 'A33' 'A147' 'A148' 'A89' 'A119' 'A52' 'A190' 'A73' 'A136' 'A184' 'A51' 'A77' 'A129' 'A197' 'A182' 'A46' 'A92' 'A41' 'A90' 'A23' 'A154' 'A18' 'A248' 'A149' 'A118' 'A152' 'A140' 'A110' 'A185' 'A162' 'A106' 'A187' 'A221' 'A133' 'A158' 'A216' } > reading and preprocessing > reading and preprocessing trial 249 from 249 > > the call to "ft_preprocessing" took 20 seconds > > data_2 = > > hdr: [1x1 struct] > label: {152x1 cell} > time: {1x249 cell} > trial: {1x249 cell} > fsample: 2.0345e+03 > sampleinfo: [249x2 double] > trialinfo: [249x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > This is what I get with Fieldtrip 20121015: > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 123 > evaluating trialfunction 'ft_trialfun_general' > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > reading the events from 'c,rfDC' > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > found 677 events > created 249 trials > the call to "ft_definetrial" took 7 seconds > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > processing channel { 'A22' 'A2' 'A104' 'A241' 'A138' 'A214' 'A71' 'A26' 'A93' 'A39' 'A125' 'A20' 'A65' 'A9' 'A8' 'A95' 'A114' 'A175' 'A16' 'A228' 'A35' 'A191' 'A37' 'A170' 'A207' 'A112' 'A224' 'A82' 'A238' 'A202' 'A220' 'A28' 'A239' 'A13' 'A165' 'A204' 'A233' 'A98' 'A25' 'A70' 'A72' 'A11' 'A47' 'A160' 'A64' 'A3' 'A177' 'A63' 'A155' 'A10' 'A127' 'A67' 'A115' 'A247' 'A174' 'A194' 'A5' 'A242' 'A176' 'A78' 'A168' 'A31' 'A223' 'A245' 'A219' 'A12' 'A186' 'A105' 'A222' 'A76' 'A50' 'A188' 'A231' 'A45' 'A180' 'A99' 'A234' 'A215' 'A235' 'A181' 'A38' 'A230' 'A91' 'A212' 'A24' 'A66' 'A42' 'A96' 'A57' 'A86' 'A56' 'A116' 'A151' 'A141' 'A120' 'A189' 'A80' 'A210' 'A143' 'A113' 'A27' 'A137' 'A135' 'A167' 'A75' 'A240' 'A206' 'A107' 'A130' 'A100' 'A43' 'A200' 'A102' 'A132' 'A183' 'A199' 'A122' 'A19' 'A62' 'A21' 'A229' 'A84' 'A213' 'A55' 'A32' 'A85' 'A146' 'A58' 'A60' 'A88' 'A79' 'A169' 'A54' 'A203' 'A145' 'A103' 'A163' 'A139' 'A49' 'A166' 'A156' 'A128' 'A68' 'A159' 'A236' 'A161' 'A121' 'A4' 'A61' 'A6' 'A126' 'A14' 'A94' 'A15' 'A193' 'A150' 'A227' 'A59' 'A36' 'A225' 'A195' 'A30' 'A109' 'A172' 'A108' 'A81' 'A171' 'A218' 'A173' 'A201' 'A74' 'A29' 'A164' 'A205' 'A232' 'A69' 'A157' 'A97' 'A217' 'A101' 'A124' 'A40' 'A123' 'A153' 'A178' 'A1' 'A179' 'A33' 'A147' 'A117' 'A148' 'A87' 'A89' 'A243' 'A119' 'A52' 'A142' 'A211' 'A190' 'A53' 'A192' 'A73' 'A226' 'A136' 'A184' 'A51' 'A237' 'A77' 'A129' 'A131' 'A198' 'A197' 'A182' 'A46' 'A92' 'A41' 'A90' 'A7' 'A23' 'A83' 'A154' 'A34' 'A17' 'A18' 'A248' 'A149' 'A118' 'A208' 'A152' 'A140' 'A144' 'A209' 'A110' 'A111' 'A244' 'A185' 'A246' 'A162' 'A106' 'A187' 'A48' 'A221' 'A196' 'A133' 'A158' 'A44' 'A134' 'A216' } > reading and preprocessing > reading and preprocessing trial 249 from 249 > > the call to "ft_preprocessing" took 24 seconds > > data_2 = > > hdr: [1x1 struct] > label: {248x1 cell} > time: {1x249 cell} > trial: {1x249 cell} > fsample: 2.0345e+03 > sampleinfo: [249x2 double] > trialinfo: [249x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > I hope this helps to find out where the problem is coming from... > Thanks in advance for your help > > Cheers, > > Sophie Chen > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 4 11:11:24 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 4 Mar 2013 11:11:24 +0100 (CET) Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well In-Reply-To: <512FD5B5.8080700@gmail.com> References: <512FD5B5.8080700@gmail.com> Message-ID: <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> hi Ye, here is a FAQ about the function of the ft_volumereslice function: http://fieldtrip.fcdonders.nl/faq/how_change_mri_orientation_size_fov One of the reasons why it is suggested to use the ft_volumereslice function before segmentation is that some of the segmentation-processes require isotropic voxels (this means that a voxel must have the same size into each direction). The ft_volumereslice function is reslicing the image and returns it with isotropic voxel-size. But if your mri images are isotropic, you do not need to bother with this. But you have to be careful when you use the ft_volumereslice function and you do not specify the resolution or the dimensions of its output. In this case, it will return the image resliced to a default resolution and a default dimension (it is 256X256X256 with 1 mm resolution if I remember well), and it is possible that your image will loose some information. I suspect that this happened when you resliced your mri. Can you see the whole brain when you plot the resliced mri with the ft_sourcplot function? The solution for this problem is that you define the resolution and the dimensions yourself for ft_volumereslice. I hope this helps. Best, Lilla > Hello All, > > I found the problem I mentioned in the previous email was caused by > using "mri_sliced = ft_volumereslice([], mri);" before using > ft_volumesegment. > After erasing the line "mri_sliced = ft_volumereslice([], mri);", the > segmented brain seems to be normal and fits the sensor helmet well now, > as show in the attached figure(notvolumnsliced.jpg). > For another of my subject, if the "ft_volumereslice" is included, the > brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" > it looks normal(subject2.jpg). > > I notice in the fieldtrip headmodel tutorial > (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), > "ft_volumereslice" is not used. but in the field trip beamformer > tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. > > I am wondering if I should include "ft_volumereslice" in my source > localization code. Can anyone give me some suggestions? > > > > thanks ahead, > Ye > > > > > On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. segmented brain seems not fitting the sensor helmet well (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 11:38:21 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512F87FD.80500 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >> segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: brain.png >> Type: image/png >> Size: 15197 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: head.jpg >> Type: image/jpeg >> Size: 50294 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 31 >> ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Joachim.Gross at glasgow.ac.uk Mon Mar 4 15:37:49 2013 From: Joachim.Gross at glasgow.ac.uk (Joachim Gross) Date: Mon, 4 Mar 2013 14:37:49 +0000 Subject: [FieldTrip] 5-year Post-Doc Position in Glasgow Message-ID: <9967549B-AA9A-40DC-A640-E01C60730107@glasgow.ac.uk> Research Associate Ref: M00513 Salary: Grade 6/7 £26,264 - £29,541 / £32,267 - £36,298 per annum You will contribute to a 5-year Wellcome Trust funded research project entitled “Natural and modulated neural communication: State-dependent decoding and driving of human Brain Oscillations” (Joint Investigators: Gregor Thut, Joachim Gross). The job requires working in an interdisciplinary team of researchers on longstanding questions of how brain oscillations orchestrate brain functions, or relate to brain dysfunction. This will involve the development and/or application of new analysis methods to eavesdrop on brain communication and decode some of the information coded in brain oscillations (MEG/EEG). The successful applicant will be part of a larger team of researchers where information decoding (MEG/EEG) is complemented with controlled intervention into brain oscillations by transcranial stimulation to modulate brain function (combined TMS/tACS-EEG). For more information on the position and environment please write to Joachim.Gross at glasgow.ac.uk, orGregor.Thut at glasgow.ac.uk Apply online at www.glasgow.ac.uk/jobs Closing date: 1 April 2013 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Mon Mar 4 18:45:22 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Mon, 04 Mar 2013 18:45:22 +0100 Subject: [FieldTrip] MNE surface data: normalising and averaging? In-Reply-To: <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> Message-ID: <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Dear Fieldtrippers, I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! Best regards, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 4 22:01:51 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 04 Mar 2013 22:01:51 +0100 Subject: [FieldTrip] MNE surface data: normalising and averaging? In-Reply-To: <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Message-ID: <51350BBF.4040807@donders.ru.nl> Hi Gregor, would there be any reason why the following approach might not work? http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp The specific steps are in more detail explained in this (new) tutorial: http://fieldtrip.fcdonders.nl/development/beamformingextended Best, Jörn On 3/4/2013 6:45 PM, Gregor Volberg wrote: > Dear Fieldtrippers, > I need to ask for a helpful hint on MNE source reconstructions. > Following this tutorial > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained > nice individual cortical meshes and source points; the MNE forward and > inverse solution for the individuals all work well. I would now like > to normalize the individual grids to a template brain in order to do > statistics and averaging for plotting. I figured out that I could use > ft_sourceinterpolate to tranform the grid into a volumetric > representation, and then use ft_volumenormalise to normalise to a > standard brain. But this did not work too well for source structures > containing time series (like 'mne'-stcutures) where the computational > load gets very high. I also tried to use a grid of one subject as a > template for the other subject's grids with ft_sourceinterpolate and > cfg.interpmethod = 'smudge', but this seems to require two grids with > the same number of source points as input(?). > Is there a way to do a normalisation directly on brain triangulations > / source grids ? Thanks for any help! > Best regards, > Gregor > -- > Dr. rer. nat. Gregor Volberg > > ( > mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanbelluzo at gmail.com Tue Mar 5 00:27:29 2013 From: sanbelluzo at gmail.com (Santiago Belluzo) Date: Mon, 4 Mar 2013 20:27:29 -0300 Subject: [FieldTrip] Emotiv + FieldTrip + Matlab Message-ID: *Hi, I'm new to FieldTrip and I'm interested in using it to capture **realtime data from the Emotiv headset using the function emotiv2ft.I`ve tried some examples like signalviewer andpowerviewer with random signal from signalproxy to check that the FieldTripBuffer works fine. Then i`ve tried to use emotiv2ft and have problems. * *I'm not sure about how to call to this interface from within **Matlab.* *I`ve read some messages from the mailinglist with similar problem but in there is not clear for me how they solve it. * *I´ll be waiting for any help!.* *Thanks.* -- Santiago -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Tue Mar 5 09:03:24 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Tue, 05 Mar 2013 09:03:24 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <51350BBF.4040807@donders.ru.nl> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> Message-ID: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Hi Jörn, thank you for your fast response! I wasn't aware that this approach also works with irregularly spaced surface grids as input. I will try it this way. Thanks again, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> Hi Gregor, would there be any reason why the following approach might not work? http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp The specific steps are in more detail explained in this (new) tutorial: http://fieldtrip.fcdonders.nl/development/beamformingextended Best, Jörn On 3/4/2013 6:45 PM, Gregor Volberg wrote: Dear Fieldtrippers, I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! Best regards, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Mar 5 10:24:51 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 5 Mar 2013 10:24:51 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Message-ID: <348B78CB-0BFC-4446-800E-E4CF6BD838F6@donders.ru.nl> Hi Gregor, To follow up on this: I guess what Jörn meant is that you could use the irregular 3D grids, as the target grids onto which the surface data will be interpolated. This makes the interpolated 3D-grid data directly averageable. JM On Mar 5, 2013, at 9:03 AM, Gregor Volberg wrote: > Hi Jörn, > > thank you for your fast response! I wasn't aware that this approach also works with irregularly spaced surface grids as input. I will try it this way. > > Thanks again, > Gregor > > > > > -- > Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> > Hi Gregor, > > would there be any reason why the following approach might not work? > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp > > The specific steps are in more detail explained in this (new) tutorial: > http://fieldtrip.fcdonders.nl/development/beamformingextended > > Best, > Jörn > > On 3/4/2013 6:45 PM, Gregor Volberg wrote: >> Dear Fieldtrippers, >> >> I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). >> Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! >> Best regards, >> Gregor >> >> -- >> Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) >> University of Regensburg >> Institute for Experimental Psychology >> 93040 Regensburg, Germany >> Tel: +49 941 943 3862 >> Fax: +49 941 943 3233 >> http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >> >> >> >> >> _______________________________________________ >> >> 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 Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eschulz at lrz.tu-muenchen.de Tue Mar 5 10:30:03 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Tue, 5 Mar 2013 10:30:03 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: Dear Fieldtrip experts, I would like to create a leadfield based on the standard brain provided by the fieldtrip package and standard electrode positions. Unfortunately, whatever I'm trying it ends up in a number of error messages. Is anybody out there who could provide some support? Thank you very much in advance, Best, Enrico -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 5 10:33:37 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Mar 2013 10:33:37 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Message-ID: <5135BBF1.5090005@donders.ru.nl> Hi again, as a second link I meant to paste this one: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended The procedure, however, is in more detail explained in the first link I pasted, in this tutorial an example of how to use that is illustrated. Hope it works out! Best, Jörn On 3/5/2013 9:03 AM, Gregor Volberg wrote: > > Hi Jörn, > > > thank you for your fast response! I wasn't aware that this approach > also works with irregularly spaced surface grids as input. I will try > it this way. > > > Thanks again, > > Gregor > > > > > > -- > Dr. rer. nat. Gregor Volberg > ( > mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > > >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> > > Hi Gregor, > > would there be any reason why the following approach might not work? > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp > > The specific steps are in more detail explained in this (new) tutorial: > http://fieldtrip.fcdonders.nl/development/beamformingextended > > Best, > Jörn > > On 3/4/2013 6:45 PM, Gregor Volberg wrote: > >> Dear Fieldtrippers, >> >> I need to ask for a helpful hint on MNE source reconstructions. >> Following this tutorial >> http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained >> nice individual cortical meshes and source points; the MNE forward >> and inverse solution for the individuals all work well. I would now >> like to normalize the individual grids to a template brain in order >> to do statistics and averaging for plotting. I figured out that I >> could use ft_sourceinterpolate to tranform the grid into a volumetric >> representation, and then use ft_volumenormalise to normalise to a >> standard brain. But this did not work too well for source structures >> containing time series (like 'mne'-stcutures) where the computational >> load gets very high. I also tried to use a grid of one subject as a >> template for the other subject's grids with ft_sourceinterpolate and >> cfg.interpmethod = 'smudge', but this seems to require two grids with >> the same number of source points as input(?). >> >> Is there a way to do a normalisation directly on brain triangulations >> / source grids ? Thanks for any help! >> >> Best regards, >> >> Gregor >> >> -- >> Dr. rer. nat. Gregor Volberg >> > > ( >> mailto:gregor.volberg at psychologie.uni-regensburg.de ) >> University of Regensburg >> Institute for Experimental Psychology >> 93040 Regensburg, Germany >> Tel: +49 941 943 3862 >> Fax: +49 941 943 3233 >> http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >> >> >> >> _______________________________________________ >> >> >> >> >> 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 -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 5 11:33:05 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Mar 2013 11:33:05 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <5135C9E1.3030906@donders.ru.nl> Dear Enrico, we are always very happy to provide support and help. If you just copy and paste your cfg settings, the function-call itself and the error you got, then we can try to find what is going wrong. Feel free to write this to the general discussion list rather than to any specific person - that way others running intro similar issues might find the here proposed solution easier. Best, Jörn On 3/5/2013 10:30 AM, Enrico Schulz wrote: > Dear Fieldtrip experts, > > I would like to create a leadfield based on the standard brain > provided by the fieldtrip package and standard electrode positions. > Unfortunately, whatever I'm trying it ends up in a number of error > messages. > > Is anybody out there who could provide some support? > > Thank you very much in advance, > Best, > Enrico > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Tue Mar 5 12:08:08 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Tue, 5 Mar 2013 12:08:08 +0100 (CET) Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Dear Enrico, I think more information is needed about the error messages and about how you try to compute leadfield in order to help. If you have not encountered the FT tutorial sites, example scripts and FAQs yet, maybe you can check out those as well because they provide information on source-reconstruction, leadfields... etc.. (For example, a tutorial for EEG headmodels: http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example script for leadfield computation: http://fieldtrip.fcdonders.nl/example/compute_leadfield). Best, Lilla > Dear Fieldtrip experts, > > I would like to create a leadfield based on the standard brain provided by > the fieldtrip package and standard electrode positions. > Unfortunately, whatever I'm trying it ends up in a number of error > messages. > > Is anybody out there who could provide some support? > > Thank you very much in advance, > Best, > Enrico > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hamid.mohseni at eng.ox.ac.uk Tue Mar 5 19:03:23 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Tue, 5 Mar 2013 18:03:23 +0000 Subject: [FieldTrip] Downloading tutorial data Message-ID: Hi, I cannot download tutorial files e.g.: ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip I tried both chrome and firefox, is there any reason? -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Wed Mar 6 05:24:28 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 5 Mar 2013 23:24:28 -0500 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: Sorry, that was a very long response on my part - but the one actual question I have in there is, how easy is it to switch from one EEG device to another? Should I expect to have to rework my code entirely, or will the core data format and signal processing work be the same? Is standardizing the data stream one of the things using an intermediary like Field Trip does? -- Eric On Sun, Mar 3, 2013 at 5:26 PM, Eric Mill wrote: > This is extremely helpful, and just what I was looking for, thank you > (both Robert and Stefan). I have a few followup questions you've inspired. > > How "swappable" is the hardware? Do all EEG's fundamentally produce the > same data from the same brain activity? And/or, does FieldTrip always > expose data in its buffer in the same format? > > For example, I would be fine investing the $750 for an Emotiv 14-channel > EEG, or even the $1200 for a KT88-1016, but not until after I've done some > development with a cheaper device first. However, I would not want to have > to rewrite all my code, or much of it, if I switch devices. > > I do have a requirement that I can have the same code work with either > live or replayed data. From how you describe its buffer approach, it sounds > like that's a core value of FieldTrip, and will make that requirement much > easier to satisfy. > > Also, I do have one peculiar requirement, which is that the hardware be > suitable for wearing during ordinary sleeping at home. This is more a > requirement for the final (potentially more expensive) device, than the > development device. The promotional photo for the Emotiv EEG, > for example, looks like it might not be so great for that. > > I think I will be using WebSockets, but there will be an intermediate > server. So, I will have a computer (perhaps a Raspberry Pi) receive data > from the EEG, and then immediately stream it up an open TCP connection to a > web server. This server will then stream it down to the individual browsers > of visiting users, and JavaScript will do the visualization, in something > like Three.js or Processing.js. > > So I don't think I'd be making a JavaScript implementation of FieldTrip, > but I believe the server software could be made to be general purpose, and > reusable in the work of others like yourselves. That would be a satisfying > byproduct. > > The idea here is that the resulting website will show fully live and real > time EEG data, specifically while I am sleeping. Since I only sleep for > ~1/3 of any given day, the ability to replay things will be helpful in > giving the site utility during the other 2/3. > > I've never done any signal processing before, not even so much as a fast > Fourier transform. But I'm willing to learn! I'll be consulting the > tutorial you've kindly written, > but if you have any suggestions of learning material I should look at when > figuring out how to (for example) detect when a subject has entered levels > of sleep given streams of EEG data, it would be a lot of help to me. > > Unfortunately, the paper you linked to ( > http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) is > behind a paywall and is $35, but if you recommend it highly enough, I'll > check it out. > > Again, thank you for being so welcome to a newbie, and for the > recommendations and links. > > -- Eric > > > On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Eric, >> >> I think that NeuroSky renamed and discontinued some of their products >> since we made the initial implementation of the ThinkCap. I am still able >> to find documentation here >> http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdfand >> http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell >> whether the complete sets now sold by NeuroSky still use the same software >> interface, but NeuroSky is rather open with their development tools. >> >> Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The >> Epoc has more channels and a head mount for the electrodes. For the Epoc >> you have to look into teh different SDK options, the cheapest version only >> gives access to processed data, not to the raw data. For both the Epoc and >> openeeg a implementation of a stand-allone executable is available in >> http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke >> for the ThinkCap, this copies the data to a "fieldtrip buffer", where >> another (c/c++/java/python/matlab) application can easily read it from and >> do the signal processing, not having to worry about the buffering and data >> representation any more. >> >> I know it falls outside your budget, but have a look at >> http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. >> These KT88-1016 systems are available from ebay. >> >> Let me add a bit from the developers perspective and software design. The >> rationale for the fieldtrip buffer is that it allows us to develop analysis >> pipelines using EEG data files on disk (using ft_read_data). Once the >> offline analysis pipeline performs as desired, we just switch from reading >> to disk to reading from the buffer (also ft_read_data). We happen to do >> this using MATLAB for the rapid application development, but the same >> strategy (develop for file, run in real-time) can be used with another >> programming environment. >> >> I think that for signal processing you'll better off if you develop the >> code using some good quality data from a file on disk. You can always enact >> a real-time data stream by replaying data from that EEG file, or using the >> sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, >> constantly having to wear the headset. That is fine for artefact detection >> (you can blink while you code), but not if the tasks get more complicated, >> e.g. relaxing to increase your occipital alpha/10Hz won't work well if you >> also have in realtime have to monitor whether your applications picks up >> the alpha. >> >> Some time ago we (i.e. Boris Reuderink and me) looked into the >> possibilities of a web-standards implementation. Web Sockets would be >> needed in Javascript if we want to have the browser connect to a >> "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky >> w.r.t. it working on all platforms. A server-side implementation offers >> more choice, python/java/php reading the data from a FT buffer or from the >> device, and then pass it on in html format to the connected web ) but would >> not scale as easily with multiple client connections if data processing >> needs to be done on the server. We then considered the best option to be >> to implement a RESTless server implementation. The server would one the one >> hand contains the FT buffer (where it receives the data over low-level TCP) >> and on the other hand have a web server with the RESTless interface. I.e. >> the requests that are represented here >> http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would >> each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" >> and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You >> can ask Boris (CC) offline whether he has given it further thought. >> >> best regards, >> Robert >> >> >> >> On 2 Mar 2013, at 3:12, Eric Mill wrote: >> >> > Hi all, >> > >> > My apologies if this is off-topic here, since you all seem like very >> busy experts! >> > >> > I'm trying to figure out what I need to get started with capturing >> real-time EEG data using consumer-priced headsets (<$200). I don't actually >> have any interest in using MATLAB, though - I just want to capture the raw >> data, in real time. >> > >> > I see that FieldTrip has a realtime acquisition module for NeuroSky's >> "ThinkCap", though I can't find a current product by NeuroSky called that. >> Is there something else of theirs I could buy that would work with >> FieldTrip? >> > >> > Or, should I be looking elsewhere entirely? What should someone who >> wants real-time EEG data do? >> > >> > My plan is to stream this data and visualize it on the web in real >> time. My background is in web development, not cognitive science, but I'm >> willing to learn what I have to make something interesting. I'd also love >> to have the project result in libraries useful for other people in the >> field. >> > >> > Thanks for any advice you can give on what EEG to buy, and/or where to >> learn the core concepts I'll need to use the data. >> > >> > -- Eric >> > _______________________________________________ >> > 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 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 6 07:37:00 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 06 Mar 2013 07:37:00 +0100 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: <5136E40C.3000509@donders.ru.nl> Hi Hamid, Your link works for me, and also other links on the tutorial page work for me. Not sure what might go wrong for you. Have you tried copy&pasting the link rather than clicking? I doubt the following, but maybe there is some firewall setting restricting access to the ftp-port for you? Best, Jörn On 3/5/2013 7:03 PM, Hamid Mohseni wrote: > Hi, > > I cannot download tutorial files e.g.: > > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip > > I tried both chrome and firefox, is there any reason? > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Mar 6 09:08:04 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 6 Mar 2013 09:08:04 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: Hi Eric, Yes, FieldTrip's raw data format is the same regardless of acquisition device, so I expect no problems switching from one device to another. Note, though, that I have not worked with the realtime buffer, but I think it ought to work the same as with offline data processing. Certain analysis pipelines (e.g. source reconstruction) require accurate information about the electrode positions. The ease at which you could obtain these might differ between different devices. However, based on the info you've given so far I guess this will not be a problem for you. Best, Eelke On 6 March 2013 05:24, Eric Mill wrote: > Sorry, that was a very long response on my part - but the one actual > question I have in there is, how easy is it to switch from one EEG device to > another? Should I expect to have to rework my code entirely, or will the > core data format and signal processing work be the same? Is standardizing > the data stream one of the things using an intermediary like Field Trip > does? > > -- Eric > > > On Sun, Mar 3, 2013 at 5:26 PM, Eric Mill wrote: >> >> This is extremely helpful, and just what I was looking for, thank you >> (both Robert and Stefan). I have a few followup questions you've inspired. >> >> How "swappable" is the hardware? Do all EEG's fundamentally produce the >> same data from the same brain activity? And/or, does FieldTrip always expose >> data in its buffer in the same format? >> >> For example, I would be fine investing the $750 for an Emotiv 14-channel >> EEG, or even the $1200 for a KT88-1016, but not until after I've done some >> development with a cheaper device first. However, I would not want to have >> to rewrite all my code, or much of it, if I switch devices. >> >> I do have a requirement that I can have the same code work with either >> live or replayed data. From how you describe its buffer approach, it sounds >> like that's a core value of FieldTrip, and will make that requirement much >> easier to satisfy. >> >> Also, I do have one peculiar requirement, which is that the hardware be >> suitable for wearing during ordinary sleeping at home. This is more a >> requirement for the final (potentially more expensive) device, than the >> development device. The promotional photo for the Emotiv EEG, for example, >> looks like it might not be so great for that. >> >> I think I will be using WebSockets, but there will be an intermediate >> server. So, I will have a computer (perhaps a Raspberry Pi) receive data >> from the EEG, and then immediately stream it up an open TCP connection to a >> web server. This server will then stream it down to the individual browsers >> of visiting users, and JavaScript will do the visualization, in something >> like Three.js or Processing.js. >> >> So I don't think I'd be making a JavaScript implementation of FieldTrip, >> but I believe the server software could be made to be general purpose, and >> reusable in the work of others like yourselves. That would be a satisfying >> byproduct. >> >> The idea here is that the resulting website will show fully live and real >> time EEG data, specifically while I am sleeping. Since I only sleep for ~1/3 >> of any given day, the ability to replay things will be helpful in giving the >> site utility during the other 2/3. >> >> I've never done any signal processing before, not even so much as a fast >> Fourier transform. But I'm willing to learn! I'll be consulting the tutorial >> you've kindly written, but if you have any suggestions of learning material >> I should look at when figuring out how to (for example) detect when a >> subject has entered levels of sleep given streams of EEG data, it would be a >> lot of help to me. >> >> Unfortunately, the paper you linked to >> (http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) >> is behind a paywall and is $35, but if you recommend it highly enough, I'll >> check it out. >> >> Again, thank you for being so welcome to a newbie, and for the >> recommendations and links. >> >> -- Eric >> >> >> On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld >> wrote: >>> >>> Hi Eric, >>> >>> I think that NeuroSky renamed and discontinued some of their products >>> since we made the initial implementation of the ThinkCap. I am still able >>> to find documentation here >>> http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf >>> and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell >>> whether the complete sets now sold by NeuroSky still use the same software >>> interface, but NeuroSky is rather open with their development tools. >>> >>> Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The >>> Epoc has more channels and a head mount for the electrodes. For the Epoc you >>> have to look into teh different SDK options, the cheapest version only gives >>> access to processed data, not to the raw data. For both the Epoc and openeeg >>> a implementation of a stand-allone executable is available in >>> http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for >>> the ThinkCap, this copies the data to a "fieldtrip buffer", where another >>> (c/c++/java/python/matlab) application can easily read it from and do the >>> signal processing, not having to worry about the buffering and data >>> representation any more. >>> >>> I know it falls outside your budget, but have a look at >>> http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. >>> These KT88-1016 systems are available from ebay. >>> >>> Let me add a bit from the developers perspective and software design. The >>> rationale for the fieldtrip buffer is that it allows us to develop analysis >>> pipelines using EEG data files on disk (using ft_read_data). Once the >>> offline analysis pipeline performs as desired, we just switch from reading >>> to disk to reading from the buffer (also ft_read_data). We happen to do this >>> using MATLAB for the rapid application development, but the same strategy >>> (develop for file, run in real-time) can be used with another programming >>> environment. >>> >>> I think that for signal processing you'll better off if you develop the >>> code using some good quality data from a file on disk. You can always enact >>> a real-time data stream by replaying data from that EEG file, or using the >>> sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, >>> constantly having to wear the headset. That is fine for artefact detection >>> (you can blink while you code), but not if the tasks get more complicated, >>> e.g. relaxing to increase your occipital alpha/10Hz won't work well if you >>> also have in realtime have to monitor whether your applications picks up the >>> alpha. >>> >>> Some time ago we (i.e. Boris Reuderink and me) looked into the >>> possibilities of a web-standards implementation. Web Sockets would be >>> needed in Javascript if we want to have the browser connect to a "fieldtrip >>> buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it >>> working on all platforms. A server-side implementation offers more choice, >>> python/java/php reading the data from a FT buffer or from the device, and >>> then pass it on in html format to the connected web ) but would not scale as >>> easily with multiple client connections if data processing needs to be done >>> on the server. We then considered the best option to be to implement a >>> RESTless server implementation. The server would one the one hand contains >>> the FT buffer (where it receives the data over low-level TCP) and on the >>> other hand have a web server with the RESTless interface. I.e. the requests >>> that are represented here >>> http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would >>> each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" and >>> "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask >>> Boris (CC) offline whether he has given it further thought. >>> >>> best regards, >>> Robert >>> >>> >>> >>> On 2 Mar 2013, at 3:12, Eric Mill wrote: >>> >>> > Hi all, >>> > >>> > My apologies if this is off-topic here, since you all seem like very >>> > busy experts! >>> > >>> > I'm trying to figure out what I need to get started with capturing >>> > real-time EEG data using consumer-priced headsets (<$200). I don't actually >>> > have any interest in using MATLAB, though - I just want to capture the raw >>> > data, in real time. >>> > >>> > I see that FieldTrip has a realtime acquisition module for NeuroSky's >>> > "ThinkCap", though I can't find a current product by NeuroSky called that. >>> > Is there something else of theirs I could buy that would work with >>> > FieldTrip? >>> > >>> > Or, should I be looking elsewhere entirely? What should someone who >>> > wants real-time EEG data do? >>> > >>> > My plan is to stream this data and visualize it on the web in real >>> > time. My background is in web development, not cognitive science, but I'm >>> > willing to learn what I have to make something interesting. I'd also love to >>> > have the project result in libraries useful for other people in the field. >>> > >>> > Thanks for any advice you can give on what EEG to buy, and/or where to >>> > learn the core concepts I'll need to use the data. >>> > >>> > -- Eric >>> > _______________________________________________ >>> > 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 >> >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Gregor.Volberg at psychologie.uni-regensburg.de Wed Mar 6 09:50:55 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Wed, 06 Mar 2013 09:50:55 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Message-ID: <5137117F0200005700011F41@gwsmtp1.uni-regensburg.de> Hi Gio, Jan-Mathijs and Jörn, thank you all for your helpful replies. Gio, a special 'thank you' for your very detailled response. These are very interesting points, though somewhat beyond of what I try to do. I will be working through the suggested literature and the new tutorial and might come back later if there are further questions. Best regard, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> Gio Piantoni 05.03.2013 09:20 >>> Hi Gregor, I also like the surface approach a lot, but things get really complicated when you have to average across subjects. I don't know if you are familiar with statistics in freesurfer, but what they do is to convert the source points of the single subject to a subject-specific sphere. Then the sphere is averaged across subjects. The coregistration between these spheres takes advantage of landmarks. See my attempt at: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-September/005585.html If I understand you correctly, you are at step 3). You can use smudge to get to the high-resolution smoothwm (or pial). Then the number of vertices in smoothwm corresponds to the number of vertices in the sphere. Here you have two options: use fieldtrip code or MNE code. I tried using fieldtrip code, but where I got stuck was to do statistics on the averaged sphere (taken from fsaverage). I used this code: https://github.com/gpiantoni/eventbased/blob/77c3f85ef94baf9d4ab629d48a31e8046c924518/powsource_grand.m#L136-L158 where data{i1,i2,p,h} is already projected onto the subject-specific sphere. However, after projecting to the averaged sphere, you need to do statistics on a 2-d cortical sheet and, from my understanding, the subfunctions to create clusters do not work all that well. I think it'd be very powerful to do statistics on a 2d sheet. See http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004749.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2012-February/004766.html for discussion. I did not get far because the clustering methods needed updated to work on cortical sheets in an efficient manner. Another route you can try is to use the MNE/freesurfer software to do that. See for example: http://martinos.org/mne/manual/morph.html You'd just write the surface to disk and use MNE/freesurfer. I personally don't like the method to correct for multiple comparisons in freesurfer (which I think might give false positive) and I think that the fieldtrip stats is better, but I had some problems getting to work on 2-d cortical sheets. For the moment, I decided to go with the volume-based approach, although I have the feeling that it's less accurate and less sensitive. See also: Tucholka, A., Fritsch, V., Poline, J.-B., and Thirion, B. (2012). An empirical comparison of surface-based and volume-based group studies in neuroimaging. Neuroimage 63, 1443–1453. Maybe I confused you more than helped, but if you manage to do statistics on surfaces, please let me know because I'd be interested in using it. Hope this helps. Gio -- Giovanni Piantoni, MSc Dept. Sleep & Cognition Netherlands Institute for Neuroscience Meibergdreef 47 1105 BA Amsterdam (NL) +31 20 5665492 gio at gpiantoni.com www.gpiantoni.com On Mon, Mar 4, 2013 at 6:45 PM, Gregor Volberg wrote: > Dear Fieldtrippers, > > I need to ask for a helpful hint on MNE source reconstructions. Following > this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I > obtained nice individual cortical meshes and source points; the MNE forward > and inverse solution for the individuals all work well. I would now like to > normalize the individual grids to a template brain in order to do statistics > and averaging for plotting. I figured out that I could use > ft_sourceinterpolate to tranform the grid into a volumetric representation, > and then use ft_volumenormalise to normalise to a standard brain. But this > did not work too well for source structures containing time series (like > 'mne'-stcutures) where the computational load gets very high. I also tried > to use a grid of one subject as a template for the other subject's grids > with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to > require two grids with the same number of source points as input(?). > Is there a way to do a normalisation directly on brain triangulations / > source grids ? Thanks for any help! > Best regards, > Gregor > > -- > Dr. rer. nat. Gregor Volberg > ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Wed Mar 6 10:37:37 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Wed, 6 Mar 2013 09:37:37 +0000 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Thanks, It works fine today, Regards On 6 March 2013 06:37, "Jörn M. Horschig" wrote: > Hi Hamid, > > Your link works for me, and also other links on the tutorial page work for > me. Not sure what might go wrong for you. Have you tried copy&pasting the > link rather than clicking? I doubt the following, but maybe there is some > firewall setting restricting access to the ftp-port for you? > > Best, > Jörn > > > > On 3/5/2013 7:03 PM, Hamid Mohseni wrote: > > Hi, > > I cannot download tutorial files e.g.: > > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip > > I tried both chrome and firefox, is there any reason? > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.ye.mei at gmail.com Wed Mar 6 22:35:53 2013 From: frank.ye.mei at gmail.com (Ye Mei) Date: Wed, 06 Mar 2013 16:35:53 -0500 Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well, (jan-mathijs schoffelen) In-Reply-To: References: Message-ID: <5137B6B9.5080400@gmail.com> Hi Jan-Mathijs, Thank you very much for the reply. I think the problem starts at "mri_sliced = ft_volumereslice([], mri);" before using "ft_volumesegment.". The attached file "beforevolumnslice.png" is the result of "imagesc(squeeze(mri.anatomy(:,111,:)))"; The attached file "aftervolumnslice.png" is the result of "imagesc(squeeze(mri_sliced.anatomy(:,111,:)))". We can see part of the head in "aftervolumnslice.png" is already sliced away. Could one do source localization without using "mri_sliced = ft_volumereslice([], mri);"? To circumvent the problem, I am trying to use FreeSurfer instead of ft_volumereslice and ft_volumesegment. I had several .mgz files from freesurfer. Can I do the following? -------- mri=ft_read_mri("brain.mgz"); %brain.mgz is the segmented brain by FreeSurfer cfg = []; cfg.method ='fiducial'; cfg.fiducial.nas = [30 132 96];% position of Nasion cfg.fiducial.lpa = [127 113 170];% position of LPA cfg.fiducial.rpa = [125 115 18]% position of RPA cfg.fiducial.zpoint = [125 125 220] [mri_aligned] = ft_volumerealign(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, mri_aligned); ... --------- thanks ahead, Ye On 13-02-28 05:10 PM, fieldtrip-request at science.ru.nl wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: NIHC-BrainGain Tutorial Day - March 21, 2013 > (Robert Oostenveld) > 2. Re: segmented brain seems not fitting the sensor helmet well > (jan-mathijs schoffelen) > 3. Re: segmented brain seems not fitting the sensor helmet well > (Ye Mei) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 28 Feb 2013 17:46:39 +0100 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] NIHC-BrainGain Tutorial Day - March 21, 2013 > Message-ID: <9741C083-F00A-4BC9-86EF-FB99715576A7 at donders.ru.nl> > Content-Type: text/plain; charset=windows-1252 > > Dear FieldTrip users, > > The NIHC-BrainGain Tutorial Day marks the end of the BrainGain project. For the last 6 years, the development and continued support of FieldTrip for normal/offline and realtime/online analysis has received support from the BrainGain project. > > There is now more information available online on this tutorial day, please see > https://www.hersenenencognitie.nl/contents/1876 > https://www.hersenenencognitie.nl/contents/1915 > > If you happen to be close to Nijmegen, you might also want to come to the "Breinfest" on Tuesday evening 19 March in the city centre with talks by international speakers and BCI demo's for the general public. Personally, I will be demonstrating how real-time data streaming and processing can be done using the FieldTrip buffer to various platforms (OS X, WIndows, Linux), to the Raspberry Pi and even to an Arduino (yes, fieldtrip runs on an arduino! ... well, a small part of it runs on an arduino). See http://www.ru.nl/breinfest for details on the evening. > > best regards, > Robert > > > > On 19 Feb 2013, at 14:30, Robert Oostenveld wrote: > >> NIHC-BrainGain Tutorial Day: >> Tools and novelties in neurotechnology research >> >> We invite PhD students, post-docs and senior researchers working in the fields of brain-computer interfacing (BCI), neurofeedback, cognitive neuroscience, neuroinformatics, neurosurgery and related topics to our Tutorial Day on March 21st, 2013 in the Sanadome Nijmegen. >> The day marks the end of the BrainGain consortium, a six-year joint-effort project on Brain-Computer Interfacing and related technologies. More information on BrainGain can be found here. >> >> The Tutorial Day will consist of a 'tools' track and a 'novelties? track. The 'tools' track is intended to provide both newcomers to the field and experienced researchers with an overview of the tools needed to integrate cognitive neuroscience and advanced invasive and non-invasive technology. Topics range from data streaming to modelling and statistics, and from online fMRI decoding to a crash course in neuroethics., You will also receive some helpful insights for a future career, in case you are interested in applying for a grant in the near future or considering setting up your own company. >> The 'novelties' track covers a wide range of topics indicating some of the possible topics to be further explored in BCI and neurotechnology research, including genetics, robotics and intracranial recordings. >> There is no need to stick to one of the two tracks the whole day: you are free to switch between tracks any time. >> >> In parallel to the lectures, there will be several interesting demonstrations. >> >> The full programme and registration form can be found on the NIHC website (https://www.hersenenencognitie.nl). Please register before 1 March 2013. Participation is free. Lunch and drinks will be provided. >> >> We hope to welcome you on March 21st in Nijmegen! >> >> Susanna Bicknell >> Radboud University Nijmegen >> ____________________________________________________________________ >> Faculty of Science | Finance and Economic Affairs | Project Management | LC-IMPACT >> Faculty of Social Sciences | Donders Centre for Cognition | BRAINGAIN | Project Manager >> T +31 24 3653300 | HG00.616 (Monday, Thursday) >> Faculty of Science | IMAPP | T +31 24 3652972 | HG07.315 (Tuesday, Wednesday) >> Postal address: P.O. Box 9010, 6500 GL Nijmegen, The Netherlands >> Visiting and courier service address: Heyendaalseweg 135, 6525 AJ Nijmegen, The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 2 > Date: Thu, 28 Feb 2013 18:54:14 +0100 > From: jan-mathijs schoffelen > To: FieldTrip discussion list > Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor > helmet well > Message-ID: > Content-Type: text/plain; charset="us-ascii" > > Hi Ye, > > Looks like a coregistration problem to me. In other words, something went wrong in ft_volumesegment, because the images were not sufficiently aligned. You need to investigate the input and output of ft_volumesegment. > Do you use ft_volumerealign after calling ft_volumesegment? This should be the other way around. > > Best, > > Jan-Mathijs > > > On Feb 28, 2013, at 5:38 PM, Ye Mei wrote: > >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Thu, 28 Feb 2013 17:09:57 -0500 > From: Ye Mei > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor > helmet well > Message-ID: <512FD5B5.8080700 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hello All, > > I found the problem I mentioned in the previous email was caused by > using "mri_sliced = ft_volumereslice([], mri);" before using > ft_volumesegment. > After erasing the line "mri_sliced = ft_volumereslice([], mri);", the > segmented brain seems to be normal and fits the sensor helmet well now, > as show in the attached figure(notvolumnsliced.jpg). > For another of my subject, if the "ft_volumereslice" is included, the > brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" > it looks normal(subject2.jpg). > > I notice in the fieldtrip headmodel tutorial > (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), > "ft_volumereslice" is not used. but in the field trip beamformer > tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. > > I am wondering if I should include "ft_volumereslice" in my source > localization code. Can anyone give me some suggestions? > > > > thanks ahead, > Ye > > > > > On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. segmented brain seems not fitting the sensor helmet well (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 11:38:21 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512F87FD.80500 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: brain.png >> Type: image/png >> Size: 15197 bytes >> Desc: not available >> URL: >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: head.jpg >> Type: image/jpeg >> Size: 50294 bytes >> Desc: not available >> URL: >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 31 >> ***************************************** > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: notvolumnsliced.jpg > Type: image/jpeg > Size: 28621 bytes > Desc: not available > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: subject2.jpg > Type: image/jpeg > Size: 27415 bytes > Desc: not available > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: subject2vc.jpg > Type: image/jpeg > Size: 27788 bytes > Desc: not available > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 27, Issue 32 > ***************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: beforevolumnslice.png Type: image/png Size: 73996 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aftervolumnslice.png Type: image/png Size: 63576 bytes Desc: not available URL: From ajaymaddirala at gmail.com Thu Mar 7 08:29:43 2013 From: ajaymaddirala at gmail.com (ajay maddirala) Date: Wed, 6 Mar 2013 23:29:43 -0800 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Hi, I need MEG pure data. 150 channel 147 for recording brain signals 3 channels for record environment noise. please help me thank you. On Wed, Mar 6, 2013 at 1:37 AM, Hamid Mohseni wrote: > Thanks, It works fine today, > > Regards > > > On 6 March 2013 06:37, "Jörn M. Horschig" wrote: > >> Hi Hamid, >> >> Your link works for me, and also other links on the tutorial page work >> for me. Not sure what might go wrong for you. Have you tried copy&pasting >> the link rather than clicking? I doubt the following, but maybe there is >> some firewall setting restricting access to the ftp-port for you? >> >> Best, >> Jörn >> >> >> >> On 3/5/2013 7:03 PM, Hamid Mohseni wrote: >> >> Hi, >> >> I cannot download tutorial files e.g.: >> >> ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip >> >> I tried both chrome and firefox, is there any reason? >> >> -- >> Hamid R. Mohseni, PhD >> Post-Doctoral Research Assistant >> Institute of Biomedical Engineering >> University of Oxford, OX3 7DQ, UK >> Tel: +44 (0) 1865 2 83826 >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- AJAY KUMAR.MADDIRALA, Research Scholar, Department of Electronics & Electrical Engg (EEE), Indian Institute of Technology Guwahati (IITG), Guwahati, Assam State, India. cell +918011212952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Mar 7 08:29:35 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 07 Mar 2013 08:29:35 +0100 Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well, (jan-mathijs schoffelen) In-Reply-To: <5137B6B9.5080400@gmail.com> References: <5137B6B9.5080400@gmail.com> Message-ID: <513841DF.7090701@donders.ru.nl> Hi Ye, could the problem be related to setting a wrong (or no) coordinate system? I am not an expert in anatomical preprocessing, but to me it seems that volumereslice assumes a false origin, thereby 'moving' the brain out of the picture. Also your first pictures you sent seem to me like a coordinate mismatch. Additionally, as you suggested, I think volumereslice is not necessary at all. It already looks fine beforehands and obviously, you do not specify any parameter, so why use it after all? I'd try to do it without ft_volumereslice, but check what coordinate system you are in, e.g. use ft_determine_coordsys(mri) after reading in your mri. Best, Jörn On 3/6/2013 10:35 PM, Ye Mei wrote: > Hi Jan-Mathijs, > > Thank you very much for the reply. > > I think the problem starts at "mri_sliced = ft_volumereslice([], > mri);" before using "ft_volumesegment.". > > The attached file "beforevolumnslice.png" is the result of > "imagesc(squeeze(mri.anatomy(:,111,:)))"; > The attached file "aftervolumnslice.png" is the result of > "imagesc(squeeze(mri_sliced.anatomy(:,111,:)))". > > We can see part of the head in "aftervolumnslice.png" is already > sliced away. > > Could one do source localization without using "mri_sliced = > ft_volumereslice([], mri);"? > > To circumvent the problem, I am trying to use FreeSurfer instead of > ft_volumereslice and ft_volumesegment. I had several .mgz files from > freesurfer. > Can I do the following? > -------- > mri=ft_read_mri("brain.mgz"); %brain.mgz is the segmented brain by > FreeSurfer > > cfg = []; > cfg.method ='fiducial'; > cfg.fiducial.nas = [30 132 96];% position of Nasion > cfg.fiducial.lpa = [127 113 170];% position of LPA > cfg.fiducial.rpa = [125 115 18]% position of RPA > cfg.fiducial.zpoint = [125 125 220] > [mri_aligned] = ft_volumerealign(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, mri_aligned); > ... > --------- > > thanks ahead, > Ye > > > On 13-02-28 05:10 PM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Re: NIHC-BrainGain Tutorial Day - March 21, 2013 >> (Robert Oostenveld) >> 2. Re: segmented brain seems not fitting the sensor helmet well >> (jan-mathijs schoffelen) >> 3. Re: segmented brain seems not fitting the sensor helmet well >> (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 17:46:39 +0100 >> From: Robert Oostenveld >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] NIHC-BrainGain Tutorial Day - March 21, 2013 >> Message-ID: <9741C083-F00A-4BC9-86EF-FB99715576A7 at donders.ru.nl> >> Content-Type: text/plain; charset=windows-1252 >> >> Dear FieldTrip users, >> >> The NIHC-BrainGain Tutorial Day marks the end of the BrainGain >> project. For the last 6 years, the development and continued support >> of FieldTrip for normal/offline and realtime/online analysis has >> received support from the BrainGain project. >> >> There is now more information available online on this tutorial day, >> please see >> https://www.hersenenencognitie.nl/contents/1876 >> https://www.hersenenencognitie.nl/contents/1915 >> >> If you happen to be close to Nijmegen, you might also want to come to >> the "Breinfest" on Tuesday evening 19 March in the city centre with >> talks by international speakers and BCI demo's for the general >> public. Personally, I will be demonstrating how real-time data >> streaming and processing can be done using the FieldTrip buffer to >> various platforms (OS X, WIndows, Linux), to the Raspberry Pi and >> even to an Arduino (yes, fieldtrip runs on an arduino! ... well, a >> small part of it runs on an arduino). See http://www.ru.nl/breinfest >> for details on the evening. >> >> best regards, >> Robert >> >> >> >> On 19 Feb 2013, at 14:30, Robert Oostenveld wrote: >> >>> NIHC-BrainGain Tutorial Day: >>> Tools and novelties in neurotechnology research >>> We invite PhD students, post-docs and senior researchers working >>> in the fields of brain-computer interfacing (BCI), neurofeedback, >>> cognitive neuroscience, neuroinformatics, neurosurgery and related >>> topics to our Tutorial Day on March 21st, 2013 in the Sanadome >>> Nijmegen. >>> The day marks the end of the BrainGain consortium, a six-year >>> joint-effort project on Brain-Computer Interfacing and related >>> technologies. More information on BrainGain can be found here. >>> The Tutorial Day will consist of a 'tools' track and a 'novelties? >>> track. The 'tools' track is intended to provide both newcomers to >>> the field and experienced researchers with an overview of the tools >>> needed to integrate cognitive neuroscience and advanced invasive and >>> non-invasive technology. Topics range from data streaming to >>> modelling and statistics, and from online fMRI decoding to a crash >>> course in neuroethics., You will also receive some helpful insights >>> for a future career, in case you are interested in applying for a >>> grant in the near future or considering setting up your own company. >>> The 'novelties' track covers a wide range of topics indicating some >>> of the possible topics to be further explored in BCI and >>> neurotechnology research, including genetics, robotics and >>> intracranial recordings. >>> There is no need to stick to one of the two tracks the whole day: >>> you are free to switch between tracks any time. >>> In parallel to the lectures, there will be several interesting >>> demonstrations. >>> The full programme and registration form can be found on the NIHC >>> website (https://www.hersenenencognitie.nl). Please register before >>> 1 March 2013. Participation is free. Lunch and drinks will be provided. >>> We hope to welcome you on March 21st in Nijmegen! >>> Susanna Bicknell >>> Radboud University Nijmegen >>> ____________________________________________________________________ >>> Faculty of Science | Finance and Economic Affairs | Project >>> Management | LC-IMPACT >>> Faculty of Social Sciences | Donders Centre for Cognition | >>> BRAINGAIN | Project Manager >>> T +31 24 3653300 | HG00.616 (Monday, Thursday) >>> Faculty of Science | IMAPP | T +31 24 3652972 | HG07.315 (Tuesday, >>> Wednesday) >>> Postal address: P.O. Box 9010, 6500 GL Nijmegen, The Netherlands >>> Visiting and courier service address: Heyendaalseweg 135, 6525 AJ >>> Nijmegen, The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Thu, 28 Feb 2013 18:54:14 +0100 >> From: jan-mathijs schoffelen >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Ye, >> >> Looks like a coregistration problem to me. In other words, something >> went wrong in ft_volumesegment, because the images were not >> sufficiently aligned. You need to investigate the input and output of >> ft_volumesegment. >> Do you use ft_volumerealign after calling ft_volumesegment? This >> should be the other way around. >> >> Best, >> >> Jan-Mathijs >> >> >> On Feb 28, 2013, at 5:38 PM, Ye Mei wrote: >> >>> Hello FieldtripList, >>> >>> After segmentation and alignment using >>> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >>> segmented >>> brain seems rotated forward in the sensor helmet(brain.png) and the >>> cerebellum part seems to be segmented out. However, his head MRI seems >>> fitting the sensor helmet well(head.jpg). My another subject's brain >>> seem to be correctly segmented without missing the cerebellum part. And >>> the brain is not rotated forward. >>> >>> Could might be the problem? >>> >>> thanks ahead, >>> Ye >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 3 >> Date: Thu, 28 Feb 2013 17:09:57 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512FD5B5.8080700 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello All, >> >> I found the problem I mentioned in the previous email was caused by >> using "mri_sliced = ft_volumereslice([], mri);" before using >> ft_volumesegment. >> After erasing the line "mri_sliced = ft_volumereslice([], mri);", the >> segmented brain seems to be normal and fits the sensor helmet well now, >> as show in the attached figure(notvolumnsliced.jpg). >> For another of my subject, if the "ft_volumereslice" is included, the >> brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" >> it looks normal(subject2.jpg). >> >> I notice in the fieldtrip headmodel tutorial >> (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), >> "ft_volumereslice" is not used. but in the field trip beamformer >> tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. >> >> I am wondering if I should include "ft_volumereslice" in my source >> localization code. Can anyone give me some suggestions? >> >> >> >> thanks ahead, >> Ye >> >> >> >> >> On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >>> Send fieldtrip mailing list submissions to >>> fieldtrip at science.ru.nl >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> or, via email, send a message with subject or body 'help' to >>> fieldtrip-request at science.ru.nl >>> >>> You can reach the person managing the list at >>> fieldtrip-owner at science.ru.nl >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of fieldtrip digest..." >>> >>> >>> Today's Topics: >>> >>> 1. segmented brain seems not fitting the sensor helmet well (Ye >>> Mei) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Thu, 28 Feb 2013 11:38:21 -0500 >>> From: Ye Mei >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] segmented brain seems not fitting the sensor >>> helmet well >>> Message-ID: <512F87FD.80500 at gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >>> >>> Hello FieldtripList, >>> >>> After segmentation and alignment using >>> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >>> segmented >>> brain seems rotated forward in the sensor helmet(brain.png) and the >>> cerebellum part seems to be segmented out. However, his head MRI seems >>> fitting the sensor helmet well(head.jpg). My another subject's brain >>> seem to be correctly segmented without missing the cerebellum part. And >>> the brain is not rotated forward. >>> >>> Could might be the problem? >>> >>> thanks ahead, >>> Ye >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: brain.png >>> Type: image/png >>> Size: 15197 bytes >>> Desc: not available >>> URL: >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: head.jpg >>> Type: image/jpeg >>> Size: 50294 bytes >>> Desc: not available >>> URL: >>> >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> End of fieldtrip Digest, Vol 27, Issue 31 >>> ***************************************** >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: notvolumnsliced.jpg >> Type: image/jpeg >> Size: 28621 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: subject2.jpg >> Type: image/jpeg >> Size: 27415 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: subject2vc.jpg >> Type: image/jpeg >> Size: 27788 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 32 >> ***************************************** > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at DONDERS.RU.NL Thu Mar 7 09:49:27 2013 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Thu, 7 Mar 2013 09:49:27 +0100 Subject: [FieldTrip] new set of template sourcemodels uploaded Message-ID: Dear all, I just uploaded a new set of template sourcemodels into fieldtrip/template/sourcemodel, and I removed the old ones. You can read about it here: http://fieldtrip.fcdonders.nl/template/sourcemodel This change may be of consequence for your own analyses, if you rely on these templates. This is only likely when you are using beamformers for source reconstruction, and you use sourcemodels (grids) that have been created using an inverse warp of a template sourcemodel. Essentially, the change has consequences if you use cfg.grid.warpmni = 'yes' in ft_prepare_sourcemodel. The old sourcemodels are different from the new ones, and a group analysis across subjects can obviously only be performed when the subjects have been processed all with the same template sourcemodel. Of course we recommend the new version, but if you prefer to stick to the old version, you can only recover them from older versions of FieldTrip, because we have removed them from the release version as of now (i.e. svn revision number 7600, March 7, 2013). Happy computing, Jan-Mathijs Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Mar 7 10:01:00 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 7 Mar 2013 10:01:00 +0100 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Hi Ajay, I also need pure MEG data, but typically the data I record is quite noisy ;-). Seriously, you may want to have a look here: http://cobre.mrn.org/megsim/ Please try to be a bit more specific next time when asking questions on this list. Best wishes, Jan-Mathijs On Mar 7, 2013, at 8:29 AM, ajay maddirala wrote: > Hi, I need MEG pure data. > > 150 channel > > 147 for recording brain signals > 3 channels for record environment noise. > please help me thank you. > AJAY KUMAR.MADDIRALA, > Research Scholar, > Department of Electronics & Electrical Engg (EEE), > Indian Institute of Technology Guwahati (IITG), > Guwahati, > Assam State, > India. > cell +918011212952 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Thu Mar 7 13:08:56 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Thu, 7 Mar 2013 13:08:56 +0100 Subject: [FieldTrip] auditory evoked gamma Message-ID: Hi, I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 8 02:16:32 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 7 Mar 2013 20:16:32 -0500 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: Message-ID: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Hi Nenad On 7 Mar 2013, at 7:08, Nenad Polomac wrote: > I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. best regards, Robert From smoratti at psi.ucm.es Fri Mar 8 08:51:00 2013 From: smoratti at psi.ucm.es (Stephan Moratti) Date: Fri, 8 Mar 2013 08:51:00 +0100 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Message-ID: Dear Nenad, An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). It should also work for EEG and is easy to implement. Best, Stephan El 08/03/2013, a las 02:16, Robert Oostenveld escribió: > Hi Nenad > > On 7 Mar 2013, at 7:08, Nenad Polomac wrote: >> I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. > > > Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. > > One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. > > If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. > > best regards, > Robert > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Peyman.Adjamian at ihr.mrc.ac.uk Fri Mar 8 09:47:52 2013 From: Peyman.Adjamian at ihr.mrc.ac.uk (Peyman Adjamian) Date: Fri, 8 Mar 2013 08:47:52 +0000 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: Message-ID: <82BB4DFB02A77749989A31D0F5BFA1A006AAEE0A@eir.nus.ihr.mrc.ac.uk> Dear Nenad, >From my experience, auditory gamma activity is not a robust effect, certainly not as prevalent and robust as the visual gamma activity which is best induced by high contrast stimuli at certain spatial frequencies. So whether you observe auditory gamma activity or not very much depends on your type of stimulus. Can I ask what auditory stimuli you are using to induce gamma activity? Assuming that auditory gamma activity exists at all, and given that you use the appropriate stimulus, you should see it with DICS or some other beamformer. To avoid correlated sources, you can analyse right and left channels separately perhaps. I hope this helps. Peyman ========================================================================== Dr Peyman Adjamian Investigator Scientist MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115) 922 3431 Fax: (0115) 951 8503 Email: peyman at ihr.mrc.ac.uk From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Nenad Polomac Sent: 07 March 2013 12:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] auditory evoked gamma Hi, I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eschulz at lrz.tu-muenchen.de Fri Mar 8 13:31:32 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Fri, 8 Mar 2013 13:31:32 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Message-ID: Dear Lilla and Jörn, thank you very much for your reply on my problem. I already checked the example sites but got still error messages. For creating the (leadfield) grid variable used the template files provided by Fieldtrip. vol structure: load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); I created a sensor structure based on the "standard_1020.elc" file. sens = chanpos: [65x3 double] elecpos: [65x3 double] label: {65x1 cell} type: 'ext1020' unit: 'mm' pnt: [65x3 double] I started creating the leadfiled: cfg = []; cfg.elec = sens; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; [grid65] = ft_prepare_leadfield(cfg); Finally I got the following error message. ??? Reference to non-existent field 'pnt'. Error in ==> ft_prepare_vol_sens at 301 sens.pnt = sens.pnt(selsens,:); Error in ==> prepare_headmodel at 90 [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ==> ft_prepare_leadfield at 148 [vol, sens, cfg] = prepare_headmodel(cfg, data); That error message is funny because my sens variable has a sens.pnt subnode. I (hopefully) solved the problem by editing the " ft_prepare_vol_sens"function and loading the sens variable just before the error line in the 295. It is running now but is that way correct? Any help is highly appreciated. Thank you very much. Best, Enrico On 5 March 2013 12:08, wrote: > Dear Enrico, > > I think more information is needed about the error messages and about how > you try to compute leadfield in order to help. > > If you have not encountered the FT tutorial sites, example scripts and > FAQs yet, maybe you can check out those as well because they provide > information on source-reconstruction, leadfields... etc.. > (For example, a tutorial for EEG headmodels: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example script > for leadfield computation: > http://fieldtrip.fcdonders.nl/example/compute_leadfield). > > Best, > Lilla > > > > Dear Fieldtrip experts, > > > > I would like to create a leadfield based on the standard brain provided > by > > the fieldtrip package and standard electrode positions. > > Unfortunately, whatever I'm trying it ends up in a number of error > > messages. > > > > Is anybody out there who could provide some support? > > > > Thank you very much in advance, > > Best, > > Enrico > > > > > > -- > > Dr. Enrico Schulz > > Postdoc > > Klinikum rechts der Isar der Technischen Universität München > > Neurologische Klinik und Poliklinik > > Neuro-Kopf-Zentrum > > Ismaningerstr. 22 > > 81675 München > > > > Tel.: 089-4140-7664 > > _______________________________________________ > > 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 > -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Mar 8 15:52:27 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 08 Mar 2013 15:52:27 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Message-ID: <5139FB2A.50300@donders.ru.nl> Dear Enrico, the error you are describing is clearly from a rather old version of FieldTrip, because sens.pnt is deprecated. Could you make sure that you are using the newest FieldTrip version? Since you load from c:\...\fieldtrip-20130307\... I assume that you downloaded the newest version already. It might be that either you have not updated your startup script in adding the correct FieldTrip version or that you are adding both, an old and a new FieldTrip version to your Matlab path. You could check in Matlab what function is being used by typing: / which ft_prepare_vol_sens/ If you want to add only the newest FieldTrip and remove the old one, you can call///restoredefaultpath/ in Matlab. The add c:\MATLAB\R2009b\work\fieldtrip-20130307\ to your path and call /ft_def//aults/. That should solve the issue. Note that your Matlab is _definitely_ calling an old FT version, because the line tyour error comes from does not exist anymore (i.e. it has been rewritten, because sens.pnt is deprecated) Hope it works out for you! Best, Jörn. On 3/8/2013 1:31 PM, Enrico Schulz wrote: > Dear Lilla and Jörn, > > thank you very much for your reply on my problem. > I already checked the example sites but got still error messages. > > For creating the (leadfield) grid variable used the template files > provided by Fieldtrip. > vol structure: > load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); > > I created a sensorstructure based on the "standard_1020.elc" file. > > sens = > > chanpos: [65x3 double] > elecpos: [65x3 double] > label: {65x1 cell} > type: 'ext1020' > unit: 'mm' > pnt: [65x3 double] > > I started creating the leadfiled: > cfg = []; > cfg.elec = sens; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid65] = ft_prepare_leadfield(cfg); > > > Finally I got the following error message. > ??? Reference to non-existent field 'pnt'. > > Error in ==> ft_prepare_vol_sens at 301 > sens.pnt = sens.pnt(selsens,:); > > Error in ==> prepare_headmodel at 90 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order', > cfg.order); > > Error in ==> ft_prepare_leadfield at 148 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > That error message is funny because my sens variable has a sens.pnt > subnode. > > I (hopefully) solved the problem by editing the "ft_prepare_vol_sens" > function and loading the sens variable just before the error line in > the 295. It is running now but is that way correct? > > Any help is highly appreciated. > Thank you very much. > Best, > Enrico > > > On 5 March 2013 12:08, > wrote: > > Dear Enrico, > > I think more information is needed about the error messages and > about how > you try to compute leadfield in order to help. > > If you have not encountered the FT tutorial sites, example scripts and > FAQs yet, maybe you can check out those as well because they provide > information on source-reconstruction, leadfields... etc.. > (For example, a tutorial for EEG headmodels: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an > example script > for leadfield computation: > http://fieldtrip.fcdonders.nl/example/compute_leadfield). > > Best, > Lilla > > > > Dear Fieldtrip experts, > > > > I would like to create a leadfield based on the standard brain > provided by > > the fieldtrip package and standard electrode positions. > > Unfortunately, whatever I'm trying it ends up in a number of error > > messages. > > > > Is anybody out there who could provide some support? > > > > Thank you very much in advance, > > Best, > > Enrico > > > > > > -- > > Dr. Enrico Schulz > > Postdoc > > Klinikum rechts der Isar der Technischen Universität München > > Neurologische Klinik und Poliklinik > > Neuro-Kopf-Zentrum > > Ismaningerstr. 22 > > 81675 München > > > > Tel.: 089-4140-7664 > > _______________________________________________ > > 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 > > > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mushfa.yousuf at googlemail.com Fri Mar 8 16:12:52 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Fri, 8 Mar 2013 16:12:52 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> Message-ID: Hello; I have few problems while calculating combine “MEG & EEG” source reconstruction and I need your help to troubleshoot the problems. I have a data from a Parkinson’s disease patient who underwent DBS and we recorded 306 MEG channels and 64 EEG channels simultaneously, first I have calculated the leadfield individually for both EEG and MEG. I have defined all the calculations step by step so that I can describe my problems very precisely. *CALCULATE THE LEADFIELD FOR MEG CHANNELS:-* // I have defined the Pre-Stimulus data i.e. Stim-off data in the original code. *Reading raw data set for MEG channels* * * cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'MEG'}; *// In order to read raw data only for MEG channels* dataFIC12 = ft_preprocessing(cfg); After that I have defined the *time of window of interest* for the MEG raw data set cfg.toilim = [0 0.5]; dataPost = ft_redefinetrial(cfg, dataFIC12); and calculate the *Power Spectral density matrix* for the MEG channels data set cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the stimulation frequency cfg.pad = 1; freqPost = ft_freqanalysis(cfg, dataPost); Now next step for me is to choose the method for the Head Model. I have noticed that Singlesphere is the common method which can be used for both EEG and MEG. So I have selected the singlesphere method for the calculation of volume conduction model. mri = ft_read_mri(‘ms1879865-0004-00001-000192-01.img'); // READ MRI cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the segmented mri cfg = []; cfg.method = 'singlesphere'; // *METHOD* vol1 = ft_prepare_headmodel(cfg, segmentedmri1); Now next step is to calculate the LEADFIELD cfg = []; cfg.grad = freqPost.grad; cfg.vol = vol1; cfg.reducerank = 2; // MEG cfg.channel = {'MEG'}; cfg.grid.resolution = 1; // I choose a resolution 1 [grid1] = ft_prepare_leadfield(cfg); *disp(grid1)* * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* * dim: [15 16 16]* * pos: [3840x3 double]* * unit: 'cm'* * inside: [1x2037 double]* * outside: [1x1803 double]* * cfg: [1x1 struct]* * leadfield: {1x3840 cell}* * * * * Ø It has to be noticed that Inside Dipole is 2037. * * *CALCULATE THE LEADFIELD FOR EEG CHANNELS:-* *Reading raw data set for EEG channels* * * cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'EEG'}; *// In order to read raw data only for EEG channels* dataFIC12 = ft_preprocessing(cfg); After that I have defined the *time of window of interest* for the EEG raw data set cfg.toilim = [0 0.5]; dataPost = ft_redefinetrial(cfg, dataFIC12); and calculate the *Power Spectral density matrix* for the EEG channels data set cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [129 129]; // Frequency of interest is 129 Hz cfg.pad = 1; freqPost = ft_freqanalysis(cfg, dataPost); *HEAD MODEL FOR EEG* mri = ft_read_mri(‘ms1879865-0004-00001-000192-01.img'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri2 = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singlesphere'; // METHOD vol2 = ft_prepare_headmodel(cfg, segmentedmri2); *LEADFIELD:*** cfg = []; cfg.elec = freqPost.elec; cfg.vol = vol2; cfg.reducerank = 3; % 3 for EEG cfg.channel = {'EEG'}; cfg.grid.resolution = 9.54; // Increase the resolution so that the inside dipoles for EEG should be close to the inside dipoles of MEG [grid2] = ft_prepare_leadfield(cfg); *disp(grid2)* * xgrid: [1x16 double]* * ygrid: [1x16 double]* * zgrid: [1x13 double]* * dim: [16 16 13]* * pos: [3328x3 double]* * unit: 'mm'* * inside: [1x2038 double]* * outside: [1x1290 double]* * cfg: [1x1 struct]* * leadfield: {1x3328 cell}* Ø It has to be noticed that Inside Dipole is 2038. *Concatenate of MEG and EEG LEADFIELD:-* Now I have the individual LEADFIELD of both MEG and EEG grid1 and grid2 respectively. *disp(grid1)* * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* * dim: [15 16 16]* * pos: [3840x3 double]* * unit: 'cm'* * inside: [1x2037 double]* * outside: [1x1803 double]* * cfg: [1x1 struct]* * leadfield: {1x3840 cell}* * * *disp(grid2)* * xgrid: [1x16 double]* * ygrid: [1x16 double]* * zgrid: [1x13 double]* * dim: [16 16 13]* * pos: [3328x3 double]* * unit: 'mm'* * inside: [1x2038 double]* * outside: [1x1290 double]* * cfg: [1x1 struct]* * leadfield: {1x3328 cell}* * * *Few things to be noticed here * * * Ø *unit is different for both MEG ‘cm’ and EEG ‘mm’* Ø *I have used the same method for calculating the Volume for both MEG & EEG => “Singlesphere” * Ø *Concatenating the “pos” vector of EEG and MEG and the other vectors* * * *Grid.pos = cat(1,grid1.pos,grid2.pos);* *Grid.xgrid = [grid1.xgrid grid2.xgrid];* *Grid.ygrid = [grid1.ygrid grid2.ygrid];* *Grid.zgrid = [grid1.zgrid grid2.zgrid];* *Grid.inside = [grid1.inside grid2.inside];* *Grid.outside = [grid1.outside grid2.outside];* *Grid.leadfield = [grid1.leadfield grid2.leadfield];* *Grid.dim = [grid1.dim grid2.dim];* * * *Combined Source Reconstruction:-* cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'MEG',’EEG’}; *// In order to read raw data for MEG & EEG channels* dataFIC12 = ft_preprocessing(cfg); After that as previously defined, I have calculated the Spectral density. Now I have to calculate the inverse solution for both EEG & MEG data trials. *Source Analysis: without contrasting condition:-* * * cfg = []; cfg.method = 'dics'; cfg.frequency = 129; cfg.grid = Grid; // Concatenated grid cfg.vol = vol1; // As vol1 = vol2 : both singlesphere cfg.powmethod = 'trace'; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0.0001; sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost contains both MEG * * and EEG row data* * *** I have received the following error: scanning grid 2037/4075 ??? Error using ==> svd Input to SVD must not contain NaN or Inf. Error in ==> beamformer_dics>pinv at 568 [U,S,V] = svd(A,0); Error in ==> beamformer_dics at 314 filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ==> ft_sourceanalysis at 595 dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), optarg{:}); Error in ==> code at 227 sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); Ø If you notice that till 2037 grid it represents the MEG grid and after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which also represent inside dipole). Ø Secondly I try to use other method for the head modeling i.e openmeeg, dipoli and bemcp method which leads me to different errors which I was unable to trouble shoot. · Openmeeg = OpenMEEG binaries are not correctly installed · Dipoli = vol.mat file was missing after calculating the headmodel · Bemcp = vol.mat file contains NaN fiels which leads to wrong leadfield computation. *I apologize for the long email. I wanted to show the steps which I used so that it is easier to debug the problem.* * * Thank you; Mushfa Yousuf On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Dear Mushfa > > In principle it can be made to work, but you'll have to do a little bit of > work outside fieldtrip. You would start with > 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part > 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part > Subsequently you would (manually) concatenate the leadfields of the MEG > and EEG. Here you have to make sure that the channel order is consistent > with that in your combined data. > The resulting structure with combined leadfields can be passed into > ft_sourceanalysis as cfg.grid. > > However, I foresee a problem with the scaling. At this moment FieldTrip is > not (yet) very precise in maintaining the correct units throughout. > Consequently you might get different units for the EEG and MEG contribution > to each dipole, causing weird cancelation effects. You'll just have to > check carefully that the leadfield units and the data units consistently > scaled between megmag, megplanar and eeg. > > This brings me to another known problem for the combined vectorview > magnetometer and planar gradiometer channels: at this moment the forward > computation computes both in T (or fT), whereas the data is represented as > T for the magnetometers and T/m for the gradiometers. So the gradiometer > leadfields are off by a factor "1/baseline", which is approximately 1/70 if > I recall correctly. Many neuromag users use only the planar channels, and > therefore don't notice. We are working on fixing the neuromag > channel/gradiometer units. That is not as simple as it appears, because > conversions of the geometrical dimensions from m to cm or mm also affect > the gradiometer baseline. So converting the data from m to mm should result > in the planar channel data getting 1000 times smaller, whereas the > magnetometer channels shoudl stay the same. See > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 and > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want to follow > this. > > best regards > Robert > > > > On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: > > Hello Fieldtrippers, > > I am currently doing source analysis using beamformer method in fieldtrip. > > The data i work on is a simultaneous measurement of MEG (306) with EEG > (128) on PD patients. > > I was successful in calculating the sources for both the modalities alone. > > I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation > > of the lead field. But, then when i want to use the created vol for the > source analysis i have two structures one for EEG and the second one for > MEG. Now, i can only define only one to estimate the sources. How to use > > this for both the modalities? Any help would be appreciated. > > With regards > Mushfa > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Fri Mar 8 17:48:00 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Fri, 8 Mar 2013 09:48:00 -0700 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Message-ID: <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> Dear Stephan, If I may ask, have you implemented this approach successfully in Fieldtrip? I agree that it can work well for auditory gamma, but have only done this in BESA. The minimumnormestimate.m function in FT is a time domain only technique as far as I know. If you have done this in Fieldtrip and can provide some guidance, I would very much appreciate the pointers. Best, Don On Mar 8, 2013, at 12:51 AM, Stephan Moratti wrote: Dear Nenad, An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). It should also work for EEG and is easy to implement. Best, Stephan El 08/03/2013, a las 02:16, Robert Oostenveld > escribió: Hi Nenad On 7 Mar 2013, at 7:08, Nenad Polomac wrote: I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. best regards, Robert _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Sat Mar 9 02:11:11 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Sat, 9 Mar 2013 02:11:11 +0100 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> Message-ID: Dear Don, I have done it using Brainstorm (sorry Fieldtrippers) as in Brainstorm minimum norm in the frequency domain is implemented. But as the minimum norm estimate (MNE) is applied to each time point I guess the following approach should easily work: Estimate your gamma response with ft_frequanalysis and ask for the fourier components instead of power. Create a data structure that you normally feed into the minimum norm algorithm with source analysis. The data structure has two time points. Copy the real and imaginary part into the two time points each. Run the minimum norm estimate on that data structure (I guess you will have to estimate some noise covariance matrix from a baseline or so before). Then, take the modulus of the minimum norm estimates across the two "time points" (that include the inverse real and imaginary part). I have never tried it with field trip and the approach above is just an idea. I am happy of any feedback if it works or if there is a more elegant solution. Sorry that I don't have a "fixed" solution. I will try it myself. I hope I could help. Best, Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 08/03/2013, a las 17:48, Rojas, Don escribió: > Dear Stephan, > > If I may ask, have you implemented this approach successfully in Fieldtrip? I agree that it can work well for auditory gamma, but have only done this in BESA. The minimumnormestimate.m function in FT is a time domain only technique as far as I know. If you have done this in Fieldtrip and can provide some guidance, I would very much appreciate the pointers. > > Best, > > Don > > On Mar 8, 2013, at 12:51 AM, Stephan Moratti wrote: > >> Dear Nenad, >> >> An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: >> >> 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). >> >> It should also work for EEG and is easy to implement. >> >> Best, >> >> Stephan >> >> El 08/03/2013, a las 02:16, Robert Oostenveld escribió: >> >>> Hi Nenad >>> >>> On 7 Mar 2013, at 7:08, Nenad Polomac wrote: >>>> I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. >>> >>> >>> Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. >>> >>> One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. >>> >>> If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. >>> >>> best regards, >>> Robert >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> ________________________________________________________ >> Stephan Moratti, PhD >> >> see also: http://web.me.com/smoratti/ >> >> Universidad Complutense de Madrid >> Facultad de Psicología >> Departamento de Psicología Básica I >> Campus de Somosaguas >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> and >> >> Center for Biomedical Technology >> Laboratory for Cognitive and Computational Neuroscience >> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >> Campus Montegancedo >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> >> email: smoratti at psi.ucm.es >> Tel.: +34 679219982 >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Mar 9 02:56:44 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 9 Mar 2013 01:56:44 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? Message-ID: Hi Fieldtrip list, Firstly I'd like to thank those who have asked questions using ICA on neuromag 306 data and the answers given. It's been extremely informative and taught me a lot about the general principles of ICA (it's no longer completely black magic, only partially...). I have two and a bit questions about using ICA on neuromag data, the first on the full rank assumption. After maxfiltering, the output data is rank deficient due to removal of the b-out components. I see that fastica is able to detect this and makes adjustments to the amounts of components extracted accordingly, but is doing this justified? What actually happens to the data if ICA is applied to a rank deficient data set? Are there any papers that examine this? Secondly, I've been including all the meg channels (mags + grads) when running ICA (due to my interpretation of the conversation in http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) then examining the time series components for those related to artifact (specifically ECG and EOG), while using a magnetometer only layout to view component topographies as a backup. My question (well, really a confirmation) is, by removing the artifact components calculated using the mixed sensors, does this remove the associated components from all the sensor types? Viewing pre and post ICA data appears to confirm this, but expert opinion is always good. The bit of a question is - is it acceptable to use a magnetometer only layout to interpret topoplots of the components if the components are based on mixed sensors? I've been using it because the readily identifiable artifact components have a distribution I'd expect from ECG and EOG as does the associated time series but I'm wanting to make sure. Also, if this is the wrong forum to ask these questions can someone suggest one that might be a better fit? Thanks again, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 9 12:12:04 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 9 Mar 2013 11:12:04 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> Message-ID: Hi Peter, Regarding your first question: after maxfilter, you need to do a pca, simply because your rank of data has been reduced from 306 to about 64. You can do this by: cfg = []; cfg.method = 'runica'; n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); cfg.runica.pca = n_comp; cfg.runica.stop = 1e-7; comp = ft_componentanalysis(cfg, data); Here, n_comp is the number of component and it is equal to the rank of data set. If you don't do this, the algorithm takes a long time and normally does not converge. Note that the data should be continuous and it is highly recommended to remove big and jump artefacts before ICA (for example using ft_databrowser). I found ICA using infomax 'runica' quite robust with high accuracy fro removing EOG and ECG. Regarding your second question: Using only 'MAG' to investigate the topograph of component is fine, and better than 'GRAD', but have a look at the components time-series as well. If you remove that component it will be removed from the whole data set. On 9 March 2013 01:56, Peter Goodin wrote: > Hi Fieldtrip list, > > Firstly I'd like to thank those who have asked questions using ICA on > neuromag 306 data and the answers given. It's been extremely informative > and taught me a lot about the general principles of ICA (it's no longer > completely black magic, only partially...). > > I have two and a bit questions about using ICA on neuromag data, the first > on the full rank assumption. After maxfiltering, the output data is rank > deficient due to removal of the b-out components. I see that fastica is > able to detect this and makes adjustments to the amounts of components > extracted accordingly, but is doing this justified? What actually happens > to the data if ICA is applied to a rank deficient data set? Are there any > papers that examine this? > > Secondly, I've been including all the meg channels (mags + grads) when > running ICA (due to my interpretation of the conversation in > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) > then examining the time series components for those related to artifact > (specifically ECG and EOG), while using a magnetometer only layout to view > component topographies as a backup. My question (well, really a > confirmation) is, by removing the artifact components calculated using the > mixed sensors, does this remove the associated components from all the > sensor types? Viewing pre and post ICA data appears to confirm this, but > expert opinion is always good. The bit of a question is - is it acceptable > to use a magnetometer only layout to interpret topoplots of the components > if the components are based on mixed sensors? I've been using it because > the readily identifiable artifact components have a distribution I'd expect > from ECG and EOG as does the associated time series but I'm wanting to make > sure. > > Also, if this is the wrong forum to ask these questions can someone > suggest one that might be a better fit? > > Thanks again, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Mar 9 13:13:57 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 9 Mar 2013 12:13:57 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk>, Message-ID: Hi Hamid, Thanks very much for the response. I'm concerned to do PCA on my dataset due to a recent conversation on the EEGlab mailing list where Arnaud Delorme states that PCA prior to ICA may create artifacts in the data (he does say that this occurs especially in frequency space, but doesn't discount problems in the time series). I'm using fastica to decompose my data as this appears to take into account the rank deficiency (especially when using tsss) through examination of data specific co-variance matrices, but thank you for the the script to use the runICA algorithm. If I have the time (and patience) I might do a quick exploration of PCA and runICA vs. fastICA. Additionally, thank you for confirmation regarding using the mags to examine components. I agree, far better than attempting to decipher the grads topoplots... Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, 9 March 2013 10:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? Hi Peter, Regarding your first question: after maxfilter, you need to do a pca, simply because your rank of data has been reduced from 306 to about 64. You can do this by: cfg = []; cfg.method = 'runica'; n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); cfg.runica.pca = n_comp; cfg.runica.stop = 1e-7; comp = ft_componentanalysis(cfg, data); Here, n_comp is the number of component and it is equal to the rank of data set. If you don't do this, the algorithm takes a long time and normally does not converge. Note that the data should be continuous and it is highly recommended to remove big and jump artefacts before ICA (for example using ft_databrowser). I found ICA using infomax 'runica' quite robust with high accuracy fro removing EOG and ECG. Regarding your second question: Using only 'MAG' to investigate the topograph of component is fine, and better than 'GRAD', but have a look at the components time-series as well. If you remove that component it will be removed from the whole data set. On 9 March 2013 01:56, Peter Goodin > wrote: Hi Fieldtrip list, Firstly I'd like to thank those who have asked questions using ICA on neuromag 306 data and the answers given. It's been extremely informative and taught me a lot about the general principles of ICA (it's no longer completely black magic, only partially...). I have two and a bit questions about using ICA on neuromag data, the first on the full rank assumption. After maxfiltering, the output data is rank deficient due to removal of the b-out components. I see that fastica is able to detect this and makes adjustments to the amounts of components extracted accordingly, but is doing this justified? What actually happens to the data if ICA is applied to a rank deficient data set? Are there any papers that examine this? Secondly, I've been including all the meg channels (mags + grads) when running ICA (due to my interpretation of the conversation in http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) then examining the time series components for those related to artifact (specifically ECG and EOG), while using a magnetometer only layout to view component topographies as a backup. My question (well, really a confirmation) is, by removing the artifact components calculated using the mixed sensors, does this remove the associated components from all the sensor types? Viewing pre and post ICA data appears to confirm this, but expert opinion is always good. The bit of a question is - is it acceptable to use a magnetometer only layout to interpret topoplots of the components if the components are based on mixed sensors? I've been using it because the readily identifiable artifact components have a distribution I'd expect from ECG and EOG as does the associated time series but I'm wanting to make sure. Also, if this is the wrong forum to ask these questions can someone suggest one that might be a better fit? Thanks again, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 9 13:29:44 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 9 Mar 2013 12:29:44 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: <6c0212a7-8817-4c48-9a03-d0ab7f132243@HUB04.ad.oak.ox.ac.uk> References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> <6c0212a7-8817-4c48-9a03-d0ab7f132243@HUB04.ad.oak.ox.ac.uk> Message-ID: I'm concerned to do PCA on my dataset due to a recent conversation on the EEGlab mailing list .... This is good to know, but in our case we don't reduce the rank of data set and we don't remove any information using PCA dimension reduction. So I think it should be fine. On 9 March 2013 12:13, Peter Goodin wrote: > Hi Hamid, > > Thanks very much for the response. > > I'm concerned to do PCA on my dataset due to a recent conversation on > the EEGlab mailing list where Arnaud Delorme states that PCA prior to ICA > may create artifacts in the data (he does say that this occurs especially > in frequency space, but doesn't discount problems in the time series). > > I'm using fastica to decompose my data as this appears to take into > account the rank deficiency (especially when using tsss) through > examination of data specific co-variance matrices, but thank you for the > the script to use the runICA algorithm. If I have the time (and patience) I > might do a quick exploration of PCA and runICA vs. fastICA. > > Additionally, thank you for confirmation regarding using the mags to > examine components. I agree, far better than attempting to decipher the > grads topoplots... > > Peter. > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > *Sent:* Saturday, 9 March 2013 10:12 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] ICA on neuromag data - invalid assumption of > full rank data & mixed sensors? > > Hi Peter, > > Regarding your first question: after maxfilter, you need to do a pca, > simply because your rank of data has been reduced from 306 to about 64. You > can do this by: > > cfg = []; > cfg.method = 'runica'; > n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); > cfg.runica.pca = n_comp; > cfg.runica.stop = 1e-7; > comp = ft_componentanalysis(cfg, data); > > Here, n_comp is the number of component and it is equal to the rank of > data set. If you don't do this, the algorithm takes a long time and > normally does not converge. Note that the data should be continuous and it > is highly recommended to remove big and jump artefacts before ICA (for > example using ft_databrowser). I found ICA using infomax 'runica' quite > robust with high accuracy fro removing EOG and ECG. > > > Regarding your second question: Using only 'MAG' to investigate the > topograph of component is fine, and better than 'GRAD', but have a look at > the components time-series as well. If you remove that component it will be > removed from the whole data set. > > > > > On 9 March 2013 01:56, Peter Goodin wrote: > >> Hi Fieldtrip list, >> >> Firstly I'd like to thank those who have asked questions using ICA on >> neuromag 306 data and the answers given. It's been extremely informative >> and taught me a lot about the general principles of ICA (it's no longer >> completely black magic, only partially...). >> >> I have two and a bit questions about using ICA on neuromag data, the >> first on the full rank assumption. After maxfiltering, the output data is >> rank deficient due to removal of the b-out components. I see that fastica >> is able to detect this and makes adjustments to the amounts of components >> extracted accordingly, but is doing this justified? What actually happens >> to the data if ICA is applied to a rank deficient data set? Are there any >> papers that examine this? >> >> Secondly, I've been including all the meg channels (mags + grads) when >> running ICA (due to my interpretation of the conversation in >> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) >> then examining the time series components for those related to artifact >> (specifically ECG and EOG), while using a magnetometer only layout to view >> component topographies as a backup. My question (well, really a >> confirmation) is, by removing the artifact components calculated using the >> mixed sensors, does this remove the associated components from all the >> sensor types? Viewing pre and post ICA data appears to confirm this, but >> expert opinion is always good. The bit of a question is - is it acceptable >> to use a magnetometer only layout to interpret topoplots of the components >> if the components are based on mixed sensors? I've been using it because >> the readily identifiable artifact components have a distribution I'd expect >> from ECG and EOG as does the associated time series but I'm wanting to make >> sure. >> >> Also, if this is the wrong forum to ask these questions can someone >> suggest one that might be a better fit? >> >> Thanks again, >> >> Peter. >> >> __________________________ >> Peter Goodin, >> BSc (Hons), Ph.D Candidate. >> >> Brain and Psychological Sciences Research Centre (BPsych) >> Swinburne University, >> Hawthorn, Vic, 3122 >> >> Monash Alfred Psychiatry Research Centre (MAPrc) >> Level 1, Old Baker Building >> Commercial Road >> Melbourne, Vic, 3004 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallisgj at gmail.com Sat Mar 9 15:34:00 2013 From: wallisgj at gmail.com (George Wallis) Date: Sat, 09 Mar 2013 14:34:00 +0000 Subject: [FieldTrip] Trialwise log of TF transform before condition averaging? Message-ID: <513B4858.9090007@gmail.com> Dear fieldtrip experts When computing condition averages of TF transformed data, I take the log of the trialwise data before averaging over the trials for a given condition. As I was taking the log of the trialwise data for trialwise analyses, this seemed the most consistent approach. However, I notice it isn't implemented in fieldtrip (it requires a tweak of the ft_freqanalysis function), and the tf averages tend to look noisier this way than if they are averaged before taking the log. Does anyone have any insight into whether this is a sensible way to generate condition averages? I originally thought this would reduce the influence of outlier trials - but since it is equivalent to taking the log of the product of all the trials within a condition, perhaps it is going to do the opposite? George From eschulz at lrz.tu-muenchen.de Sat Mar 9 19:55:54 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Sat, 9 Mar 2013 19:55:54 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: <5139FB2A.50300@donders.ru.nl> References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> <5139FB2A.50300@donders.ru.nl> Message-ID: Dear Jörn, thank you very much for your support. You were right. Matlab called an old version of the function which came from the EEGlab external folder. After deleting SPM and EEGlab from pathdef, it is running now without code editing and error messages. Best, Enrico On 8 March 2013 15:52, "Jörn M. Horschig" wrote: > Dear Enrico, > > the error you are describing is clearly from a rather old version of > FieldTrip, because sens.pnt is deprecated. Could you make sure that you are > using the newest FieldTrip version? Since you load from > c:\...\fieldtrip-20130307\... I assume that you downloaded the newest > version already. It might be that either you have not updated your startup > script in adding the correct FieldTrip version or that you are adding both, > an old and a new FieldTrip version to your Matlab path. You could check in > Matlab what function is being used by typing: > * > which ft_prepare_vol_sens* > > If you want to add only the newest FieldTrip and remove the old one, you > can call* **restoredefaultpath* in Matlab. The add c:\MATLAB\R2009b\work\fieldtrip-20130307\ > to your path and call *ft_def**aults*. That should solve the issue. Note > that your Matlab is *definitely* calling an old FT version, because the > line tyour error comes from does not exist anymore (i.e. it has been > rewritten, because sens.pnt is deprecated) > > Hope it works out for you! Best, > Jörn. > > > > On 3/8/2013 1:31 PM, Enrico Schulz wrote: > > Dear Lilla and Jörn, > > thank you very much for your reply on my problem. > I already checked the example sites but got still error messages. > > For creating the (leadfield) grid variable used the template files > provided by Fieldtrip. > vol structure: > > load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); > > I created a sensor structure based on the "standard_1020.elc" file. > > sens = > > chanpos: [65x3 double] > elecpos: [65x3 double] > label: {65x1 cell} > type: 'ext1020' > unit: 'mm' > pnt: [65x3 double] > > I started creating the leadfiled: > cfg = []; > cfg.elec = sens; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid65] = ft_prepare_leadfield(cfg); > > > Finally I got the following error message. > ??? Reference to non-existent field 'pnt'. > > Error in ==> ft_prepare_vol_sens at 301 > sens.pnt = sens.pnt(selsens,:); > > Error in ==> prepare_headmodel at 90 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order', > cfg.order); > > Error in ==> ft_prepare_leadfield at 148 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > That error message is funny because my sens variable has a sens.pnt subno > de. > > I (hopefully) solved the problem by editing the " ft_prepare_vol_sens"function and loading the sens > variable just before the error line in the 295. It is running now but is that > way correct? > > Any help is highly appreciated. > Thank you very much. > Best, > Enrico > > > On 5 March 2013 12:08, wrote: > >> Dear Enrico, >> >> I think more information is needed about the error messages and about how >> you try to compute leadfield in order to help. >> >> If you have not encountered the FT tutorial sites, example scripts and >> FAQs yet, maybe you can check out those as well because they provide >> information on source-reconstruction, leadfields... etc.. >> (For example, a tutorial for EEG headmodels: >> http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example >> script >> for leadfield computation: >> http://fieldtrip.fcdonders.nl/example/compute_leadfield). >> >> Best, >> Lilla >> >> >> > Dear Fieldtrip experts, >> > >> > I would like to create a leadfield based on the standard brain provided >> by >> > the fieldtrip package and standard electrode positions. >> > Unfortunately, whatever I'm trying it ends up in a number of error >> > messages. >> > >> > Is anybody out there who could provide some support? >> > >> > Thank you very much in advance, >> > Best, >> > Enrico >> > >> > >> > -- >> > Dr. Enrico Schulz >> > Postdoc >> > Klinikum rechts der Isar der Technischen Universität München >> > Neurologische Klinik und Poliklinik >> > Neuro-Kopf-Zentrum >> > Ismaningerstr. 22 >> > 81675 München >> > >> > Tel.: 089-4140-7664 >> > _______________________________________________ >> > 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 >> > > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sun Mar 10 02:38:44 2013 From: russgport at gmail.com (Russell G Port) Date: Sat, 9 Mar 2013 19:38:44 -0600 Subject: [FieldTrip] source interpolate - tmp = interpmat*tmp; inner matrix must agree Message-ID: Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: *People can skip the first part of code, I included it as possibly useful information for this plead * %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); *Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition* %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; *Heres where it falls apart, because I try to source interpolate* %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with the current problem * cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos *(position of the leadfield locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), 'sphereradius', cfg.sphereradius) (0.*05*); what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata*. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Sun Mar 10 13:34:23 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Sun, 10 Mar 2013 13:34:23 +0100 Subject: [FieldTrip] auditory evoked gamma Message-ID: Dear all, Thank you very much for thorough discussion! I will try to figure out something! All the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Sun Mar 10 18:22:54 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Sun, 10 Mar 2013 18:22:54 +0100 Subject: [FieldTrip] problem with MEG leadfield Message-ID: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> Hi everybody I'm trying to generate a field for a simulated dipole using the command ft_dipolesimulation, for a MEG study. I do the following: -read the hdr -import the sensor structure with the following lines grad=hdr.grad; radius = sqrt(sum(grad.chanpos.^2,2)); grad.chanpos = grad.chanpos./ [radius radius radius]; grad.label=hdr.label(1:306)'; -then I create the vol structure using the following code vol = []; vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 cm vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; At this point I have the grad structure, and the vol structure. Then I give all the options for the dipole simulation with the code %% create a dipole simulation with a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.grad = grad; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; cfg.dip.frequency = 10; %Hz cfg.ntrials = 10; cfg.triallength = 20; % seconds cfg.fsample = 250; % Hz but when I try to esecute the line raw1 = ft_dipolesimulation(cfg); I find this error ??? Error using ==> ft_compute_leadfield at 301 unsupported volume conductor model for MEG Error in ==> ft_dipolesimulation at 198 lf = ft_compute_leadfield(dippos{trial}, sens, vol); I really cannot understand why volume conductor model is not supported. Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not able to see it. Thank you! Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3491530515 tel +39 0818675361 fax +39 0818675128 "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From hamid.mohseni at eng.ox.ac.uk Sun Mar 10 19:32:25 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sun, 10 Mar 2013 18:32:25 +0000 Subject: [FieldTrip] Trialwise log of TF transform before condition averaging? In-Reply-To: References: Message-ID: Hi George, You are right, getting logarithm of the trials and then average is equivalent to the multiplying trials and then getting log. It remains that whether summing or multiplying trials can reduce the outliers. I therefore really doubt this way of analysis can remove or suppress the outliers. Thanks On 9 March 2013 14:34, George Wallis wrote: > Dear fieldtrip experts > > When computing condition averages of TF transformed data, I take the log > of the trialwise data before averaging over the trials for a given > condition. As I was taking the log of the trialwise data for trialwise > analyses, this seemed the most consistent approach. However, I notice it > isn't implemented in fieldtrip (it requires a tweak of the ft_freqanalysis > function), and the tf averages tend to look noisier this way than if they > are averaged before taking the log. > > Does anyone have any insight into whether this is a sensible way to > generate condition averages? I originally thought this would reduce the > influence of outlier trials - but since it is equivalent to taking the log > of the product of all the trials within a condition, perhaps it is going to > do the opposite? > > George > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 11 03:09:59 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 11 Mar 2013 10:09:59 +0800 Subject: [FieldTrip] creating leadfiled Message-ID: Dear Fieldtrip experts, I would like to create a leadfield based on the standard brain provided by the fieldtrip package and standard electrode positions. I do it like this : load standard_singleshell % from template\headmodel cfg = []; cfg.elec = sens;% also from template cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; [grid] = ft_prepare_leadfield(cfg); Finally I got the following error message. converting units from 'mm' to 'cm' ??? Error using ==> ft_prepare_vol_sens at 495 unsupported volume conductor model for EEG Error in ==> prepare_headmodel at 84 [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ==> ft_prepare_leadfield at 147 [vol, sens, cfg] = prepare_headmodel(cfg, data); but when I use 'standard_bem' (from template )is OK . Is anybody out there who could provide some support? Thank you very much in advance, Best, mengtongxiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 11 08:45:48 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 11 Mar 2013 15:45:48 +0800 Subject: [FieldTrip] Calculating the cross spectral density matrix Message-ID: Dear all: I calculate the cross spectral density matrix and my data from rest. I want do beta-band activity(14-30Hz).so I use a center frequency of about 22 Hz.we select a time window of 0.5s.I do this as follow: cfg = []; cfg.toilim = [0.5 1]; dataP = ft_redefinetrial(cfg, data_org); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 8; cfg.foilim = [22 22]; freqP = ft_freqanalysis(cfg, dataP); And i got this wrong message ??? Error using ==> dpss at 45 Time-bandwidth product NW must be less than N/2. Error in ==> ft_specest_mtmfft>double_dpss at 303 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_specest_mtmfft at 115 tap = double_dpss(ndatsample,ndatsample*(tapsmofrq./fsample))'; Error in ==> ft_freqanalysis at 526 [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt); thanks for your attention. best, mengtongxiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 11 09:47:24 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 11 Mar 2013 09:47:24 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> Message-ID: <513D9A1C.2040009@donders.ru.nl> Dear Mushfa, I never tried what you did, however from what I know of the matter and from what Robert wrote, I can see that you made some errors in your script that I can point to. I can, however, neither guarantee that this solves all or any of your problems nor that it's all correct what you are doing. So, I can only tell you some minor things: 1) When defining trial, setting cfg.trialdef.eventtype to '?' should actually only be done if you do not know the eventtype. Also note that it might be better to use all your trials rather than a subset - better signal-to-noise that way ;) 2) No reason to segment the brain twice - this operation should be done only once and the segmented brain you base the two leadfield-matrices on *must* be exactly the same. So you can save time by removing the computation of vol2. 3) Specifying only one frequency might not be a good idea, because of imperfect sampling. 4) 'singlesphere' is created specifically for MEG data. BEM models are good for EEG, not sure how good they are for MEG, but the dipoli implementation only works under unix (Linux/Mac) and openMEEG has to be downloaded manually first to make it work. 5) As Robert said, units are not always properly controlled for using FieldTrip. You can use ft_convert_units to make them match. 6) Please check again how 'grid' is defined, e.g. the .dim field shouldn't be concatenated. 7) You do not only need to concatenate the grids, but also the data, hope you did that ;) But I would really rather concatenated the two freq structures you used to compute the sourcemodel/leadfield than to compute it newly. If you concatenate you can be sure that the channel order is persistent. If you keep on having problems, I would suggest to use breakpoints or /dbstop if error/ and then step through the function to see where the error comes from, i.e. why there are NaNs or Infs in (lf*Cf*lf), and start off with looking at if there are NaNs or Infs in lf or Cf already. That's all I can help you with, cause that's were my knowledge ends ;) Maybe someone else is wiser than I am. Good luck! Best, Jörn On 3/8/2013 4:12 PM, Mushfa Yousuf wrote: > > Hello; > > I have few problems while calculating combine "MEG & EEG" source > reconstruction and I need your help to troubleshoot the problems. > > I have a data from a Parkinson's disease patient who underwent DBS and > we recorded 306 MEG channels and 64 EEG channels simultaneously, first > I have calculated the leadfield individually for both EEG and MEG. > > I have defined all the calculations step by step so that I can > describe my problems very precisely. > > *_CALCULATE THE LEADFIELD FOR MEG CHANNELS:-_* > > // I have defined the Pre-Stimulus data i.e. Stim-off data in the > original code. > > _Reading raw data set for MEG channels_ > > __ > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'MEG'}; *// In order to read raw data only for MEG > channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that I have defined the _time of window of interest_ for the MEG > raw data set > > cfg.toilim = [0 0.5]; > > dataPost = ft_redefinetrial(cfg, dataFIC12); > > and calculate the _Power Spectral density matrix_ for the MEG channels > data set > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'powandcsd'; > > cfg.tapsmofrq = 2; > > cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the > stimulation frequency > > cfg.pad = 1; > > freqPost = ft_freqanalysis(cfg, dataPost); > > Now next step for me is to choose the method for the Head Model. I > have noticed that Singlesphere is the common method which can be used > for both EEG and MEG. So I have selected the singlesphere method for > the calculation of volume conduction model. > > mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); // READ MRI > > cfg = []; > > cfg.write = 'no'; > > cfg.coordsys = 'ctf'; > > segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the segmented mri > > cfg = []; > > cfg.method = 'singlesphere'; // *METHOD* > > vol1 = ft_prepare_headmodel(cfg, segmentedmri1); > > Now next step is to calculate the LEADFIELD > > cfg = []; > > cfg.grad = freqPost.grad; > > cfg.vol = vol1; > > cfg.reducerank = 2; // MEG > > cfg.channel = {'MEG'}; > > cfg.grid.resolution = 1; // I choose a resolution 1 > > [grid1] = ft_prepare_leadfield(cfg); > > *disp(grid1)* > > * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* > > * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* > > * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* > > * dim: [15 16 16]* > > * pos: [3840x3 double]* > > * unit: 'cm'* > > * inside: [1x2037 double]* > > * outside: [1x1803 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3840 cell}* > > ** > > ** > > ØIt has to be noticed that Inside Dipole is 2037. > > ** > > *_CALCULATE THE LEADFIELD FOR EEG CHANNELS:-_* > > _Reading raw data set for EEG channels_ > > __ > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'EEG'}; *// In order to read raw data only for EEG > channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that I have defined the _time of window of interest_ for the EEG > raw data set > > cfg.toilim = [0 0.5]; > > dataPost = ft_redefinetrial(cfg, dataFIC12); > > and calculate the _Power Spectral density matrix_ for the EEG channels > data set > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'powandcsd'; > > cfg.tapsmofrq = 2; > > cfg.foilim = [129 129]; // Frequency of interest is 129 Hz > > cfg.pad = 1; > > freqPost = ft_freqanalysis(cfg, dataPost); > > _HEAD MODEL FOR EEG_ > > mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); > > cfg = []; > > cfg.write = 'no'; > > cfg.coordsys = 'ctf'; > > segmentedmri2 = ft_volumesegment(cfg, mri); > > cfg = []; > > cfg.method = 'singlesphere'; // METHOD > > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > _LEADFIELD:___ > > cfg = []; > > cfg.elec = freqPost.elec; > > cfg.vol = vol2; > > cfg.reducerank = 3; % 3 for EEG > > cfg.channel = {'EEG'}; > > cfg.grid.resolution = 9.54; // Increase the resolution so that the > inside dipoles for > > EEG should be close to the inside dipoles of MEG > > [grid2] = ft_prepare_leadfield(cfg); > > *disp(grid2)* > > * xgrid: [1x16 double]* > > * ygrid: [1x16 double]* > > * zgrid: [1x13 double]* > > * dim: [16 16 13]* > > * pos: [3328x3 double]* > > * unit: 'mm'* > > * inside: [1x2038 double]* > > * outside: [1x1290 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3328 cell}* > > ØIt has to be noticed that Inside Dipole is 2038. > > *_Concatenate of MEG and EEG LEADFIELD:-_* > > Now I have the individual LEADFIELD of both MEG and EEG grid1 and > grid2 respectively. > > *disp(grid1)* > > * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* > > * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* > > * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* > > * dim: [15 16 16]* > > * pos: [3840x3 double]* > > * unit: 'cm'* > > * inside: [1x2037 double]* > > * outside: [1x1803 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3840 cell}* > > ** > > *disp(grid2)* > > * xgrid: [1x16 double]* > > * ygrid: [1x16 double]* > > * zgrid: [1x13 double]* > > * dim: [16 16 13]* > > * pos: [3328x3 double]* > > * unit: 'mm'* > > * inside: [1x2038 double]* > > * outside: [1x1290 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3328 cell}* > > ** > > *Few things to be noticed here * > > ** > > Ø*unit is different for both MEG 'cm' and EEG 'mm'* > > Ø*I have used the same method for calculating the Volume for both MEG > & EEG => "Singlesphere" * > > Ø*Concatenating the "pos" vector of EEG and MEG and the other vectors* > > ** > > *Grid.pos = cat(1,grid1.pos,grid2.pos);* > > *Grid.xgrid = [grid1.xgrid grid2.xgrid];* > > *Grid.ygrid = [grid1.ygrid grid2.ygrid];* > > *Grid.zgrid = [grid1.zgrid grid2.zgrid];* > > *Grid.inside = [grid1.inside grid2.inside];* > > *Grid.outside = [grid1.outside grid2.outside];* > > *Grid.leadfield = [grid1.leadfield grid2.leadfield];* > > *Grid.dim = [grid1.dim grid2.dim];* > > ** > > *_Combined Source Reconstruction:-_* > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'MEG','EEG'}; *// In order to read raw data for MEG & > EEG channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that as previously defined, I have calculated the Spectral density. > > Now I have to calculate the inverse solution for both EEG & MEG data > trials. > > _Source Analysis: without contrasting condition:-_ > > __ > > cfg = []; > > cfg.method = 'dics'; > > cfg.frequency = 129; > > cfg.grid = Grid; // Concatenated grid > > cfg.vol = vol1; // As vol1 = vol2 : both singlesphere > > cfg.powmethod = 'trace'; > > cfg.dics.projectnoise = 'yes'; > > cfg.dics.lambda = 0.0001; > > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost > contains both MEG * > > *and EEG row data* > > **** > > I have received the following error: > > scanning grid 2037/4075 > > ??? Error using ==> svd > > Input to SVD must not contain NaN or Inf. > > Error in ==> beamformer_dics>pinv at 568 > > [U,S,V] = svd(A,0); > > Error in ==> beamformer_dics at 314 > > filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, > > use PINV/SVD to cover rank deficient leadfield > > Error in ==> ft_sourceanalysis at 595 > > dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), > > optarg{:}); > > Error in ==> code at 227 > > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > ØIf you notice that till 2037 grid it represents the MEG grid and > after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which also > represent inside dipole). > > ØSecondly I try to use other method for the head modeling i.e > openmeeg, dipoli and bemcp method which leads me to different errors > which I was unable to trouble shoot. > > ·Openmeeg = OpenMEEG binaries are not correctly installed > > ·Dipoli =vol.mat file was missing after calculating the headmodel > > ·Bemcp =vol.mat file contains NaN fiels which leads to wrong > > leadfield computation. > > *_I apologize for the long email. I wanted to show the steps which I > used so that it is easier to debug the problem._* > > *__* > > Thank you; > > Mushfa Yousuf > > > > On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld > > wrote: > > Dear Mushfa > > In principle it can be made to work, but you'll have to do a > little bit of work outside fieldtrip. You would start with > 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part > 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part > Subsequently you would (manually) concatenate the leadfields of > the MEG and EEG. Here you have to make sure that the channel order > is consistent with that in your combined data. > The resulting structure with combined leadfields can be passed > into ft_sourceanalysis as cfg.grid. > > However, I foresee a problem with the scaling. At this moment > FieldTrip is not (yet) very precise in maintaining the correct > units throughout. Consequently you might get different units for > the EEG and MEG contribution to each dipole, causing weird > cancelation effects. You'll just have to check carefully that the > leadfield units and the data units consistently scaled between > megmag, megplanar and eeg. > > This brings me to another known problem for the combined > vectorview magnetometer and planar gradiometer channels: at this > moment the forward computation computes both in T (or fT), whereas > the data is represented as T for the magnetometers and T/m for the > gradiometers. So the gradiometer leadfields are off by a factor > "1/baseline", which is approximately 1/70 if I recall correctly. > Many neuromag users use only the planar channels, and therefore > don't notice. We are working on fixing the neuromag > channel/gradiometer units. That is not as simple as it appears, > because conversions of the geometrical dimensions from m to cm or > mm also affect the gradiometer baseline. So converting the data > from m to mm should result in the planar channel data getting 1000 > times smaller, whereas the magnetometer channels shoudl stay the > same. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 and > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want to > follow this. > > best regards > Robert > > > > On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: > >> Hello Fieldtrippers, >> >> I am currently doing source analysis using beamformer method in fieldtrip. >> >> The data i work on is a simultaneous measurement of MEG (306) with EEG >> (128) on PD patients. >> >> I was successful in calculating the sources for both the modalities alone. >> >> I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation >> >> >> of the lead field. But, then when i want to use the created vol for the >> source analysis i have two structures one for EEG and the second one for >> MEG. Now, i can only define only one to estimate the sources. How to use >> >> >> this for both the modalities? Any help would be appreciated. >> >> With regards >> Mushfa >> _______________________________________________ >> 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 > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 11 10:18:42 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 11 Mar 2013 10:18:42 +0100 (CET) Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <1959.87.78.53.29.1362993522.squirrel@87.78.53.29> hi, the singleshell volume conduction model (standard_singleshell) is implemented for MEG data, while BEM models are used for EEG. It seems to me that you use EEG template electrodes, therefore those will work only with EEG volume conduction models. You can look at the reference documentation of ft_prepare_headmodel (http://fieldtrip.fcdonders.nl/reference/ft_prepare_headmodel) to see which headmodels work with which type of data. If you would like to compute a leadfield with the singlehell model, you need a structure with gradiometer definition in the cfg.grad instead of the EEG electrode definition in cfg.elec. I hope this helps. Best, Lilla > Dear Fieldtrip experts, > I would like to create a leadfield based on the standard brain provided > by the fieldtrip package and standard electrode positions. > I do it like this : > load standard_singleshell % from template\headmodel > cfg = []; > cfg.elec = sens;% also from template > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid] = ft_prepare_leadfield(cfg); > > Finally I got the following error message. > converting units from 'mm' to 'cm' > ??? Error using ==> ft_prepare_vol_sens at 495 > unsupported volume conductor model for EEG > Error in ==> prepare_headmodel at 84 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', > cfg.channel, 'order', cfg.order); > Error in ==> ft_prepare_leadfield at 147 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > but when I use 'standard_bem' (from template )is OK . > > Is anybody out there who could provide some support? > Thank you very much in advance, > Best, > mengtongxiao > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 11 10:41:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 11 Mar 2013 10:41:33 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: <513D9A1C.2040009@donders.ru.nl> References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> <513D9A1C.2040009@donders.ru.nl> Message-ID: <513DA6CD.7030402@donders.ru.nl> whoopsy, just realized that you use singlesphere, not singleshell. I was talking about singleshell ;) On 3/11/2013 9:47 AM, "Jörn M. Horschig" wrote: > Dear Mushfa, > > I never tried what you did, however from what I know of the matter and > from what Robert wrote, I can see that you made some errors in your > script that I can point to. I can, however, neither guarantee that > this solves all or any of your problems nor that it's all correct what > you are doing. So, I can only tell you some minor things: > 1) When defining trial, setting cfg.trialdef.eventtype to '?' should > actually only be done if you do not know the eventtype. Also note that > it might be better to use all your trials rather than a subset - > better signal-to-noise that way ;) > > 2) No reason to segment the brain twice - this operation should be > done only once and the segmented brain you base the two > leadfield-matrices on *must* be exactly the same. So you can save time > by removing the computation of vol2. > > 3) Specifying only one frequency might not be a good idea, because of > imperfect sampling. > > 4) 'singlesphere' is created specifically for MEG data. BEM models are > good for EEG, not sure how good they are for MEG, but the dipoli > implementation only works under unix (Linux/Mac) and openMEEG has to > be downloaded manually first to make it work. > > 5) As Robert said, units are not always properly controlled for using > FieldTrip. You can use ft_convert_units to make them match. > > 6) Please check again how 'grid' is defined, e.g. the .dim field > shouldn't be concatenated. > > 7) You do not only need to concatenate the grids, but also the data, > hope you did that ;) But I would really rather concatenated the two > freq structures you used to compute the sourcemodel/leadfield than to > compute it newly. If you concatenate you can be sure that the channel > order is persistent. > > > If you keep on having problems, I would suggest to use breakpoints or > /dbstop if error/ and then step through the function to see where the > error comes from, i.e. why there are NaNs or Infs in (lf*Cf*lf), and > start off with looking at if there are NaNs or Infs in lf or Cf > already. That's all I can help you with, cause that's were my > knowledge ends ;) Maybe someone else is wiser than I am. Good luck! > > Best, > Jörn > > On 3/8/2013 4:12 PM, Mushfa Yousuf wrote: >> >> Hello; >> >> I have few problems while calculating combine "MEG & EEG" source >> reconstruction and I need your help to troubleshoot the problems. >> >> I have a data from a Parkinson's disease patient who underwent DBS >> and we recorded 306 MEG channels and 64 EEG channels simultaneously, >> first I have calculated the leadfield individually for both EEG and MEG. >> >> I have defined all the calculations step by step so that I can >> describe my problems very precisely. >> >> *_CALCULATE THE LEADFIELD FOR MEG CHANNELS:-_* >> >> // I have defined the Pre-Stimulus data i.e. Stim-off data in the >> original code. >> >> _Reading raw data set for MEG channels_ >> >> __ >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'MEG'}; *// In order to read raw data only for MEG >> channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that I have defined the _time of window of interest_ for the >> MEG raw data set >> >> cfg.toilim = [0 0.5]; >> >> dataPost = ft_redefinetrial(cfg, dataFIC12); >> >> and calculate the _Power Spectral density matrix_ for the MEG >> channels data set >> >> cfg = []; >> >> cfg.method = 'mtmfft'; >> >> cfg.output = 'powandcsd'; >> >> cfg.tapsmofrq = 2; >> >> cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the >> stimulation frequency >> >> cfg.pad = 1; >> >> freqPost = ft_freqanalysis(cfg, dataPost); >> >> Now next step for me is to choose the method for the Head Model. I >> have noticed that Singlesphere is the common method which can be used >> for both EEG and MEG. So I have selected the singlesphere method for >> the calculation of volume conduction model. >> >> mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); // READ MRI >> >> cfg = []; >> >> cfg.write = 'no'; >> >> cfg.coordsys = 'ctf'; >> >> segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the >> segmented mri >> >> cfg = []; >> >> cfg.method = 'singlesphere'; // *METHOD* >> >> vol1 = ft_prepare_headmodel(cfg, segmentedmri1); >> >> Now next step is to calculate the LEADFIELD >> >> cfg = []; >> >> cfg.grad = freqPost.grad; >> >> cfg.vol = vol1; >> >> cfg.reducerank = 2; // MEG >> >> cfg.channel = {'MEG'}; >> >> cfg.grid.resolution = 1; // I choose a resolution 1 >> >> [grid1] = ft_prepare_leadfield(cfg); >> >> *disp(grid1)* >> >> * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* >> >> * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* >> >> * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* >> >> * dim: [15 16 16]* >> >> * pos: [3840x3 double]* >> >> * unit: 'cm'* >> >> * inside: [1x2037 double]* >> >> * outside: [1x1803 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3840 cell}* >> >> ** >> >> ** >> >> ØIt has to be noticed that Inside Dipole is 2037. >> >> ** >> >> *_CALCULATE THE LEADFIELD FOR EEG CHANNELS:-_* >> >> _Reading raw data set for EEG channels_ >> >> __ >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'EEG'}; *// In order to read raw data only for EEG >> channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that I have defined the _time of window of interest_ for the >> EEG raw data set >> >> cfg.toilim = [0 0.5]; >> >> dataPost = ft_redefinetrial(cfg, dataFIC12); >> >> and calculate the _Power Spectral density matrix_ for the EEG >> channels data set >> >> cfg = []; >> >> cfg.method = 'mtmfft'; >> >> cfg.output = 'powandcsd'; >> >> cfg.tapsmofrq = 2; >> >> cfg.foilim = [129 129]; // Frequency of interest is 129 Hz >> >> cfg.pad = 1; >> >> freqPost = ft_freqanalysis(cfg, dataPost); >> >> _HEAD MODEL FOR EEG_ >> >> mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); >> >> cfg = []; >> >> cfg.write = 'no'; >> >> cfg.coordsys = 'ctf'; >> >> segmentedmri2 = ft_volumesegment(cfg, mri); >> >> cfg = []; >> >> cfg.method = 'singlesphere'; // METHOD >> >> vol2 = ft_prepare_headmodel(cfg, segmentedmri2); >> >> _LEADFIELD:___ >> >> cfg = []; >> >> cfg.elec = freqPost.elec; >> >> cfg.vol = vol2; >> >> cfg.reducerank = 3; % 3 for EEG >> >> cfg.channel = {'EEG'}; >> >> cfg.grid.resolution = 9.54; // Increase the resolution so that the >> inside dipoles for >> >> EEG should be close to the inside dipoles of MEG >> >> [grid2] = ft_prepare_leadfield(cfg); >> >> *disp(grid2)* >> >> * xgrid: [1x16 double]* >> >> * ygrid: [1x16 double]* >> >> * zgrid: [1x13 double]* >> >> * dim: [16 16 13]* >> >> * pos: [3328x3 double]* >> >> * unit: 'mm'* >> >> * inside: [1x2038 double]* >> >> * outside: [1x1290 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3328 cell}* >> >> ØIt has to be noticed that Inside Dipole is 2038. >> >> *_Concatenate of MEG and EEG LEADFIELD:-_* >> >> Now I have the individual LEADFIELD of both MEG and EEG grid1 and >> grid2 respectively. >> >> *disp(grid1)* >> >> * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* >> >> * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* >> >> * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* >> >> * dim: [15 16 16]* >> >> * pos: [3840x3 double]* >> >> * unit: 'cm'* >> >> * inside: [1x2037 double]* >> >> * outside: [1x1803 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3840 cell}* >> >> ** >> >> *disp(grid2)* >> >> * xgrid: [1x16 double]* >> >> * ygrid: [1x16 double]* >> >> * zgrid: [1x13 double]* >> >> * dim: [16 16 13]* >> >> * pos: [3328x3 double]* >> >> * unit: 'mm'* >> >> * inside: [1x2038 double]* >> >> * outside: [1x1290 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3328 cell}* >> >> ** >> >> *Few things to be noticed here * >> >> ** >> >> Ø*unit is different for both MEG 'cm' and EEG 'mm'* >> >> Ø*I have used the same method for calculating the Volume for both MEG >> & EEG => "Singlesphere" * >> >> Ø*Concatenating the "pos" vector of EEG and MEG and the other vectors* >> >> ** >> >> *Grid.pos = cat(1,grid1.pos,grid2.pos);* >> >> *Grid.xgrid = [grid1.xgrid grid2.xgrid];* >> >> *Grid.ygrid = [grid1.ygrid grid2.ygrid];* >> >> *Grid.zgrid = [grid1.zgrid grid2.zgrid];* >> >> *Grid.inside = [grid1.inside grid2.inside];* >> >> *Grid.outside = [grid1.outside grid2.outside];* >> >> *Grid.leadfield = [grid1.leadfield grid2.leadfield];* >> >> *Grid.dim = [grid1.dim grid2.dim];* >> >> ** >> >> *_Combined Source Reconstruction:-_* >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'MEG','EEG'}; *// In order to read raw data for MEG >> & EEG channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that as previously defined, I have calculated the Spectral >> density. >> >> Now I have to calculate the inverse solution for both EEG & MEG data >> trials. >> >> _Source Analysis: without contrasting condition:-_ >> >> __ >> >> cfg = []; >> >> cfg.method = 'dics'; >> >> cfg.frequency = 129; >> >> cfg.grid = Grid; // Concatenated grid >> >> cfg.vol = vol1; // As vol1 = vol2 : both singlesphere >> >> cfg.powmethod = 'trace'; >> >> cfg.dics.projectnoise = 'yes'; >> >> cfg.dics.lambda = 0.0001; >> >> sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost >> contains both MEG * >> >> *and EEG row data* >> >> **** >> >> I have received the following error: >> >> scanning grid 2037/4075 >> >> ??? Error using ==> svd >> >> Input to SVD must not contain NaN or Inf. >> >> Error in ==> beamformer_dics>pinv at 568 >> >> [U,S,V] = svd(A,0); >> >> Error in ==> beamformer_dics at 314 >> >> filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, >> >> use PINV/SVD to cover rank deficient leadfield >> >> Error in ==> ft_sourceanalysis at 595 >> >> dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), >> >> optarg{:}); >> >> Error in ==> code at 227 >> >> sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); >> >> ØIf you notice that till 2037 grid it represents the MEG grid and >> after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which >> also represent inside dipole). >> >> ØSecondly I try to use other method for the head modeling i.e >> openmeeg, dipoli and bemcp method which leads me to different errors >> which I was unable to trouble shoot. >> >> ·Openmeeg = OpenMEEG binaries are not correctly installed >> >> ·Dipoli =vol.mat file was missing after calculating the headmodel >> >> ·Bemcp =vol.mat file contains NaN fiels which leads to wrong >> >> leadfield computation. >> >> *_I apologize for the long email. I wanted to show the steps which I >> used so that it is easier to debug the problem._* >> >> *__* >> >> Thank you; >> >> Mushfa Yousuf >> >> >> >> On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld >> > wrote: >> >> Dear Mushfa >> >> In principle it can be made to work, but you'll have to do a >> little bit of work outside fieldtrip. You would start with >> 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part >> 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part >> Subsequently you would (manually) concatenate the leadfields of >> the MEG and EEG. Here you have to make sure that the channel >> order is consistent with that in your combined data. >> The resulting structure with combined leadfields can be passed >> into ft_sourceanalysis as cfg.grid. >> >> However, I foresee a problem with the scaling. At this moment >> FieldTrip is not (yet) very precise in maintaining the correct >> units throughout. Consequently you might get different units for >> the EEG and MEG contribution to each dipole, causing weird >> cancelation effects. You'll just have to check carefully that the >> leadfield units and the data units consistently scaled between >> megmag, megplanar and eeg. >> >> This brings me to another known problem for the combined >> vectorview magnetometer and planar gradiometer channels: at this >> moment the forward computation computes both in T (or fT), >> whereas the data is represented as T for the magnetometers and >> T/m for the gradiometers. So the gradiometer leadfields are off >> by a factor "1/baseline", which is approximately 1/70 if I recall >> correctly. Many neuromag users use only the planar channels, and >> therefore don't notice. We are working on fixing the neuromag >> channel/gradiometer units. That is not as simple as it appears, >> because conversions of the geometrical dimensions from m to cm or >> mm also affect the gradiometer baseline. So converting the data >> from m to mm should result in the planar channel data getting >> 1000 times smaller, whereas the magnetometer channels shoudl stay >> the same. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 >> and http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want >> to follow this. >> >> best regards >> Robert >> >> >> >> On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: >> >>> Hello Fieldtrippers, >>> >>> I am currently doing source analysis using beamformer method in fieldtrip. >>> >>> The data i work on is a simultaneous measurement of MEG (306) with EEG >>> (128) on PD patients. >>> >>> I was successful in calculating the sources for both the modalities alone. >>> >>> I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation >>> >>> >>> of the lead field. But, then when i want to use the created vol for the >>> source analysis i have two structures one for EEG and the second one for >>> MEG. Now, i can only define only one to estimate the sources. How to use >>> >>> >>> this for both the modalities? Any help would be appreciated. >>> >>> With regards >>> Mushfa >>> _______________________________________________ >>> 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 >> >> >> >> >> _______________________________________________ >> 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 -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 11 10:46:33 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 11 Mar 2013 10:46:33 +0100 (CET) Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> References: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> Message-ID: <2126.87.78.53.29.1362995193.squirrel@87.78.53.29> hi Sara, I am not entirely sure of this: But I think you get the error message because your vol structure is recognized as a concentric-spheres type volume conduction model which is supported for EEG data, while your input is MEG data. You can check it here (in the reference documentation of ft_prepare_headmodel) which headmodels are implemented for MEG: http://fieldtrip.fcdonders.nl/reference/ft_prepare_headmodel. Best, Lilla > Hi everybody > I'm trying to generate a field for a simulated dipole using the > command ft_dipolesimulation, for a MEG study. > > I do the following: > -read the hdr > > -import the sensor structure with the following lines > grad=hdr.grad; > radius = sqrt(sum(grad.chanpos.^2,2)); > grad.chanpos = grad.chanpos./ [radius radius radius]; > grad.label=hdr.label(1:306)'; > > -then I create the vol structure using the following code > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 > cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; > > At this point I have the grad structure, and the vol structure. > Then I give all the options for the dipole simulation with the code > > %% create a dipole simulation with a custom timecourse > cfg = []; > cfg.vol = vol; % see above > cfg.grad = grad; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; > cfg.dip.frequency = 10; %Hz > cfg.ntrials = 10; > cfg.triallength = 20; % seconds > cfg.fsample = 250; % Hz > > but when I try to esecute the line > > raw1 = ft_dipolesimulation(cfg); > > I find this error > > ??? Error using ==> ft_compute_leadfield at 301 > unsupported volume conductor model for MEG > > Error in ==> ft_dipolesimulation at 198 > lf = ft_compute_leadfield(dippos{trial}, sens, vol); > > > I really cannot understand why volume conductor model is not supported. > Any suggestion? I'm pretty sure that the mistake is trivial, but I'm > not able to see it. > > Thank you! > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3491530515 > tel +39 0818675361 > fax +39 0818675128 > > > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From hamid.mohseni at eng.ox.ac.uk Mon Mar 11 12:55:30 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Mon, 11 Mar 2013 11:55:30 +0000 Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> References: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> Message-ID: Hi, In MEG normally people use single layer volume conductor and It is believed that three layer is not useful and can deteriorate the results (this is in contrast to EEG). Therefore, you should use a single shell or a single sphere for MEG, which models only the brain (conductivity of the scalp is assumed to be same as the air). Thanks On 10 March 2013 17:22, wrote: > Hi everybody > I'm trying to generate a field for a simulated dipole using the command > ft_dipolesimulation, for a MEG study. > > I do the following: > -read the hdr > > -import the sensor structure with the following lines > grad=hdr.grad; > radius = sqrt(sum(grad.chanpos.^2,2)); > grad.chanpos = grad.chanpos./ [radius radius radius]; > grad.label=hdr.label(1:306)'; > > -then I create the vol structure using the following code > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 > cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; > > At this point I have the grad structure, and the vol structure. > Then I give all the options for the dipole simulation with the code > > %% create a dipole simulation with a custom timecourse > cfg = []; > cfg.vol = vol; % see above > cfg.grad = grad; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; > cfg.dip.frequency = 10; %Hz > cfg.ntrials = 10; > cfg.triallength = 20; % seconds > cfg.fsample = 250; % Hz > > but when I try to esecute the line > > raw1 = ft_dipolesimulation(cfg); > > I find this error > > ??? Error using ==> ft_compute_leadfield at 301 > unsupported volume conductor model for MEG > > Error in ==> ft_dipolesimulation at 198 > lf = ft_compute_leadfield(dippos{**trial}, sens, vol); > > > I really cannot understand why volume conductor model is not supported. > Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not > able to see it. > > Thank you! > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3491530515 > tel +39 0818675361 > fax +39 0818675128 > > > "I disapprove of what you say, but I will defend to the death your right > to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ------------------------------**------------------------------**---- > This message was sent using IMP, the Internet Messaging Program. > > > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Mon Mar 11 16:05:21 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Mon, 11 Mar 2013 16:05:21 +0100 Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: References: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> Message-ID: <20130311160521.ay852ph1ws0gs0s0@arco.cib.na.cnr.it> Thank you Hamid and Lilla your observations were correct and I solved my problem :-) Thanks for helping Best regards Sara > Hi, > > In MEG normally people use single layer volume conductor and It > is believed that three layer is not useful and can deteriorate the results > (this is in contrast to EEG). Therefore, you should use a single shell or > a single sphere for MEG, which models only the brain (conductivity of the > scalp is assumed to be same as the air). > > Thanks > > > > > On 10 March 2013 17:22, wrote: > >> Hi everybody >> I'm trying to generate a field for a simulated dipole using the command >> ft_dipolesimulation, for a MEG study. >> >> I do the following: >> -read the hdr >> >> -import the sensor structure with the following lines >> grad=hdr.grad; >> radius = sqrt(sum(grad.chanpos.^2,2)); >> grad.chanpos = grad.chanpos./ [radius radius radius]; >> grad.label=hdr.label(1:306)'; >> >> -then I create the vol structure using the following code >> vol = []; >> vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 >> cm >> vol.c = [1 1/80 1]; % conductivity >> vol.o = [0 0 0]; >> >> At this point I have the grad structure, and the vol structure. >> Then I give all the options for the dipole simulation with the code >> >> %% create a dipole simulation with a custom timecourse >> cfg = []; >> cfg.vol = vol; % see above >> cfg.grad = grad; % see above >> cfg.dip.pos = [0 0.5 0.3]; >> cfg.dip.mom = [1 0 0]'; >> cfg.dip.frequency = 10; %Hz >> cfg.ntrials = 10; >> cfg.triallength = 20; % seconds >> cfg.fsample = 250; % Hz >> >> but when I try to esecute the line >> >> raw1 = ft_dipolesimulation(cfg); >> >> I find this error >> >> ??? Error using ==> ft_compute_leadfield at 301 >> unsupported volume conductor model for MEG >> >> Error in ==> ft_dipolesimulation at 198 >> lf = ft_compute_leadfield(dippos{**trial}, sens, vol); >> >> >> I really cannot understand why volume conductor model is not supported. >> Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not >> able to see it. >> >> Thank you! >> Dott.ssa Sara Rombetto >> >> Istituto di Cibernetica >> "E. Caianiello" >> Via Campi Flegrei, 34 >> 80078 Pozzuoli (NA) >> Italy >> mob +39 3491530515 >> tel +39 0818675361 >> fax +39 0818675128 >> >> >> "I disapprove of what you say, but I will defend to the death your right >> to say >> it." [Evelyn Beatrice Hall, The Friends Of Voltaire] >> >> ------------------------------**------------------------------**---- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3491530515 tel +39 0818675361 fax +39 0818675128 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From mengtongxiao at gmail.com Tue Mar 12 12:21:52 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Tue, 12 Mar 2013 19:21:52 +0800 Subject: [FieldTrip] analysis of source level connectivity Message-ID: Dear all: I am interesting in connectivity and use the fieldtrip get the source. How do I use it do connectivity. Where can I find some script. I kown use 'svd' I can get 'project along the strongest dipole direction', where is the dilpole. ROI to the strongest dipole or strongest dipole to ROI ? thanks best, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Tue Mar 12 14:28:39 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 12 Mar 2013 14:28:39 +0100 Subject: [FieldTrip] Workshop "Disentangling the brain web" Message-ID: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> sorry for double posting. on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be organizing a small workshop at CIMeC (Rovereto, Italy). we have managed to attract several exciting invited speakers but are considering contributions from postdocs / phd students. see attached pdf. all the best, nathan -------------- next part -------------- A non-text attachment was scrubbed... Name: cimec_meg_workshop2013.pdf Type: application/pdf Size: 391680 bytes Desc: not available URL: From cmuehl at gmail.com Tue Mar 12 15:20:18 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Tue, 12 Mar 2013 15:20:18 +0100 Subject: [FieldTrip] Call for Papers: 3rd Workshop on Affective Brain-Computer Interfaces at ACII 2013 Message-ID: ** Second Call for Papers ** 3rd Workshop on Affective Brain-Computer Interfaces (aBCI) Workshop at ACII 2013 (September 2-5), Geneva, Switzerland, September 2, 2013 http://hmi.ewi.utwente.nl/abci2013 http://www.acii2013.org During the last decade, brain computer interface (BCI) research has developed into a major research field establishing methodological frameworks, guidelines and a core community of established researchers. Besides proving valuable as a communication channel that bypasses impeded muscular pathways, the novel technology also spurred the investigation of applications for able-bodied users, foremost in the fields of entertainment, health and lifestyle. Affective BCI systems allowing users to control computer games, support relaxation training, or trigger your alarm clock during a shallow sleep stage have been proposed, implemented, and sold. Moreover, the affordable hardware and software tools also encouraged artists to play with the idea of a direct access to people’s most private information: their affective and cognitive states. From these explorations followed a number of interesting installations, suggesting novel ways of human-computer as well as human-human interaction: neurotechnology-based systems that encourage affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. The third workshop on affective brain-computer interfaces will explore the advantages and limitations of using neuro-physiological signals as a modality for the automatic recognition of affective and cognitive states, and the possibilities of using this information about the user state in applications for domains like health, arts, and entertainment. The goal is to bring researchers, artists, and practitioners together to present state-of-the-art progress and their visions, and thus to spur the development of guidelines and frameworks for affective BCI. Topics of interest include, but are not limited to: • affective/cognitive state induction and data collection for affective BCI • detection of mental state via BCI and other modalities • innovative concepts for adaptive interfaces and affective BCI • demos of affective BCI systems and artworks Submission Instructions * The papers should feature original empirical work, theoretical work, or a well defendable but arguable position of the authors. * Papers will be published in the proceedings of ACII 2013 by IEEE. Papers should be limited to 6 pages. * Further details about the submission instructions and format can be found on the website of ACII 2013. * For further information, contact abci at ewi.utwente.nl Important Dates: April 20, 2013: Submission of manuscripts May 20, 2013: Acceptance/Rejection notification June 17, 2013: Submission of camera-ready papers and presenting author’s registration September 2, 2013: Date of the Workshop Programme Chairs: * Brendan Allison, University of California, San Diego, USA * Guilliaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland, * Christian Mühl, INRIA Bordeaux - Sud-Ouest, France * Anton Nijholt, Universiteit Twente, the Netherlands Programme Committee: * Egon L. van den Broek, TNO Technical Sciences, Delft, The Netherlands * Anne-Marie Brouwer, TNO Perceptual and Cognitive Systems, Soesterberg, the Netherlands * Stephen Fairclough, John Moores University, Liverpool, UK * Didier Grandjean, Swiss Center for Affective Sciences, Geneva, Switzerland * Hayrettin Gürkök, University of Twente, Enschede, the Netherlands * Jonghwa Kim, University of Augsburg, Germany * Brent Lance, Army Research Laboratory/TNB, Aberdeen Proving Ground, USA, * Fabien Lotte, INRIA Bordeaux - Sud-Ouest, France * Winfried Menninghaus, Freie Universität Berlin, Germany * Gary Garcia Molina, Philips Research North America, Briarcliff, USA * Christopher Honey, Princeton University, USA * Ioannis Patras, Queen Mary University, London, UK * Mannes Poel, University of Twente, Enschede, the Netherlands * Olga Sourina, NanYang Technological University, Singapore * Ed Tan, Universiteit van Amsterdam, the Netherlands * Aleksander Valjamae, University of Graz, Austria * Thorsten Zander, Technische Universität Berlin, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Tue Mar 12 15:50:58 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 12 Mar 2013 10:50:58 -0400 Subject: [FieldTrip] Workshop "Disentangling the brain web" In-Reply-To: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> References: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> Message-ID: I realize I just missed the Toronto workshop - does anyone know when the Berkeley, CA workshop might take place? On Tue, Mar 12, 2013 at 9:28 AM, Nathan Weisz wrote: > sorry for double posting. > > on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be > organizing a small workshop at CIMeC (Rovereto, Italy). > > we have managed to attract several exciting invited speakers but are > considering contributions from postdocs / phd students. see attached pdf. > > all the best, > nathan > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Tue Mar 12 15:50:58 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 12 Mar 2013 10:50:58 -0400 Subject: [FieldTrip] Workshop "Disentangling the brain web" In-Reply-To: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> References: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> Message-ID: I realize I just missed the Toronto workshop - does anyone know when the Berkeley, CA workshop might take place? On Tue, Mar 12, 2013 at 9:28 AM, Nathan Weisz wrote: > sorry for double posting. > > on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be > organizing a small workshop at CIMeC (Rovereto, Italy). > > we have managed to attract several exciting invited speakers but are > considering contributions from postdocs / phd students. see attached pdf. > > all the best, > nathan > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Markus.Butz at uni-duesseldorf.de Wed Mar 13 12:11:21 2013 From: Markus.Butz at uni-duesseldorf.de (Markus Butz) Date: Wed, 13 Mar 2013 11:11:21 +0000 (GMT) Subject: [FieldTrip] Problems reading in DICOM Message-ID: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Dear list,  I am experiencing problems reading in external MRI in DICOM format from a CD (doing it the first time though).  I wanted to do it the new and easy way as described here: http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom % read the DICOM files  mri = ft_read_mri('single_file_of_DICOM_series.IMA'); However, I have no single slices with extension *.ima but one dataset with the extension *.dcm and the other dataset with no extension for the single slice files. I am also not sure where to copy the DICOMDIR file. When I try to open a single file of the *.dcm series I get: mri = ft_read_mri('508652C3.dcm'); ??? Undefined function or variable "hdr". Error in ==> ft_read_mri at 216   hdr     = hdr(keep);  Trying to read in a single file of the no extension series I get: mri = ft_read_mri('73850486'); ??? Error using ==> dicominfo at 41 The specified file is not in DICOM format The Image Processing toolbox V 7.2 is installed and this is fieldtrip-20111101. Any help appreciated! Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Mar 13 12:23:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 13 Mar 2013 12:23:54 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Message-ID: Dear Markus, There have been several changes to ft_read_mri over the past 1,5 year. The first step I would suggest is to update your fieldtrip version to something more recent, perhaps that solves the problem 'automatically'. Best, Eelke On 13 March 2013 12:11, Markus Butz wrote: > Dear list, > > I am experiencing problems reading in external MRI in DICOM format from a CD > (doing it the first time though). > I wanted to do it the new and easy way as described here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom > > % read the DICOM files > mri = ft_read_mri('single_file_of_DICOM_series.IMA'); > > However, I have no single slices with extension *.ima but one dataset with > the extension *.dcm and the other dataset with no extension for the single > slice files. I am also not sure where to copy the DICOMDIR file. > > When I try to open a single file of the *.dcm series I get: > > mri = ft_read_mri('508652C3.dcm'); > > ??? Undefined function or variable "hdr". > > Error in ==> ft_read_mri at 216 > hdr = hdr(keep); > > Trying to read in a single file of the no extension series I get: > > mri = ft_read_mri('73850486'); > > ??? Error using ==> dicominfo at 41 > The specified file is not in DICOM format > > The Image Processing toolbox V 7.2 is installed and this is > fieldtrip-20111101. > > Any help appreciated! > > Markus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Wed Mar 13 14:22:03 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 13 Mar 2013 14:22:03 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Message-ID: <51407D7B.4070005@donders.ru.nl> Hi Markus, I kept on avoiding these errors by using MRIcron's dcm2nii functionality: http://www.mccauslandcenter.sc.edu/mricro/mricron/index.html But pay attention to the coordinate system when importing it into FieldTrip afterwards, it can be quite a hassle... Maybe Robert or JM know whether reading in .dcm files is possible, but I have to admit that I never tried ;) Best, Jörn On 3/13/2013 12:11 PM, Markus Butz wrote: > Dear list, > > I am experiencing problems reading in external MRI in DICOM format > from a CD (doing it the first time though). > I wanted to do it the new and easy way as described here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom > > % read the DICOM files > mri = ft_read_mri('single_file_of_DICOM_series.IMA'); > > However, I have no single slices with extension *.ima but one dataset > with the extension *.dcm and the other dataset with no extension for > the single slice files. I am also not sure where to copy the DICOMDIR > file. > > When I try to open a single file of the *.dcm series I get: > > mri = ft_read_mri('508652C3.dcm'); > > ??? Undefined function or variable "hdr". > > Error in ==> ft_read_mri at 216 > hdr = hdr(keep); > > Trying to read in a single file of the no extension series I get: > > mri = ft_read_mri('73850486'); > > ??? Error using ==> dicominfo at 41 > The specified file is not in DICOM format > > The Image Processing toolbox V 7.2 is installed and this is > fieldtrip-20111101. > > Any help appreciated! > > Markus > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingenieureniso at gmail.com Wed Mar 13 16:01:31 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Wed, 13 Mar 2013 16:01:31 +0100 Subject: [FieldTrip] Problems plotting TFR map Message-ID: I am using fieldtrip-20130101 and Matlab 7.10.I have a problem when I try to plot TFR map. The error message I receive is: ??? Error using ==> griddata at 53 X and Y must be same length as Z or the lengths of X and Y must match the size of Z. Error in ==> topoplot at 463 [Xi,Yi,Zi] = griddata(x', y, data, xi', yi, cfg.interpolation); % Interpolate the topographic data Error in ==> lecture at 65 [handle]=topoplot(cfg, meanfft) meanfft is a vector containing the average of the spectral power of each electrode. I have all the electrode locations loaded and the same command works on the same system using version fieldtrip-20130101. Thanks for your help, -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 13 16:33:31 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 13 Mar 2013 16:33:31 +0100 Subject: [FieldTrip] Problems plotting TFR map In-Reply-To: References: Message-ID: <51409C4B.7040408@donders.ru.nl> Dear Ingenieur Eniso, I'm sorry, but I don't follow. You wrote that you were "using fieldtrip-20130101 and Matlab 7.10" and got the error, but it worked "on the same system using version fieldtrip-20130101", so with what version did it crash and with what version did it work? In any case, could you please try whether the error persists with the latest version (20130312)? If the error persists, it would be of great for us to know how you preprocessed the data and how you are calling the topoplot function. I'm in particular even more confused, because the function you are calling should be named ft_topoplotER or ft_topoplotTFR and not just 'topoplot'. Could you try using one of these functions instead? Best, Jörn On 3/13/2013 4:01 PM, ingenieur eniso wrote: > I am using fieldtrip-20130101 and Matlab 7.10.I have a problem when I try to plot TFR map. > The error message I receive is: > ??? Error using ==> griddata at 53 > > > X and Y must be same length as Z or the lengths > of X and Y must match the size of Z. > > Error in ==> topoplot at 463 > [Xi,Yi,Zi] = griddata(x', y, data, xi', yi, cfg.interpolation); % Interpolate the topographic data > > > Error in ==> lecture at 65 > [handle]=topoplot(cfg, meanfft) > meanfft is a vector containing the average of thespectralpower of each electrode. > > > > I have all the electrode locations loaded and the same command works on the same system using versionfieldtrip-20130101. > > Thanks for your help, > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.maye at uke.de Wed Mar 13 17:07:06 2013 From: a.maye at uke.de (Alexander Maye) Date: Wed, 13 Mar 2013 17:07:06 +0100 Subject: [FieldTrip] Bug in ft_freqcomparison.m? Message-ID: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> Hi All, I just spotted something that could be a bug in ft_freqcomparison.m (fieldtrip-20130312 and previous versions). Don't now if this is the place for report, but if this really is an issue everyone using this function may be interested. The problem is in line 87 where freq = varargin{1}; is initialized to the *first* freq argument, that according to the doc is used as the norm. So the output (powspctrm) has the dimension of the norm, not the second freq argument, that one wants to become normalized. Strange, hmm? Then, in the following for-loops the index variable runs over the size of the *second* freq argument, updating trials in the powspctrm with the size of the *first* freq argument, which seems simply wrong. Maybe this is an ingenious programming trick, but initializing freq = varargin{2}; on line 87 would make more sense from my point of view. Best, ALEX. -------------- next part -------------- -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Mar 13 23:26:12 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 13 Mar 2013 23:26:12 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <51407D7B.4070005@donders.ru.nl> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> <51407D7B.4070005@donders.ru.nl> Message-ID: <985C7F60-4B5F-4E16-B504-437C9095CBEF@donders.ru.nl> Hi DICOM files come with different extensions. I guess it depends on the scanner (Siemens/Philips/...). But the file format should be the same as it is a standard format, so the extension should not matter. The fileio/ft_filetype.m function detects both dcm and ima files as dicom. if the files have no extension, the autodetection fails and you should explicitly specify the format as mri = ft_read_mri('single_file_of_DICOM_series', 'format', 'dicom'); I now realize that to be a hidden option. I'll get that fixed in the function documentation. I recommend that you specify a filename from somewhere in the middle of the stack of files. There are often a few localizer scans in the same directory, and these (due to the sorting of the file names) tend to end up at the beginning or end of the (alphabetical) directory listing. cheers Robert On 13 Mar 2013, at 14:22, Jörn M. Horschig wrote: > Hi Markus, > > I kept on avoiding these errors by using MRIcron's dcm2nii functionality: http://www.mccauslandcenter.sc.edu/mricro/mricron/index.html > But pay attention to the coordinate system when importing it into FieldTrip afterwards, it can be quite a hassle... > > Maybe Robert or JM know whether reading in .dcm files is possible, but I have to admit that I never tried ;) > > Best, > Jörn > > On 3/13/2013 12:11 PM, Markus Butz wrote: >> Dear list, >> >> I am experiencing problems reading in external MRI in DICOM format from a CD (doing it the first time though). >> I wanted to do it the new and easy way as described here: >> http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom >> >> % read the DICOM files >> mri = ft_read_mri('single_file_of_DICOM_series.IMA'); >> >> However, I have no single slices with extension *.ima but one dataset with the extension *.dcm and the other dataset with no extension for the single slice files. I am also not sure where to copy the DICOMDIR file. >> >> When I try to open a single file of the *.dcm series I get: >> >> mri = ft_read_mri('508652C3.dcm'); >> >> ??? Undefined function or variable "hdr". >> >> Error in ==> ft_read_mri at 216 >> hdr = hdr(keep); >> >> Trying to read in a single file of the no extension series I get: >> >> mri = ft_read_mri('73850486'); >> >> ??? Error using ==> dicominfo at 41 >> The specified file is not in DICOM format >> >> The Image Processing toolbox V 7.2 is installed and this is fieldtrip-20111101. >> >> Any help appreciated! >> >> Markus >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Thu Mar 14 00:09:05 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 13 Mar 2013 23:09:05 +0000 Subject: [FieldTrip] 64 channel ActiCap sensor locations Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, Do anyone of you have the sensor location file for a 64 channel ActiCap (Brain products GmbH)? If so can you please share it with me or give me a hint where I can get one from. Thank you. Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From mengtongxiao at gmail.com Thu Mar 14 03:36:20 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Thu, 14 Mar 2013 10:36:20 +0800 Subject: [FieldTrip] How do I select ROIs Message-ID: Dear all, I want do source level connectivity.I use the template,I want to konw where is the field that I want. For example, I want find Language area.How do I find the coordinates of the location of its corresponding template. Or there have some .mat file about listing the border of each region. How can I do? thanks, Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Mar 14 08:50:01 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Mar 2013 08:50:01 +0100 Subject: [FieldTrip] How do I select ROIs In-Reply-To: References: Message-ID: Dear Xiao, You might want to have a look at this FAQ: http://fieldtrip.fcdonders.nl/faq/how_can_i_determine_the_anatomical_label_of_a_source If it does not work, or if that does not help you, please feel free to ask again of course! Best, Eelke On 14 March 2013 03:36, 陈雪 wrote: > Dear all, > > I want do source level connectivity.I use the template,I want to > konw where is the field that I want. > For example, I want find Language area.How do I find the coordinates > of the location of its corresponding template. > Or there have some .mat file about listing the border of each > region. > How can I do? > > thanks, > Xiao > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From irina.simanova at mpi.nl Thu Mar 14 11:13:48 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Thu, 14 Mar 2013 11:13:48 +0100 Subject: [FieldTrip] 64 channel ActiCap sensor locations In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> References: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> Message-ID: <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> Dear Imali, Check out this page: http://fieldtrip.fcdonders.nl/template/layout There are two template layouts for a 64 channel ActiCap available in Fieldtrip. The electrode positions are the same, but the order of channels is different. If none of these channel orders matches the one you have in your ActiCap, you can create a layout yourself with ft_prepare_layout. See http://fieldtrip.fcdonders.nl/tutorial/layout best, Irina On Mar 14, 2013, at 12:09 AM 3/14/13, IMALI THANUJA HETTIARACHCHI wrote: > Dear Fieldtrippers, > > Do anyone of you have the sensor location file for a 64 channel > ActiCap (Brain products GmbH)? > > If so can you please share it with me or give me a hint where I can > get one from. > > Thank you. > Kind regards > Imali > > Imali Thanuja Hettiarachchi > PhD Candidate > Centre for Intelligent Systems research > Deakin University, Geelong 3217, Australia. > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Thu Mar 14 12:44:51 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 14 Mar 2013 11:44:51 +0000 Subject: [FieldTrip] Statistical Parametric Mapping for MEG/EEG 2013 course Message-ID: Dear colleagues, We are happy to advertise the 2013 Statistical Parametric Mapping for MEG/EEG course presented by the Wellcome Trust Centre for Neuroimaging. The course will take place on Monday 13th May –Wednesday 15th May 2013 at the Wellcome Trust Centre for Neuroimaging in London. This course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course will cover (1) data pre-processing, (2) statistical analysis of sensor-space maps using GLMs and Random Field theory, (3) source reconstruction and (4) Dynamic Causal Modelling for EEG/MEG. The course will be followed by the long-established three-day course on ‘SPM for fMRI’ so it is possible to attend both courses. The course is suitable for beginners and more advanced users. We advise students to gain at least minimal familiarity with the methodology, for example, from reading the paper available at http://www.hindawi.com/journals/cin/2011/852961/ and other introductory articles listed at the SPM website or by following data analysis examples in the SPM manual. Video lectures from the 2012 course are available at http://www.fil.ion.ucl.ac.uk/spm/course/video/#MEEG For the practical part of the course please bring a laptop that can run Matlab (7.4 or later, no toolboxes are required) and is powerful enough to analyse your data (64-bit OS is highly recommended). The detailed schedule and booking forms can be found at http://www.ion.ucl.ac.uk/articles/events/SPM . For further details and registration please contact Jean Reynolds (jean.reynolds at ucl.ac.uk). With best wishes, Vladimir Litvak Ph.D. Lecturer Wellcome Trust Centre for Neuroimaging -------------------------------------------------------------------------------------------------- SPM (http://www.fil.ion.ucl.ac.uk/spm/) is free and open source software written in MATLAB (The MathWorks, Inc.). In addition to standard M/EEG pre-processing, we presently offer three main analysis tools: (i) statistical analysis of scalp-maps, time-frequency images and volumetric 3D source reconstruction images based on the general linear model, with correction for multiple comparisons using random field theory; (ii) Bayesian M/EEG source reconstruction, including support for group studies, simultaneous EEG and MEG, and fMRI priors; (iii) Dynamic Causal Modelling (DCM), an approach combining neural modelling with data analysis for which there are several variants dealing with evoked responses, steady state responses (power spectra and cross-spectra), induced responses and phase coupling. SPM is integrated with the FieldTrip toolbox (http://fieldtrip.fcdonders.nl/), making it possible for users to combine a variety of standard analysis methods with new schemes implemented in SPM and build custom analysis tools using powerful graphical user interface (GUI) and batching tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Thu Mar 14 13:09:24 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 14 Mar 2013 13:09:24 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <1070910925.63690.1363262912932.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <34843150.63726.1363262964484.JavaMail.root@indus.zimbra.ru.nl> Hi guys and girls, I can't get my subscription to the list working. It probably has to do with the account that underlies my email-address stan.vanpelt at donders.ru.nl . I thought that was s.vanpelt at fcdonders.ru.nl , but if I subscribe using that email-address, it still doesn't work. Hope you can help me out! best, Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Thu Mar 14 14:10:56 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 14 Mar 2013 14:10:56 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <58508409.66135.1363265587310.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Second attempt, with the actual question :) Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. Best, Stan -- Stan van Pelt, PhD Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Phone: +49 (0)69 96769 517 Fax: +49 (0)69 96769 555 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Mar 14 14:20:54 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 14 Mar 2013 14:20:54 +0100 Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> References: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <0A626AF9-5C8A-4B18-A135-028509BCFDB6@gmail.com> Hi Stan, you have to specify the surface template. I think it's using cfg.surffile or something like that. There is a separate one for the left and the right hemisphere. Good Luck Julian Am 14.03.2013 um 14:10 schrieb Pelt, S. van (Stan): > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. > > Best, > Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Mar 14 14:48:52 2013 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 14 Mar 2013 14:48:52 +0100 Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> References: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <81A04E2A-2DF8-4B7B-91B1-A66D39D05597@uni-konstanz.de> Dear Stan, would you specify cfg.surffile = 'surface_14_left.mat'; and see if it works? cheers tzvetan > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. > > Best, > Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Thu Mar 14 20:41:27 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Thu, 14 Mar 2013 15:41:27 -0400 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI Message-ID: Hello fieldtrippers! I would like to calculate wPLI (weighted phase lag index) for two time-series (created by a beamformer). It's described here: http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli What do *repetitions *mean in input argument for the function? I have the data in a text or Excel format that I could import into Matlab directly: 1st column is time, 2nd column is 1st source intensities and 3rd column is 2nd source intensities. Assuming I get my input data in the correct format, is this a correct line to call the function (I need a debiased wPLI)? [wpi, v, n] = ft_connectivity_wpli(input, debias 1) Thanks, Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Mar 14 21:22:19 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 14 Mar 2013 21:22:19 +0100 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI In-Reply-To: References: Message-ID: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> Hi inna, never used this method, but repetitions means you need single trials (it's not an averaged time-series you are talking about, right?). here some suggestions: when importing your data from Excel (how did that happen? :-)) into matlab, make a data structure that looks like one following ft_preprocessing. then run ft_freqanalysis with output "powandcsd" and keeptrials "yes" as options (and other options of course). this is at least what i assume after looking ft_connectivityanalysis then enter the structure which results from your former step into ft_connectivityanalysis with method specified as "wpli_debiased" perhaps wpli-experts want to correct me if i got something wrong. good luck, n On 14.03.2013, at 20:41, McGowin, Inna wrote: > Hello fieldtrippers! > > I would like to calculate wPLI (weighted phase lag index) for two time-series (created by a beamformer). > It's described here: http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli > What do repetitions mean in input argument for the function? > > I have the data in a text or Excel format that I could import into Matlab directly: > 1st column is time, > 2nd column is 1st source intensities and > 3rd column is 2nd source intensities. > > Assuming I get my input data in the correct format, is this a correct line to call the function (I need a debiased wPLI)? > [wpi, v, n] = ft_connectivity_wpli(input, debias 1) > > > Thanks, > Inna > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Mar 15 00:17:54 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 14 Mar 2013 19:17:54 -0400 Subject: [FieldTrip] Inner matrix mismatch in source interpolate Message-ID: Hi Fieldtrippers, When running ft source interpolate on my CTF MEG data, I get an error where it reaches line 237; tmp = interpmat*tmp. The error is an inner matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 matrix of power at the leaderfield coordinates. If this is just matrix math, then I assume the problem is just that the matrix have to be mxn and nxp. Is there any reason I cannot just use tmp=tmp' to make the inner dimensions match? Cheers Russ ---------- Forwarded message ---------- From: Russell G Port Date: Sat, Mar 9, 2013 at 8:38 PM Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree To: FieldTrip discussion list Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: *People can skip the first part of code, I included it as possibly useful information for this plead * %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); *Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition* %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; *Heres where it falls apart, because I try to source interpolate* %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with the current problem * cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos *(position of the leadfield locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), 'sphereradius', cfg.sphereradius) (0.*05*); what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata*. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Fri Mar 15 00:41:49 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 14 Mar 2013 23:41:49 +0000 Subject: [FieldTrip] 64 channel ActiCap sensor locations In-Reply-To: <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> References: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCE991@mbox-f-3.du.deakin.edu.au> Dear Irina, Thank you very much for the reply. Actually I did use the layout files and used them already for plotting, but I need to do a source reconstruction from the data, so for that I need the 3D sensor positions, not the 2D layout. I do not think I can use a 2D layout with ft_read_sens. Could you please help me on how I can find the 3D locations? Thanks again. Kind regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Irina Simanova Sent: Thursday, 14 March 2013 9:14 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] 64 channel ActiCap sensor locations Dear Imali, Check out this page: http://fieldtrip.fcdonders.nl/template/layout There are two template layouts for a 64 channel ActiCap available in Fieldtrip. The electrode positions are the same, but the order of channels is different. If none of these channel orders matches the one you have in your ActiCap, you can create a layout yourself with ft_prepare_layout. See http://fieldtrip.fcdonders.nl/tutorial/layout best, Irina On Mar 14, 2013, at 12:09 AM 3/14/13, IMALI THANUJA HETTIARACHCHI wrote: Dear Fieldtrippers, Do anyone of you have the sensor location file for a 64 channel ActiCap (Brain products GmbH)? If so can you please share it with me or give me a hint where I can get one from. Thank you. Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Fri Mar 15 10:01:07 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Fri, 15 Mar 2013 10:01:07 +0100 (CET) Subject: [FieldTrip] Inner matrix mismatch in source interpolate In-Reply-To: References: Message-ID: <000801ce215b$9feddeb0$dfc99c10$@herring@fcdonders.ru.nl> Hi Russ, I ran into a similar error which was avoided by following the steps in the extended beamformer tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformingextended). The problem seems to rather be that ft_sourceinterpolate wrongly detects your functional data as being 2 dimensional (if I remember correctly) because a .dim field is not present. I did not have the time yet to find-out if it is a problem with the other beamformer tutorial or an actual bug. In any case, if I compare the steps in the extended beamformer tutorial with the steps you took I noticed that in the extended beamformer tutorial a sourcemodel (ft_prepare_sourcemodel) is calculated after calculating the headmodel, which is then used to calculate the leadfield (ft_prepare_leadfield), followed by using this leadfield in ft_sourceanalysis. Could you try and see if that works? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Russell G Port Sent: vrijdag 15 maart 2013 0:18 To: FieldTrip discussion list Subject: [FieldTrip] Inner matrix mismatch in source interpolate Hi Fieldtrippers, When running ft source interpolate on my CTF MEG data, I get an error where it reaches line 237; tmp = interpmat*tmp. The error is an inner matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 matrix of power at the leaderfield coordinates. If this is just matrix math, then I assume the problem is just that the matrix have to be mxn and nxp. Is there any reason I cannot just use tmp=tmp' to make the inner dimensions match? Cheers Russ ---------- Forwarded message ---------- From: Russell G Port Date: Sat, Mar 9, 2013 at 8:38 PM Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree To: FieldTrip discussion list Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: People can skip the first part of code, I included it as possibly useful information for this plead %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; Heres where it falls apart, because I try to source interpolate %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %% didnt appear to help with the current problem cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos (position of the leadfield locations), pos (mri voxels), 'projmethod', cfg.interpmethod (nearest), 'sphereradius', cfg.sphereradius) (0.05); what I get out of this is a 16777216(256x256x256 voxels) x642 (leadfield position) matrix. it then undergoes interpmat(~anatomical.inside(:), :) = 0. My anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Fri Mar 15 10:29:07 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 15 Mar 2013 10:29:07 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <81A04E2A-2DF8-4B7B-91B1-A66D39D05597@uni-konstanz.de> Message-ID: <265882854.85608.1363339747061.JavaMail.root@indus.zimbra.ru.nl> Thanks a lot for all your input, changing the surffile did the trick. ----- Oorspronkelijk bericht ----- > Van: "Tzvetan Popov" > Aan: "FieldTrip discussion list" > Verzonden: Donderdag 14 maart 2013 14:48:52 > Onderwerp: Re: [FieldTrip] Single hemisphere surfaceplot > Dear Stan, > would you specify cfg.surffile = 'surface_14_left.mat'; and see if it > works? > cheers > tzvetan > > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each > > hemisphere seperately? There doesn't seem to be an configuration > > option for that in ft_sourceplot, and I wonder if it is possible at > > all. > > Best, > > Stan > > -- > > Stan van Pelt, PhD > > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for > > Neuroscience > > in Cooperation with Max Planck Society > > Deutschordenstr. 46, D-60528 Frankfurt > > Phone: +49 (0)69 96769 517 > > Fax: +49 (0)69 96769 555 > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > ******************************************* > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Fri Mar 15 16:32:21 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Fri, 15 Mar 2013 11:32:21 -0400 Subject: [FieldTrip] Smoothing for Time Frequency plots Message-ID: <2586A1048152BE4D861E64A98700AD420D5FFE3B@nki-mail.NKI.rfmh.org> Hi, I've been using the ft_singleplotTFR function to plot some TFR data I imported from BESA, and the plots are accurate, but very pixelated. I was wondering if anyone had any experience smoothing or interpolating data to make nicer looking plots? Thanks, -Michael ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Fri Mar 15 23:07:37 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Fri, 15 Mar 2013 22:07:37 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model Message-ID: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 From hamid.mohseni at eng.ox.ac.uk Sat Mar 16 16:27:30 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 16 Mar 2013 15:27:30 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: Message-ID: Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran wrote: > Hello FieldTrip users, > > I am having trouble aligning volume conduction model with source model > > The link to the data is > https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi > > Here are the steps I followed > > % Read mri > mri = ft_read_mri('T1.mgz'); > > % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s > and origin as i. At the end mri.coordsys was equal to 'neuromag' > mri = ft_determine_coordsys(mri); > > % Align volume. Selected l, r, l and z in + z direction > cfg=[]; > cfg.coordsys='neuromag'; > mri = ft_volumerealign(cfg,mri); > > %Volume segment > cfg=[]; > cfg.coordsys='neuromag'; > cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; > seg = ft_volumesegment(cfg, mri); > > % Prepare head model. The model aligns well with sensors > cfg=[]; > cfg.coordsys='neuromag'; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > % compute sourcespace > bnd = > ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); > T = mri.transform*inv(mri.transformorig); > sourcespace = ft_transform_geometry(T, bnd); > > % Plot > figure;hold on; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > > > > These surfaces do not align. Any ideas? > > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Sat Mar 16 17:10:09 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Sat, 16 Mar 2013 16:10:09 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , Message-ID: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 16 17:46:39 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 16 Mar 2013 16:46:39 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: Message-ID: If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" wrote: > Hi Hamid, > Thanks for the reply. I see what you mean. > When I import the T1, there is a mri.transform already present in it. This > is generated by the freesurfer. mri.tranform gets changed when I do the > ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , > nas as n and z in the positive z direction. I have vitamin pills at the > fiducials ( some also at the forehead) that would help in marking the > points. > > I cannot figure out where am I messing up. Also I am using the src file > in MNE and I do not have this issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > *Sent:* Saturday, March 16, 2013 11:28 AM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Hi, > > I THINK there is a problem with your mri.transform matrix. Basically, > without any pre-processing, when you apply this transformation to the > headshape points 'bnd', it should match the original mri. I checked that > and apparently it dosen't happen. How did you obtain this transformation? > > Thanks > > > > On 15 March 2013 22:07, Doshi, Chiran wrote: > >> Hello FieldTrip users, >> >> I am having trouble aligning volume conduction model with source model >> >> The link to the data is >> https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi >> >> Here are the steps I followed >> >> % Read mri >> mri = ft_read_mri('T1.mgz'); >> >> % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as >> s and origin as i. At the end mri.coordsys was equal to 'neuromag' >> mri = ft_determine_coordsys(mri); >> >> % Align volume. Selected l, r, l and z in + z direction >> cfg=[]; >> cfg.coordsys='neuromag'; >> mri = ft_volumerealign(cfg,mri); >> >> %Volume segment >> cfg=[]; >> cfg.coordsys='neuromag'; >> cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; >> seg = ft_volumesegment(cfg, mri); >> >> % Prepare head model. The model aligns well with sensors >> cfg=[]; >> cfg.coordsys='neuromag'; >> cfg.method = 'singleshell'; >> vol = ft_prepare_headmodel(cfg, seg); >> >> % compute sourcespace >> bnd = >> ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); >> T = mri.transform*inv(mri.transformorig); >> sourcespace = ft_transform_geometry(T, bnd); >> >> % Plot >> figure;hold on; >> ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight >> ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; >> >> >> >> These surfaces do not align. Any ideas? >> >> >> >> Chiran Doshi, MS >> MEG system technologist >> Department of Neurology >> Boston Childrens Hospital >> Phone: 781-216-1136 >> Fax: 781-216-1172 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Mon Mar 18 14:41:19 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Mon, 18 Mar 2013 13:41:19 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , Message-ID: Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" > wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mcgoiv0 at wfu.edu Mon Mar 18 15:25:39 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 18 Mar 2013 10:25:39 -0400 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI In-Reply-To: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> References: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> Message-ID: Thanks Nathan! Sorry I am not a frequent FieldTrip user and not sure how a data stutructure should look like after ft_preprocessing. I have two time-series for two virtual electrodes; the time-series were calculated by CTF SAM (synthetic aperture magnetometry), and then extracted and converted into a text file (and Excel if needed). Now I want to use the weighted Phase Lag Index (wPLI) and compare these two time-series for any coupling. My understanding is that the input for this function should be a cross-spertal density matrix? I tried to follow the steps you suggested with the CTF dataset that includes both the original data and the two time-series but got stuck on ft-freqanalysis as it requires lots of inputs I am not knowledgeable about, plus it still works with the whole dataset instead of just two time-series that I am interested in. Is there a short-cut for CTF SAM output dataset? Thanks! Inna On Thu, Mar 14, 2013 at 4:22 PM, Nathan Weisz wrote: > Hi inna, > > never used this method, but repetitions means you need single trials (it's > not an averaged time-series you are talking about, right?). > > here some suggestions: > > - when importing your data from Excel (how did that happen? :-)) into > matlab, make a data structure that looks like one following > ft_preprocessing. > - then run ft_freqanalysis with output "powandcsd" and keeptrials > "yes" as options (and other options of course). this is at least what i > assume after looking ft_connectivityanalysis > - then enter the structure which results from your former step into > ft_connectivityanalysis with method specified as "wpli_debiased" > > perhaps wpli-experts want to correct me if i got something wrong. > > good luck, > n > > > > > On 14.03.2013, at 20:41, McGowin, Inna wrote: > > Hello fieldtrippers! > > I would like to calculate wPLI (weighted phase lag index) for two > time-series (created by a beamformer). > It's described here: > http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli > What do *repetitions *mean in input argument for the function? > > I have the data in a text or Excel format that I could import into Matlab > directly: > 1st column is time, > 2nd column is 1st source intensities and > 3rd column is 2nd source intensities. > > Assuming I get my input data in the correct format, is this a correct line > to call the function (I need a debiased wPLI)? > > [wpi, v, n] = ft_connectivity_wpli(input, debias 1) > > Thanks, > > Inna > _______________________________________________ > 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 > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Mon Mar 18 16:09:45 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Mon, 18 Mar 2013 11:09:45 -0400 Subject: [FieldTrip] fieldtrip2eeglab Message-ID: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Hello all, I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing list, but I can't actually find it. Does anyone have a copy or know where I should look? -Michael ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Mar 18 16:19:41 2013 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 18 Mar 2013 16:19:41 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> Hi Michael, I have a version, but it seems quite old and I have never actually used it. Maybe it's of any help to you. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 18.03.2013 um 16:09 schrieb Epstein, Michael: > Hello all, > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing list, but I can't actually find it. Does anyone have a copy or know where I should look? > > -Michael > > Conserve Resources. Print only when necessary. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip2eeglab.m Type: application/octet-stream Size: 1094 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Mon Mar 18 16:26:24 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Mon, 18 Mar 2013 11:26:24 -0400 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> Message-ID: <2586A1048152BE4D861E64A98700AD420D600042@nki-mail.NKI.rfmh.org> Doesn't work for me, but it gives me something to start with - thank you. -Michael From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Julian Keil Sent: Monday, March 18, 2013 11:20 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] fieldtrip2eeglab Hi Michael, I have a version, but it seems quite old and I have never actually used it. Maybe it's of any help to you. Best, Julian ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Mar 18 16:47:39 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 18 Mar 2013 16:47:39 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: Dear Michael, Perhaps you can find it within EEGlab code? FieldTrip usually includes the *2fieldtrip functions but not the fieldtrip2* functions. Best, Johanna 2013/3/18 Epstein, Michael : > Hello all, > > > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki > (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing > list, but I can't actually find it. Does anyone have a copy or know where I > should look? > > > > -Michael > > ________________________________ > Conserve Resources. Print only when necessary. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > recipient. It may contain confidential information which is legally > privilegedor otherwise protected by law. If you received this e-mail in > error or from someone who is not authorized to send it to you, you are > strictly prohibited from reviewing, using, disseminating, distributing or > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > cooperation. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > recipient. It may contain confidential information which is legally > privileged or otherwise protected by law. If you received this e-mail in > error or from someone who is not authorized to send it to you, you are > strictly prohibited from reviewing, using, disseminating, distributing or > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > cooperation. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From singhharsimrat at gmail.com Mon Mar 18 17:50:56 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 18 Mar 2013 16:50:56 +0000 Subject: [FieldTrip] mytrialfun & ft_read_event Message-ID: Hi All**** ** ** I am trying to read in my data in which the first channel contains the marker signal (spike) superimposed on the trigger channel.**** I would like to use mytrialfun before ft_definetrial. To do this I would like to check the value of the marker channel and compare it with mean value of the channel and record that value in the even field.**** But I guess I can’t do it as the fieldtrip doesn’t read the channel values before ft_definetrial. Can I use data channel values in mytrialfun? If not, is there a way around this?**** ** ** Here is my trialfun**** ** ** function [trl, event] = mytrialfun(cfg)**** ** ** % read the header information and the events from the data**** hdr = ft_read_header(cfg.datafile);**** event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, 'detectflank','up');**** ** ** % search for "trigger" events according to 'trigchannel' defined outside the function The problem lies here ** *value = [event(find(cfg.trialdef.trigchannel (it needs data of this channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); ** ** % creating your own trialdefinition based upon the events**** for j = 1:length(value);**** trlbegin = sample(j) + pretrig;**** trlend = sample(j) + posttrig;**** offset = pretrig;**** newtrl = [ trlbegin trlend offset];**** trl = [ trl; newtrl]; **** end**** ** ** ** ** Thanks in advance**** Best regards**** Harsimrat**** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.schubert at uni-hamburg.de Mon Mar 18 18:14:40 2013 From: jonathan.schubert at uni-hamburg.de (Jonathan Schubert) Date: Mon, 18 Mar 2013 18:14:40 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: Dear Micheal, Johanna seems to be right about the EEGLAB code. There is a function called fieldtripchan2eeglab in the eeglab toolbox. Never tried it before though. Hope that helps. Best, Jonathan 2013/3/18 Johanna Zumer > Dear Michael, > > Perhaps you can find it within EEGlab code? FieldTrip usually > includes the *2fieldtrip functions but not the fieldtrip2* functions. > > Best, > Johanna > > 2013/3/18 Epstein, Michael : > > Hello all, > > > > > > > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki > > (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the > mailing > > list, but I can't actually find it. Does anyone have a copy or know > where I > > should look? > > > > > > > > -Michael > > > > ________________________________ > > Conserve Resources. Print only when necessary. > > > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > > recipient. It may contain confidential information which is legally > > privilegedor otherwise protected by law. If you received this e-mail in > > error or from someone who is not authorized to send it to you, you are > > strictly prohibited from reviewing, using, disseminating, distributing or > > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > > cooperation. > > > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > > recipient. It may contain confidential information which is legally > > privileged or otherwise protected by law. If you received this e-mail in > > error or from someone who is not authorized to send it to you, you are > > strictly prohibited from reviewing, using, disseminating, distributing or > > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > > cooperation. > > > > _______________________________________________ > > 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 > -- Jonathan Schubert, Dipl.-Psych. University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11, Room 301 D-20146 Hamburg Germany - Phone: (49) 40 - 42838 7626 Fax: (49) 40 - 42838 6591 jonathan.schubert at uni-hamburg.de www.bpn.uni-hamburg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstolzbe at uwo.ca Mon Mar 18 19:18:11 2013 From: dstolzbe at uwo.ca (Daniel Stolzberg) Date: Mon, 18 Mar 2013 14:18:11 -0400 Subject: [FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints Message-ID: Hello, I have been working with continuous data trials which begin before the trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when using ft_singleplotER. The error occurs in the raw2timelock subfunction of ft_checkdata after calling ft_singleplotER with a time axis that includes pre-trigger (i.e. < 0) time points. This error may not be for ft_singleplotER, but it is the function I was trying to use. Here is the error: > Subscripted assignment dimension mismatch. > > Error in ft_checkdata>raw2timelock (line 1753) > tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i}; > > Error in ft_checkdata (line 302) > data = raw2timelock(data); > > Error in ft_singleplotER (line 186) > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', 'freq'}); After some debugging, I found that the number of samples used to (re)generate the time vector is always 1 sample too small if there are negative time values. I assume that this is because the time point 0 is not being considered (?). By adding the following line to raw2timelock in ft_checkdata of the most recent build, I was able to get around any errors in this subfunction and all is now copacetic: line 1740: nsmp = nsmp + any(time<0); % <--- acounting for timepoint at 0? I don't know if anyone else has run into this problem but I thought I would share this with the community. Regards, Dan -- Daniel Stolzberg, PhD Post-doctoral Fellow Cerebral Systems Laboratory Department of Physiology and Pharmacology Schulich School of Medicine & Dentistry University of Western Ontario http://www.cerebralsystems.ca/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 19 08:17:49 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 19 Mar 2013 08:17:49 +0100 Subject: [FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints In-Reply-To: References: Message-ID: <5148111D.2010902@donders.ru.nl> HI Daniel, thanks for reporting this. Strange error... but it should not be related to having timepoint before 0. The fix of the time-axis in raw2timelock was implemented because of numerical inaccuracies that can occur across trials. For example, some trials might start at -0.24999 others at -0.25 (this can happen during acquisition or during resampling, etc., also computers make errors, especially when dealing with decimals). When computing a common time-axis, Matlab would compare these two values and treat them as two samples before 0 rather than 1 (which strictly speaking is true). So a common time-axis needs to be build, which is invariant to small differences. Unfortunately, that was not very trivial to accomplish. I've build a test scripts which tests very many different cases for which this function works fine. So first, just to be sure, are you using the most recent version of FieldTrip? Most colleagues in our group including myself are interested in the prestimulus period, so if this was a trivial error, we probably would have found it long time ago ;) However, it might be that it indeed breaks with your data nonetheless due to some reason. Since this might be specific to some few datasets, it would be great if you could send me a snippet of your data (like one or two trials) together with some lines of code to reproduce this error. It is quite nasty to debug this stuff, so in order to not keep you from doing research, just go ahead with the fix you implemented for this one dataset, but be aware that I am pretty sure that it will break for other datasets ;) Best regards, Jörn On 3/18/2013 7:18 PM, Daniel Stolzberg wrote: > Hello, > > I have been working with continuous data trials which begin before the > trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when > using ft_singleplotER. The error occurs in the raw2timelock > subfunction of ft_checkdata after calling ft_singleplotER with a time > axis that includes pre-trigger (i.e. < 0) time points. This error may > not be for ft_singleplotER, but it is the function I was trying to use. > > Here is the error: > > Subscripted assignment dimension mismatch. > > > > Error in ft_checkdata>raw2timelock (line 1753) > > tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i}; > > > > Error in ft_checkdata (line 302) > > data = raw2timelock(data); > > > > Error in ft_singleplotER (line 186) > > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', > 'freq'}); > > After some debugging, I found that the number of samples used to > (re)generate the time vector is always 1 sample too small if there are > negative time values. I assume that this is because the time point 0 > is not being considered (?). By adding the following line to > raw2timelock in ft_checkdata of the most recent build, I was able to > get around any errors in this subfunction and all is now copacetic: > > line 1740: nsmp = nsmp + any(time<0); % <--- acounting for > timepoint at 0? > > I don't know if anyone else has run into this problem but I thought I > would share this with the community. > > Regards, > Dan > > -- > Daniel Stolzberg, PhD > Post-doctoral Fellow > Cerebral Systems Laboratory > Department of Physiology and Pharmacology > Schulich School of Medicine & Dentistry > University of Western Ontario > http://www.cerebralsystems.ca/ > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Tue Mar 19 08:48:51 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Tue, 19 Mar 2013 07:48:51 +0000 Subject: [FieldTrip] MNI template warping to fit the electrode locations Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCED8A@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I use a MNI template as the volume conduction model (vol) as I have no individual MRI files. However I have the electrode locations of the subject. I read my sensor locations with elec = ft_read_sens('sensor_file') and then use [vol_coreg, sens] = ft_prepare_vol_sens(vol, elec) For coregistration of electrodes. When I plot the outer boundary with my sensors it looks as in head.jpg attached image. Shown in blue are the electrode locations of the original file. It seems that the electrodes are shifted upwards , say FP1 for instance is way above the forehead. Is there anything I can do to warp the MNI template volume(vol) to the original electrode locations(shown in blue)? Or am I doing something conceptually wrong here? Can you please tell me what is the correct thing to do with fieldTrip when only electrode location file is available? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Mobile : +61430321972 Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: head.jpg Type: image/jpeg Size: 11740 bytes Desc: head.jpg URL: From r.vandermeij at donders.ru.nl Tue Mar 19 10:47:14 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Tue, 19 Mar 2013 10:47:14 +0100 Subject: [FieldTrip] mytrialfun & ft_read_event In-Reply-To: References: Message-ID: Hi Harsimrat, One way this could be achieved is by reading in the specific channel by calling ft_read_data, just like calling ft_read_event and ft_read_header. On how to specify the call to ft_read_data, please see the documentation/help of the function. Hope it helps, Roemer On Mon, Mar 18, 2013 at 5:50 PM, Harsimrat Singh wrote: > Hi All**** > > ** ** > > I am trying to read in my data in which the first channel contains the > marker signal (spike) superimposed on the trigger channel.**** > > I would like to use mytrialfun before ft_definetrial. To do this I would > like to check the value of the marker channel and compare it with mean > value of the channel and record that value in the even field.**** > > But I guess I can’t do it as the fieldtrip doesn’t read the channel values > before ft_definetrial. Can I use data channel values in mytrialfun? If > not, is there a way around this?**** > > ** ** > > Here is my trialfun**** > > ** ** > > function [trl, event] = mytrialfun(cfg)**** > > ** ** > > % read the header information and the events from the data**** > > hdr = ft_read_header(cfg.datafile);**** > > event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, > 'detectflank','up');**** > > ** ** > > % search for "trigger" events according to 'trigchannel' defined outside > the function > > The problem lies here > > ** > > *value = [event(find(cfg.trialdef.trigchannel (it needs data of this > channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); > > ** ** > > % creating your own trialdefinition based upon the events**** > > for j = 1:length(value);**** > > trlbegin = sample(j) + pretrig;**** > > trlend = sample(j) + posttrig;**** > > offset = pretrig;**** > > newtrl = [ trlbegin trlend offset];**** > > trl = [ trl; newtrl]; **** > > end**** > > ** ** > > ** ** > > Thanks in advance**** > > Best regards**** > > Harsimrat**** > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.vandermeij at donders.ru.nl Tue Mar 19 10:47:14 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Tue, 19 Mar 2013 10:47:14 +0100 Subject: [FieldTrip] mytrialfun & ft_read_event In-Reply-To: References: Message-ID: Hi Harsimrat, One way this could be achieved is by reading in the specific channel by calling ft_read_data, just like calling ft_read_event and ft_read_header. On how to specify the call to ft_read_data, please see the documentation/help of the function. Hope it helps, Roemer On Mon, Mar 18, 2013 at 5:50 PM, Harsimrat Singh wrote: > Hi All**** > > ** ** > > I am trying to read in my data in which the first channel contains the > marker signal (spike) superimposed on the trigger channel.**** > > I would like to use mytrialfun before ft_definetrial. To do this I would > like to check the value of the marker channel and compare it with mean > value of the channel and record that value in the even field.**** > > But I guess I can’t do it as the fieldtrip doesn’t read the channel values > before ft_definetrial. Can I use data channel values in mytrialfun? If > not, is there a way around this?**** > > ** ** > > Here is my trialfun**** > > ** ** > > function [trl, event] = mytrialfun(cfg)**** > > ** ** > > % read the header information and the events from the data**** > > hdr = ft_read_header(cfg.datafile);**** > > event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, > 'detectflank','up');**** > > ** ** > > % search for "trigger" events according to 'trigchannel' defined outside > the function > > The problem lies here > > ** > > *value = [event(find(cfg.trialdef.trigchannel (it needs data of this > channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); > > ** ** > > % creating your own trialdefinition based upon the events**** > > for j = 1:length(value);**** > > trlbegin = sample(j) + pretrig;**** > > trlend = sample(j) + posttrig;**** > > offset = pretrig;**** > > newtrl = [ trlbegin trlend offset];**** > > trl = [ trl; newtrl]; **** > > end**** > > ** ** > > ** ** > > Thanks in advance**** > > Best regards**** > > Harsimrat**** > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Tue Mar 19 15:49:41 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Tue, 19 Mar 2013 14:49:41 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , , Message-ID: Hi, So I tried form the beginning and it fixed the issue. Any ideas why this might be hapenning in the first place? The problem is I already have a freesurfer database with reconstructed surfaces. If there is any fix like a missing transformation that I can compute so I do not have to recon-all again for all subjects. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] Sent: Monday, March 18, 2013 9:49 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" > wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ 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 From hamid.mohseni at eng.ox.ac.uk Tue Mar 19 16:42:51 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Tue, 19 Mar 2013 15:42:51 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk> References: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk> Message-ID: Hi, I had this problem before, and I think it is something with freesurfer: If you plot the original MRI and its segmented volume in freesurfer, you may see that they are not in the same coordinate. I think the best way is to ask freesurfer people, we probably missing a small thing here. Thanks On 19 March 2013 14:49, Doshi, Chiran wrote: > Hi, > So I tried form the beginning and it fixed the issue. Any ideas why this > might be hapenning in the first place? > The problem is I already have a freesurfer database with reconstructed > surfaces. If there is any fix like a missing transformation that I can > compute so I do not have to recon-all again for all subjects. > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] > Sent: Monday, March 18, 2013 9:49 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Thanks for the help, > I will try again from the beginning. I will let know if I am able to get > the fix the issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > Sent: Saturday, March 16, 2013 12:47 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > If you want to do beam former source localization, there is no need to > freesurfer and you can extract the brain shape points from the segmented > MRI using FieldTrip itself and you will not have this problem. > > However, if you want to do minimum norm source localisation, you may do a > realignment before applying free surfer, please see this > > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate > > On Mar 16, 2013 4:23 PM, "Doshi, Chiran" < > Chiran.Doshi at childrens.harvard.edu Chiran.Doshi at childrens.harvard.edu>> wrote: > Hi Hamid, > Thanks for the reply. I see what you mean. > When I import the T1, there is a mri.transform already present in it. This > is generated by the freesurfer. mri.tranform gets changed when I do the > ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , > nas as n and z in the positive z direction. I have vitamin pills at the > fiducials ( some also at the forehead) that would help in marking the > points. > > I cannot figure out where am I messing up. Also I am using the src file in > MNE and I do not have this issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > ________________________________ > From: fieldtrip-bounces at science.ru.nl fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl fieldtrip-bounces at science.ru.nl>] on behalf of Hamid Mohseni [ > hamid.mohseni at eng.ox.ac.uk] > Sent: Saturday, March 16, 2013 11:28 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Hi, > > I THINK there is a problem with your mri.transform matrix. Basically, > without any pre-processing, when you apply this transformation to the > headshape points 'bnd', it should match the original mri. I checked that > and apparently it dosen't happen. How did you obtain this transformation? > > Thanks > > > > On 15 March 2013 22:07, Doshi, Chiran > wrote: > Hello FieldTrip users, > > I am having trouble aligning volume conduction model with source model > > The link to the data is > https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi > > Here are the steps I followed > > % Read mri > mri = ft_read_mri('T1.mgz'); > > % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s > and origin as i. At the end mri.coordsys was equal to 'neuromag' > mri = ft_determine_coordsys(mri); > > % Align volume. Selected l, r, l and z in + z direction > cfg=[]; > cfg.coordsys='neuromag'; > mri = ft_volumerealign(cfg,mri); > > %Volume segment > cfg=[]; > cfg.coordsys='neuromag'; > cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; > seg = ft_volumesegment(cfg, mri); > > % Prepare head model. The model aligns well with sensors > cfg=[]; > cfg.coordsys='neuromag'; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > % compute sourcespace > bnd = > ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); > T = mri.transform*inv(mri.transformorig); > sourcespace = ft_transform_geometry(T, bnd); > > % Plot > figure;hold on; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > > > > These surfaces do not align. Any ideas? > > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > 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 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Tue Mar 19 16:56:04 2013 From: russgport at gmail.com (Russell G Port) Date: Tue, 19 Mar 2013 10:56:04 -0500 Subject: [FieldTrip] Inner matrix mismatch in source interpolate In-Reply-To: <5142e35f.c46f0e0a.2db7.fffff846SMTPIN_ADDED_BROKEN@mx.google.com> References: <5142e35f.c46f0e0a.2db7.fffff846SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Thanks Jim, That was exactly what was wrong. Sorry for the delayed response. I mistakenly thought that the leadfield function would create a grid (which it can, but I forgot to put in a cfg.resolution). On Fri, Mar 15, 2013 at 4:01 AM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Hi Russ,**** > > ** ** > > I ran into a similar error which was avoided by following the steps in the > *extended* beamformer tutorial ( > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended). The problem > seems to rather be that ft_sourceinterpolate wrongly detects your > functional data as being 2 dimensional (if I remember correctly) because a > .dim field is not present. I did not have the time yet to find-out if it is > a problem with the other beamformer tutorial or an actual bug.**** > > ** ** > > In any case, if I compare the steps in the extended beamformer tutorial > with the steps you took I noticed that in the extended beamformer tutorial > a sourcemodel (ft_prepare_sourcemodel) is calculated after calculating the > headmodel, which is then used to calculate the leadfield > (ft_prepare_leadfield), followed by using this leadfield in > ft_sourceanalysis. Could you try and see if that works? **** > > ** ** > > Best,**** > > ** ** > > Jim**** > > ** ** > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Russell G Port > *Sent:* vrijdag 15 maart 2013 0:18 > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Inner matrix mismatch in source interpolate**** > > ** ** > > Hi Fieldtrippers,**** > > ** ** > > When running ft source interpolate on my CTF MEG data, I get an error > where it reaches line 237; tmp = interpmat*tmp. The error is an inner > matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 > matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 > matrix of power at the leaderfield coordinates. If this is just matrix > math, then I assume the problem is just that the matrix have to be mxn and > nxp. Is there any reason I cannot just use tmp=tmp' to make the inner > dimensions match?**** > > ** ** > > Cheers Russ**** > > ** ** > > ---------- Forwarded message ---------- > From: *Russell G Port* > Date: Sat, Mar 9, 2013 at 8:38 PM > Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree > To: FieldTrip discussion list > > > Hi Fieldtrippers, > > I have a slight issue that I was hoping someone can help with. I have some > CTF data, that I was trying to perform DICS beamforming and then source > interpolation on. I am trying to beamform to the source of gamma frequency > in the right hemisphere, comparing pre and post stimuli. Heres the basic > script: > > *People can skip the first part of code, I included it as possibly useful > information for this plead > * > %%%%% Data has already been preprocessed and timelocked%%%%%% > > load('processed_data_500Hz.mat') > load('timelock_data_500Hz.mat') > > %%%% following the beamforming tutorial %%%%%%% > > %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% > > cfg = []; > cfg.toilim = baseline; > cfg.channel=channel > total_bsl = ft_redefinetrial(cfg, data); > > > cfg = []; > cfg.toilim = interest; > cfg.channel=channel > total_interest = ft_redefinetrial(cfg, data); > > cfg = []; > total_cmb = ft_appenddata(cfg, total_bsl, total_interest); > > total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); > ones(length(total_interest.trial), 1)]; > > > %%%%%%%%%%%%%cross spectrial density for dics and tf for common > filter%%%%%%%%%%%%%% > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqPre_total = ft_freqanalysis(cfg, total_bsl); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqPost_total = ft_freqanalysis(cfg, total_interest); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqALL_total = ft_freqanalysis(cfg, total_cmb); > > > %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% > > % > T=ft_read_mri('R128_V2.mri') > > cfg.fiducial.nas = T.hdr.fiducial.mri.nas > cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa > cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa > cfg.method = 'fiducial' > cfg.coordsys = 'ctf' > > [mri] = ft_volumerealign(cfg, T) > > cfg = []; > cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, > see below > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > vol = ft_convert_units(hdm, 'cm'); > > %%%%%%%%%%%%%%% > > > cfg = []; > cfg.grad = freqPost_total.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = 'MR' > [grid] = ft_prepare_leadfield(cfg); > > > > *Upto this point everything works. My volume conduction model, grads, and > grid looks good when verified visually... > > I then compute the common filter and apply it to the beamforming of each > condition* > > > %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% > > cfg = []; > cfg.method = 'dics'; > cfg.grad = freqALL_total.grad; > cfg.keeptrials = 'yes'; > cfg.frequency = freqALL_total.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.realfilter = 'yes'; > cfg.channel = 'MR' > sourceAll = ft_sourceanalysis(cfg, freqALL_total); > > %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% > > cfg.grid.filter = sourceAll.avg.filter; > cfg.grid = grid; > sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); > sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); > > > %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% > > sourceDiff = sourcePost_con; > sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ > sourcePre_con.avg.pow; > > > > *Heres where it falls apart, because I try to source interpolate* > > > %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% > > % slicemri = ft_volumereslice([], mri); > % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with > the current problem > * > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > cfg.coordsys = 'ctf'; > cfg.channel = 'MR' > source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also > tried segmentedmri, but no difference > > It works until it reachs line 237; tmp = interpmat*tmp; where there is > the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 > matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp > is sourceDiff.avg.pow (the power difference for each leadfield point). > interpmat is the interpolation matrix return by > > interpmat = interp_ungridded(functional.pos *(position of the leadfield > locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), > 'sphereradius', cfg.sphereradius) (0.*05*); > > what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield > position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), > :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 > matrix= 1), as a result of the defaults in ft_checkdata*. > > When I try to find the minimum value in this matrix I get (via > min(interpmat) = All zero sparse: 1-by-642 > > I think what is supposed to happen is that the interpmat is a matrix that > relates meg to mri space, and as such then mutlipling with a vector that > represents the power in meg space, I can see how that would get points of > power in mri space. Though this must be wrong since the math is not > allowed.... I cannot see where I went off the beaten track. It seems as if > other people have not had this problem. > > Sorry for the bother, > > Russ Port > > Graduate Student @ Upenn > > > P.S. thanks to anyone who tries to help in advance... > > > > > > > > **** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.C.Schouten at tudelft.nl Wed Mar 20 09:03:35 2013 From: A.C.Schouten at tudelft.nl (Alfred Schouten - 3ME) Date: Wed, 20 Mar 2013 08:03:35 +0000 Subject: [FieldTrip] Postdoc position - TU Delft, the Netherlands Message-ID: The Department of Biomechanical Engineering is seeking a full-time post-doc for the advanced ERC Research Project ³4D-EEG: A new tool to investigate the spatial and temporal activity patterns in the brain². 4D-EEG is a highly prestigious project to develop a novel method for investigating brain activity in humans. The first goal of the project is to develop a new tool to determine brain activity at a high temporal and spatial resolution, with the focus on motor control. The method combines high density EEG and EEG source localization with advanced robot manipulators to impose precise perturbations to the joints. Using system identification, the dynamic response of brain areas to the perturbation will be assessed, leading to a functional interpretation of the EEG with time. 4D-EEG will provide a direct measure of the neural activity in the brain related to motor control tasks. The second goal is to generate and validate new hypotheses about the longitudinal relationship between motor learning and neuroplasticity in patients suffering from a stroke. The non-invasive 4D-EEG technique combined with haptic robots will open a window into what and how patients (re)learn when showing motor recovery after stroke, in order to develop more effective patient-tailored therapies in neuro-rehabilitation. A further aim is to link these functional results with structural measurements, like DTI. You will bring in your expertise in EEG recording and EEG source localization, and will work in a multidisciplinary team consisting of six PhD students and one other postdoc, divided over TU Delft and the VU medical center in Amsterdam. Your main objective will be to incorporate EEG source localization with our system identification techniques. You will provide guidance to three PhD students working on EEG source localization and system identification. We are looking for an independent mind, who takes initiative in a team, is able to translate high-level goals into small packages, and can provide guidance to PhD and MSc students. Requirements The project consists of five subprojects, each requiring specific expertise. At this moment we are looking for a post-doc with extensive expertise in EEG and source localization methods. You should have an affinity for experiments involving human subjects, have extensive programming skills (e.g. Matlab or C++), and preferably experience in one or more of the following fields: data acquisition and processing of electrophysiological and biomechanical signals, system identification and control engineering, or neuroimaging. You should have a PhD in a relevant field, like Biomedical, Mechanical or Electrical Engineering or in (applied) Mathematics, Physics, or Neuroscience. Excellent knowledge of English is a prerequisite. Conditions of employment We offer a challenging postdoc position within the 4D-EEG project. The position is initially for two-years, with the possibility to extend the contract for one or two years after a midterm evaluation. TU Delft offers an attractive benefits package, including a flexible workweek, free high-speed Internet access from home (with contracts of two years or longer), and the option of assembling a customized compensation and benefits package (the 'IKA'). Salary and benefits are in accordance with the Collective Labour Agreement for Dutch Universities. Information and application For more information about this position, please contact Dr. A. C. Schouten, e-mail: a.c.schouten at tudelft.nl. To apply, please e-mail a detailed CV along with a letter of application by May 1, 2013 to M.J.B. Kole, application-3mE at tudelft.nl. When applying for this position, please refer to vacancy number 3ME13-11. From eelke.spaak at donders.ru.nl Wed Mar 20 10:01:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Mar 2013 10:01:54 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics Message-ID: Dear FieldTrip community, Short version: if you did ft_freqstatistics across subjects with a different channel ordering across data sets (which is the case if you use ft_channelrepair), your results might have been erroneous. Read the following carefully. Yesterday, we discovered a possibly severe bug in a utility function (ft_selectdata_old) which was used by ft_freqstatistics. The bug entails that ft_selectdata_old assumes that the channels in all data input arguments are ordered identically, and does not take into account the order of the data.label field. This means that when several data input arguments with different channel orderings are passed to ft_selectdata_old, the resulting output structure (with a newly added 'rpt' dimension) will contain wrong data (i.e. data for channel X might end up in another channel Y). Importantly, the same thus holds for ft_freqstatistics: when doing statistics across subjects, if the different subjects' data sets have different channel orderings, the resulting statistics will be wrong. We expect that in many cases, the channel ordering across different data sets will be identical, and in those cases this bug will not have had any effect. However, one important case in which channel ordering *will* be different is when one does ft_channelrepair on a data set, since this function appends the repaired channels to the end of the data. So, if you have done ft_channelrepair on only a subset of your subjects' data, and/or used ft_channelrepair to repair different channels in different subjects, and subsequently passed the repaired data sets to ft_freqstatistics, there is a good chance the results you got were wrong. Most likely, this bug was introduced with revision 4101, in september 2011, so it has been in the code for quite a while. Note that ft_channelrepair only supports repairing missing channels since revision 5216 (february 2012), and that this was advised against until revision 6100 (june 2012), when the algorithm for doing so sensibly was implemented. The fix has been implemented and is now available from the FTP server as of fieldtrip-20130319 (Donders users: the fix is automatically available on the /home/common/ version of FieldTrip). Note that ft_selectdata_old still does not work correctly, this is something we will fix in the near future (ft_selectdata_old is deprecated). We fixed the behaviour of ft_appendfreq (the preferred replacement function for ft_selectdata_old when appending freq structures) and changed ft_freqstatistics to use this function instead. The other statistics functions, ft_timelockstatistics and ft_sourcestatistics, were not affected by this bug. We strongly advise you to upgrade to the latest version of FieldTrip. If the situation described above applies to you, you will need to redo your channel-level (time-)frequency statistics analyses. Details on the bug (and a test script) can be found here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any problems related to the bug, please post them there. We sincerely apologise for this bug and any trouble it might have caused. Best, On behalf of the FT core development team, Eelke From eelke.spaak at donders.ru.nl Wed Mar 20 14:49:15 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Mar 2013 14:49:15 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: Message-ID: Dear all, A short PS: Unfortunately, we found a remaining piece of bug in ft_freqstatistics, related to the same issue (and relevant under the same circumstances). This has now also been fixed, and should be available as of *tonight*'s FTP release, so fieldtrip-20130320. Apologies again, best, Eelke On 20 March 2013 10:01, Eelke Spaak wrote: > Dear FieldTrip community, > > Short version: if you did ft_freqstatistics across subjects with a > different channel ordering across data sets (which is the case if you > use ft_channelrepair), your results might have been erroneous. Read > the following carefully. > > Yesterday, we discovered a possibly severe bug in a utility function > (ft_selectdata_old) which was used by ft_freqstatistics. The bug > entails that ft_selectdata_old assumes that the channels in all data > input arguments are ordered identically, and does not take into > account the order of the data.label field. This means that when > several data input arguments with different channel orderings are > passed to ft_selectdata_old, the resulting output structure (with a > newly added 'rpt' dimension) will contain wrong data (i.e. data for > channel X might end up in another channel Y). Importantly, the same > thus holds for ft_freqstatistics: when doing statistics across > subjects, if the different subjects' data sets have different channel > orderings, the resulting statistics will be wrong. > > We expect that in many cases, the channel ordering across different > data sets will be identical, and in those cases this bug will not have > had any effect. However, one important case in which channel ordering > *will* be different is when one does ft_channelrepair on a data set, > since this function appends the repaired channels to the end of the > data. So, if you have done ft_channelrepair on only a subset of your > subjects' data, and/or used ft_channelrepair to repair different > channels in different subjects, and subsequently passed the repaired > data sets to ft_freqstatistics, there is a good chance the results you > got were wrong. > > Most likely, this bug was introduced with revision 4101, in september > 2011, so it has been in the code for quite a while. Note that > ft_channelrepair only supports repairing missing channels since > revision 5216 (february 2012), and that this was advised against until > revision 6100 (june 2012), when the algorithm for doing so sensibly > was implemented. > > The fix has been implemented and is now available from the FTP server > as of fieldtrip-20130319 (Donders users: the fix is automatically > available on the /home/common/ version of FieldTrip). Note that > ft_selectdata_old still does not work correctly, this is something we > will fix in the near future (ft_selectdata_old is deprecated). We > fixed the behaviour of ft_appendfreq (the preferred replacement > function for ft_selectdata_old when appending freq structures) and > changed ft_freqstatistics to use this function instead. > > The other statistics functions, ft_timelockstatistics and > ft_sourcestatistics, were not affected by this bug. We strongly advise > you to upgrade to the latest version of FieldTrip. If the situation > described above applies to you, you will need to redo your > channel-level (time-)frequency statistics analyses. > > Details on the bug (and a test script) can be found here: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > problems related to the bug, please post them there. > > We sincerely apologise for this bug and any trouble it might have caused. > > Best, > On behalf of the FT core development team, > > Eelke From Chiran.Doshi at childrens.harvard.edu Wed Mar 20 16:00:34 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Wed, 20 Mar 2013 15:00:34 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk>, Message-ID: Will do, Thanks!! Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Tuesday, March 19, 2013 11:51 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I had this problem before, and I think it is something with freesurfer: If you plot the original MRI and its segmented volume in freesurfer, you may see that they are not in the same coordinate. I think the best way is to ask freesurfer people, we probably missing a small thing here. Thanks On 19 March 2013 14:49, Doshi, Chiran > wrote: Hi, So I tried form the beginning and it fixed the issue. Any ideas why this might be hapenning in the first place? The problem is I already have a freesurfer database with reconstructed surfaces. If there is any fix like a missing transformation that I can compute so I do not have to recon-all again for all subjects. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] Sent: Monday, March 18, 2013 9:49 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" >> wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl>] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk>] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran >> wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ 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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 From inieuwenhuis at berkeley.edu Wed Mar 20 20:55:49 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 20 Mar 2013 12:55:49 -0700 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: Message-ID: <514A1445.50007@berkeley.edu> Hi Eelke, Thanks for reporting. I did do ft_channelrepair on my EEG data for some subjects and subsequently used ft_freqstatistics. However, the channel order is indentical in all my subjects in the freq. I repaired bad channels using the default setting (method='nearest'). The bad channels were included in the input data to ft_channelrepair (so they were not missing). I just checked, and in data_out after ft_channelrepair, the order of the labels of the data is identical to the data_in, thus the repaired channels were NOT appended to the end of the data. So apparently ft_channelrepair not always appends the repaired channels at the end. I suppose this is good news for me, meaning that the bug did not affect me, since the channels were ordered identically when calling ft_freqstatistics. Do you agree, or am I missing something? And for others that used ft_channelrepair, might be worth checking if the ordering is indeed changed after calling it, because it appears not always to be the case. Thanks, Ingrid On 3/20/2013 2:01 AM, Eelke Spaak wrote: > Dear FieldTrip community, > > Short version: if you did ft_freqstatistics across subjects with a > different channel ordering across data sets (which is the case if you > use ft_channelrepair), your results might have been erroneous. Read > the following carefully. > > Yesterday, we discovered a possibly severe bug in a utility function > (ft_selectdata_old) which was used by ft_freqstatistics. The bug > entails that ft_selectdata_old assumes that the channels in all data > input arguments are ordered identically, and does not take into > account the order of the data.label field. This means that when > several data input arguments with different channel orderings are > passed to ft_selectdata_old, the resulting output structure (with a > newly added 'rpt' dimension) will contain wrong data (i.e. data for > channel X might end up in another channel Y). Importantly, the same > thus holds for ft_freqstatistics: when doing statistics across > subjects, if the different subjects' data sets have different channel > orderings, the resulting statistics will be wrong. > > We expect that in many cases, the channel ordering across different > data sets will be identical, and in those cases this bug will not have > had any effect. However, one important case in which channel ordering > *will* be different is when one does ft_channelrepair on a data set, > since this function appends the repaired channels to the end of the > data. So, if you have done ft_channelrepair on only a subset of your > subjects' data, and/or used ft_channelrepair to repair different > channels in different subjects, and subsequently passed the repaired > data sets to ft_freqstatistics, there is a good chance the results you > got were wrong. > > Most likely, this bug was introduced with revision 4101, in september > 2011, so it has been in the code for quite a while. Note that > ft_channelrepair only supports repairing missing channels since > revision 5216 (february 2012), and that this was advised against until > revision 6100 (june 2012), when the algorithm for doing so sensibly > was implemented. > > The fix has been implemented and is now available from the FTP server > as of fieldtrip-20130319 (Donders users: the fix is automatically > available on the /home/common/ version of FieldTrip). Note that > ft_selectdata_old still does not work correctly, this is something we > will fix in the near future (ft_selectdata_old is deprecated). We > fixed the behaviour of ft_appendfreq (the preferred replacement > function for ft_selectdata_old when appending freq structures) and > changed ft_freqstatistics to use this function instead. > > The other statistics functions, ft_timelockstatistics and > ft_sourcestatistics, were not affected by this bug. We strongly advise > you to upgrade to the latest version of FieldTrip. If the situation > described above applies to you, you will need to redo your > channel-level (time-)frequency statistics analyses. > > Details on the bug (and a test script) can be found here: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > problems related to the bug, please post them there. > > We sincerely apologise for this bug and any trouble it might have caused. > > Best, > On behalf of the FT core development team, > > Eelke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From ricardoojm at gmail.com Thu Mar 21 01:42:34 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Wed, 20 Mar 2013 21:42:34 -0300 Subject: [FieldTrip] finding gradiometer Message-ID: Dear all, I am trying to run a source localization analysis of eeg oscillatory activity. My data was recorded by a BrainAmp, and I exported using the brainvision analyzer. Since I am very new to fieldtrip, I have a (probably very basic) doubt, and would be really glad if someone could help me. First, when creating the leadfield, it asks for the gradiometer (cfg.grad), but I didnt figure out where I can find it. I checked the "localizing oscillatory sources using beamformer techniques" tutorial, and it seems that it can be recovered as an output of the "ft_freqanalysis" (since there is a "cfg.grad = freqPost.grad" definition), but I didnt manage to have it, even running the same parameters as in the tutorial. Here is how I am doing the oscillatory analysis. cfg = []; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 2:2:20; cfg.toi = -0.5:0.05:1; TFR = ft_freqanalysis(cfg, dataEEGmax); Thanks a lot in advance, Best regards, Ricardo -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Mar 21 08:22:26 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 21 Mar 2013 08:22:26 +0100 Subject: [FieldTrip] finding gradiometer In-Reply-To: References: Message-ID: Hi Ricardo, try cfg.elec rather than cfg.grad. also ft_freqanalysis does not "recover" electrode positions, at least that would be a feature of wavelets new to me :-) you need to give fieldtrip the electrode positions: with MEG data they are usually automatically read when doing ft_preprocessing. otherwise you need to read the info (e.g. from a polhemus file) using ft_read_sens. if you don not have digitized positions, i guess that for most standard caps there are standard electrode positions in fieldtrip. good luck, n On 21.03.2013, at 01:42, Ricardo Moura wrote: > Dear all, > I am trying to run a source localization analysis of eeg oscillatory activity. My data was recorded by a BrainAmp, and I exported using the brainvision analyzer. > > Since I am very new to fieldtrip, I have a (probably very basic) doubt, and would be really glad if someone could help me. > > First, when creating the leadfield, it asks for the gradiometer (cfg.grad), but I didnt figure out where I can find it. I checked the "localizing oscillatory sources using beamformer techniques" tutorial, and it seems that it can be recovered as an output of the "ft_freqanalysis" (since there is a "cfg.grad = freqPost.grad" definition), but I didnt manage to have it, even running the same parameters as in the tutorial. > > Here is how I am doing the oscillatory analysis. > cfg = []; > cfg.method = 'wavelet'; > cfg.width = 2; > cfg.output = 'pow'; > cfg.foi = 2:2:20; > cfg.toi = -0.5:0.05:1; > TFR = ft_freqanalysis(cfg, dataEEGmax); > > Thanks a lot in advance, > Best regards, > Ricardo > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Thu Mar 21 09:34:29 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 21 Mar 2013 09:34:29 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: <514A1445.50007@berkeley.edu> References: <514A1445.50007@berkeley.edu> Message-ID: Hi Ingrid, Thanks for your question; it made me realize that my e-mail was not clear enough. In your case, when you repaired channels that were still present in the data, the output channel order of ft_channelrepair will be the same as the input channel order. The problem only occurs if you use ft_channelrepair to repair *missing* channels, so e.g. channels switched off during acquisition or that were discarded during preprocessing. Groeten, Eelke On 20 March 2013 20:55, Ingrid Nieuwenhuis wrote: > Hi Eelke, > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > subjects and subsequently used ft_freqstatistics. However, the channel order > is indentical in all my subjects in the freq. > > I repaired bad channels using the default setting (method='nearest'). The > bad channels were included in the input data to ft_channelrepair (so they > were not missing). I just checked, and in data_out after ft_channelrepair, > the order of the labels of the data is identical to the data_in, thus the > repaired channels were NOT appended to the end of the data. So apparently > ft_channelrepair not always appends the repaired channels at the end. I > suppose this is good news for me, meaning that the bug did not affect me, > since the channels were ordered identically when calling ft_freqstatistics. > Do you agree, or am I missing something? And for others that used > ft_channelrepair, might be worth checking if the ordering is indeed changed > after calling it, because it appears not always to be the case. > > Thanks, > Ingrid > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> Dear FieldTrip community, >> >> Short version: if you did ft_freqstatistics across subjects with a >> different channel ordering across data sets (which is the case if you >> use ft_channelrepair), your results might have been erroneous. Read >> the following carefully. >> >> Yesterday, we discovered a possibly severe bug in a utility function >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> entails that ft_selectdata_old assumes that the channels in all data >> input arguments are ordered identically, and does not take into >> account the order of the data.label field. This means that when >> several data input arguments with different channel orderings are >> passed to ft_selectdata_old, the resulting output structure (with a >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> channel X might end up in another channel Y). Importantly, the same >> thus holds for ft_freqstatistics: when doing statistics across >> subjects, if the different subjects' data sets have different channel >> orderings, the resulting statistics will be wrong. >> >> We expect that in many cases, the channel ordering across different >> data sets will be identical, and in those cases this bug will not have >> had any effect. However, one important case in which channel ordering >> *will* be different is when one does ft_channelrepair on a data set, >> since this function appends the repaired channels to the end of the >> data. So, if you have done ft_channelrepair on only a subset of your >> subjects' data, and/or used ft_channelrepair to repair different >> channels in different subjects, and subsequently passed the repaired >> data sets to ft_freqstatistics, there is a good chance the results you >> got were wrong. >> >> Most likely, this bug was introduced with revision 4101, in september >> 2011, so it has been in the code for quite a while. Note that >> ft_channelrepair only supports repairing missing channels since >> revision 5216 (february 2012), and that this was advised against until >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> was implemented. >> >> The fix has been implemented and is now available from the FTP server >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> available on the /home/common/ version of FieldTrip). Note that >> ft_selectdata_old still does not work correctly, this is something we >> will fix in the near future (ft_selectdata_old is deprecated). We >> fixed the behaviour of ft_appendfreq (the preferred replacement >> function for ft_selectdata_old when appending freq structures) and >> changed ft_freqstatistics to use this function instead. >> >> The other statistics functions, ft_timelockstatistics and >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> you to upgrade to the latest version of FieldTrip. If the situation >> described above applies to you, you will need to redo your >> channel-level (time-)frequency statistics analyses. >> >> Details on the bug (and a test script) can be found here: >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> problems related to the bug, please post them there. >> >> We sincerely apologise for this bug and any trouble it might have caused. >> >> Best, >> On behalf of the FT core development team, >> >> Eelke >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From t.w.kononowicz at rug.nl Thu Mar 21 19:23:38 2013 From: t.w.kononowicz at rug.nl (T.W. Kononowicz) Date: Thu, 21 Mar 2013 19:23:38 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate Message-ID: Dear FieldTrip users, I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. cfg = []; cfg.method = 'mne'; cfg.grid = grid; cfg.vol = template_vol; cfg.grad = grad; cfg.projectnoise = 'yes'; cfg.reducerank = 'no'; cfg.mne.lambda = 1e8; repr2_mne = ft_sourceanalysis(cfg, repr2_cov); The repr2_mne structure looks as follows: >> repr2_mne repr2_mne = dim: [15 15 14] time: [1x1751 double] pos: [3150x3 double] inside: [1x1613 double] outside: [1x1537 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] >> repr2_mne.avg ans = mom: {1x3150 cell} pow: [3150x1751 double] noisecov: {1x3150 cell} As the next step I call the ft_sourceinterpolate: cfg=[]; cfg.interpmethod='linear'; cfg.parameter='avg.pow'; cfg.downsample = 2; cfg.feedback='yes'; repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); Then I get the following display message. the input is source data with 3150 positions on a [15 15 14] grid the input is volume data with dimensions [91 109 91] updating homogenous coordinate transformation matrix downsampling anatomy downsampling inside the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB selecting subvolume of 34.7% reslicing and interpolating avg.pow After that the code crashes and I get the error: ??? Error using ==> interpn at 155 Wrong number of input arguments or some dimension of V is less than 2. Error in ==> ft_sourceinterpolate>my_interpn at 494 av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); Error in ==> ft_sourceinterpolate at 397 av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); Just before crush in line 397 of ft_sourceinterpolate: av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are: size(fv) ans = 3150 1751 ax, ay, az, are: size(ay) ans = 46 55 46 size(sel) ans = 116380 1 I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here? Thank you in advance for you help, Tadeusz W. Kononowicz -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhharsimrat at gmail.com Thu Mar 21 20:08:16 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Thu, 21 Mar 2013 19:08:16 +0000 Subject: [FieldTrip] K-fold classification Multivariate Analysis Message-ID: Hello All A question @ the k-fold classification . Does cfg.method = 'crossvalidate'; randomize the trials when it builds the folds? And does each fold contains representative of each class? OR Do I need to do this manually before I feed the data to ft_freqstatistics? Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.simanova at mpi.nl Fri Mar 22 08:11:20 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Fri, 22 Mar 2013 08:11:20 +0100 Subject: [FieldTrip] K-fold classification Multivariate Analysis In-Reply-To: References: Message-ID: <706F1C72-F1BD-473B-B2B0-79AC534B374A@mpi.nl> Dear Harsimrat, yes, the method does randomize trials. and each fold has trials of each class. You can check the 'trainfolds' field in the statistic's output. The indexes of trials assigned to each fold are stored there. best, Irina On Mar 21, 2013, at 8:08 PM 3/21/13, Harsimrat Singh wrote: > Hello All > > A question @ the k-fold classification > . > Does cfg.method = 'crossvalidate'; randomize the trials when it > builds the folds? And does each fold contains representative of each > class? > > OR > > Do I need to do this manually before I feed the data to > ft_freqstatistics? > > Best regards > Harsimrat > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Fri Mar 22 13:58:22 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Fri, 22 Mar 2013 12:58:22 +0000 Subject: [FieldTrip] Fwd: [SPM] UK MEG PhD studentships In-Reply-To: <4D3B09BC4D279A438B88696310A1B97D1FA7697A@AMSPRD0111MB483.eurprd01.prod.exchangelabs.com> References: <4D3B09BC4D279A438B88696310A1B97D1FA7697A@AMSPRD0111MB483.eurprd01.prod.exchangelabs.com> Message-ID: ---------- Forwarded message ---------- From: Barnes, Gareth Date: Fri, Mar 22, 2013 at 12:13 PM Subject: [SPM] UK MEG PhD studentships To: SPM at jiscmail.ac.uk Dear All The UK is recruiting a cohort of MEG PhD students. Could you pass this on to any potential candidates please. Best Gareth -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: UKMRCstudentships.pdf Type: application/pdf Size: 90537 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Fri Mar 22 16:00:39 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 22 Mar 2013 16:00:39 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate In-Reply-To: References: Message-ID: <514C7217.6050609@donders.ru.nl> Dear Tadeusz, does it work when you leave out cfg.downsample or with another interpolation method? Best, Jörn On 3/21/2013 7:23 PM, T.W. Kononowicz wrote: > Dear FieldTrip users, > > I am trying to do some source reconstruction on ERF data (version: > fieldtrip-20130320). Everything seems to work quite well up to > ft_sourceinterpolate. > > > cfg = []; > > cfg.method = 'mne'; > > cfg.grid = grid; > > cfg.vol = template_vol; > > cfg.grad = grad; > > cfg.projectnoise = 'yes'; > > cfg.reducerank = 'no'; > > cfg.mne.lambda = 1e8; > > repr2_mne = ft_sourceanalysis(cfg, repr2_cov); > > > The repr2_mne structure looks as follows: > >> repr2_mne > repr2_mne = > dim: [15 15 14] > time: [1x1751 double] > pos: [3150x3 double] > inside: [1x1613 double] > outside: [1x1537 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > >> repr2_mne.avg > ans = > mom: {1x3150 cell} > pow: [3150x1751 double] > noisecov: {1x3150 cell} > > > As the next step I call the ft_sourceinterpolate: > > cfg=[]; > > cfg.interpmethod='linear'; > > cfg.parameter='avg.pow'; > > cfg.downsample = 2; > > cfg.feedback='yes'; > > repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); > > > Then I get the following display message. > > the input is source data with 3150 positions on a [15 15 14] grid > > the input is volume data with dimensions [91 109 91] > > updating homogenous coordinate transformation matrix > > downsampling anatomy > > downsampling inside > > the call to "ft_volumedownsample" took 0 seconds and required the > additional allocation of an estimated 0 MB > > selecting subvolume of 34.7% > > reslicing and interpolating avg.pow > > > After that the code crashes and I get the error: > > > ??? Error using ==> interpn at 155 > > Wrong number of input arguments or some dimension of V is less than 2. > > > Error in ==> ft_sourceinterpolate>my_interpn at 494 > > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > > Error in ==> ft_sourceinterpolate at 397 > > av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), > cfg.interpmethod, > > cfg.feedback); > > > Just before crush in line 397 of ft_sourceinterpolate: av( sel) = > my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, > cfg.feedback); argument's size are: > > size(fv) > ans = > 3150 1751 > > ax, ay, az, are: > > size(ay) > > ans = > > 46 55 46 > > > size(sel) > > ans = > > 116380 1 > > > I found one similar post on the list, however its not helpful in that > case. Does anyone can spot what I'm missing here? > > > Thank you in advance for you help, > > > Tadeusz W. Kononowicz > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.w.kononowicz at rug.nl Sat Mar 23 12:16:40 2013 From: t.w.kononowicz at rug.nl (T.W. Kononowicz) Date: Sat, 23 Mar 2013 12:16:40 +0100 Subject: [FieldTrip] fieldtrip Digest, Vol 28, Issue 46 In-Reply-To: Message-ID: Dear Jorn, After leaving out cfg.downsample all interpolation methods result in the same error. Tadeusz From: Reply-To: Date: Saturday, March 23, 2013 12:00 PM To: Subject: fieldtrip Digest, Vol 28, Issue 46 > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: Problem with interpn function in ft_sourceinterpolate > (J?rn M. Horschig) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 22 Mar 2013 16:00:39 +0100 > From: "J?rn M. Horschig" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with interpn function in > ft_sourceinterpolate > Message-ID: <514C7217.6050609 at donders.ru.nl> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Dear Tadeusz, > > does it work when you leave out cfg.downsample or with another > interpolation method? > > Best, > J?rn > > > On 3/21/2013 7:23 PM, T.W. Kononowicz wrote: >> Dear FieldTrip users, >> >> I am trying to do some source reconstruction on ERF data (version: >> fieldtrip-20130320). Everything seems to work quite well up to >> ft_sourceinterpolate. >> >> >> cfg = []; >> >> cfg.method = 'mne'; >> >> cfg.grid = grid; >> >> cfg.vol = template_vol; >> >> cfg.grad = grad; >> >> cfg.projectnoise = 'yes'; >> >> cfg.reducerank = 'no'; >> >> cfg.mne.lambda = 1e8; >> >> repr2_mne = ft_sourceanalysis(cfg, repr2_cov); >> >> >> The repr2_mne structure looks as follows: >>>> >> repr2_mne >> repr2_mne = >> dim: [15 15 14] >> time: [1x1751 double] >> pos: [3150x3 double] >> inside: [1x1613 double] >> outside: [1x1537 double] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >>>> >> repr2_mne.avg >> ans = >> mom: {1x3150 cell} >> pow: [3150x1751 double] >> noisecov: {1x3150 cell} >> >> >> As the next step I call the ft_sourceinterpolate: >> >> cfg=[]; >> >> cfg.interpmethod='linear'; >> >> cfg.parameter='avg.pow'; >> >> cfg.downsample = 2; >> >> cfg.feedback='yes'; >> >> repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); >> >> >> Then I get the following display message. >> >> the input is source data with 3150 positions on a [15 15 14] grid >> >> the input is volume data with dimensions [91 109 91] >> >> updating homogenous coordinate transformation matrix >> >> downsampling anatomy >> >> downsampling inside >> >> the call to "ft_volumedownsample" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> >> selecting subvolume of 34.7% >> >> reslicing and interpolating avg.pow >> >> >> After that the code crashes and I get the error: >> >> >> ??? Error using ==> interpn at 155 >> >> Wrong number of input arguments or some dimension of V is less than 2. >> >> >> Error in ==> ft_sourceinterpolate>my_interpn at 494 >> >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >> >> >> Error in ==> ft_sourceinterpolate at 397 >> >> av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), >> cfg.interpmethod, >> >> cfg.feedback); >> >> >> Just before crush in line 397 of ft_sourceinterpolate: av( sel) = >> my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, >> cfg.feedback); argument's size are: >> >> size(fv) >> ans = >> 3150 1751 >> >> ax, ay, az, are: >> >> size(ay) >> >> ans = >> >> 46 55 46 >> >> >> size(sel) >> >> ans = >> >> 116380 1 >> >> >> I found one similar post on the list, however its not helpful in that >> case. Does anyone can spot what I'm missing here? >> >> >> Thank you in advance for you help, >> >> >> Tadeusz W. Kononowicz >> >> >> >> _______________________________________________ >> 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 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > a/attachment-0001.html> > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 28, Issue 46 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Mar 23 14:33:44 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 23 Mar 2013 14:33:44 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate In-Reply-To: References: Message-ID: hi tadeusz, I believe that interpolation from a 3D grid onto another 3D grid is not supported when the input contains multiple time points. Best Jan-Mathijs On Mar 21, 2013, at 7:23 PM, T.W. Kononowicz wrote: > Dear FieldTrip users, > > I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. > > > cfg = []; > cfg.method = 'mne'; > cfg.grid = grid; > cfg.vol = template_vol; > cfg.grad = grad; > cfg.projectnoise = 'yes'; > cfg.reducerank = 'no'; > cfg.mne.lambda = 1e8; > repr2_mne = ft_sourceanalysis(cfg, repr2_cov); > > The repr2_mne structure looks as follows: > >> repr2_mne > repr2_mne = > dim: [15 15 14] > time: [1x1751 double] > pos: [3150x3 double] > inside: [1x1613 double] > outside: [1x1537 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > >> repr2_mne.avg > ans = > mom: {1x3150 cell} > pow: [3150x1751 double] > noisecov: {1x3150 cell} > > > As the next step I call the ft_sourceinterpolate: > cfg=[]; > cfg.interpmethod='linear'; > cfg.parameter='avg.pow'; > cfg.downsample = 2; > cfg.feedback='yes'; > repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); > > Then I get the following display message. > the input is source data with 3150 positions on a [15 15 14] grid > the input is volume data with dimensions [91 109 91] > updating homogenous coordinate transformation matrix > downsampling anatomy > downsampling inside > the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB > selecting subvolume of 34.7% > reslicing and interpolating avg.pow > > After that the code crashes and I get the error: > > ??? Error using ==> interpn at 155 > Wrong number of input arguments or some dimension of V is less than 2. > > Error in ==> ft_sourceinterpolate>my_interpn at 494 > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > Error in ==> ft_sourceinterpolate at 397 > av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, > cfg.feedback); > > > Just before crush in line 397 of ft_sourceinterpolate: av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are: > size(fv) > ans = > 3150 1751 > ax, ay, az, are: > size(ay) > ans = > 46 55 46 > > size(sel) > ans = > 116380 1 > > > > I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here? > > Thank you in advance for you help, > > Tadeusz W. Kononowicz > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.koulouri84 at googlemail.com Sun Mar 24 22:49:11 2013 From: a.koulouri84 at googlemail.com (alexandra koulouri) Date: Sun, 24 Mar 2013 21:49:11 +0000 Subject: [FieldTrip] problem use OpenMEEG Message-ID: Hi, I would like to run the test example for the OpenMEEG. I followed the instructions and I installed the OpenMEEG.exe (Windows 8) However, when I wrote: system ('om_assemble' ) I receive this: 'om_assemble' is not recognized as an internal or external command, operable program or batch file. During the installation, I selected the option add path to windows for all users and there was the following warning: Warning! PATH too long installer unable to modify PATH! I am guessing that's the reason why it doesn't work and probably I need to change the path manually. But I don't know what I need to do. Any suggestions? many thanks, Alexandra -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhharsimrat at gmail.com Mon Mar 25 17:47:45 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 25 Mar 2013 16:47:45 +0000 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: <514A1445.50007@berkeley.edu> Message-ID: Hi All I think I am missing something with ft_selectdata. I investigated a bit more while redoing the analysis with new version of fieldtrip. I have 4 class data but i am just doing classification (multivariate analysis) between the first two classes with 13 and 20 trials each. After the ft_freqanalysis - all the trials are contained in tf - and tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have one channel as I removed others. When I use tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); to get trials for only the first class I get label: {32x1 cell} dimord: 'rpt_chan_freq_time' freq: [10.5000 12.5000 14.5000] time: [0.3000 0.4000 0.5000 0.6000] powspctrm: [4-D double] cumtapcnt: [13x3 double] cfg: [1x1 struct] Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as tf.powspctrm Similarly, for trials of class 2 tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); Again, the size of tf2 is same as tf1 which is same as tf The only difference in the structure is tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. The first question is- How does ft_freqstatistics handle tf1.cumtapcnt, when I use stat = ft_freqstatistics(cfg,tf1,tf2) Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? This only works if I design the label as cfg. design = [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' its size is 73*2 =146 But my total relevant trials are just 13 (class 1) + 20(class2) = 33 for both classes I suspect I making a mistake somewhere as in ideal case I should be designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); 2*ones(size(tf2.cumtapcnt,1),1)]' size(cg.design) should be 33 and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 3 4] So ft_freqstatistics should be handling 33 trials - with 13 from first class, 20 from other class. But now it has full 146 trials even after doing ft_selectdata. I will be very grateful for any help. Best regards Harsimrat On 21 March 2013 08:34, Eelke Spaak wrote: > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > > subjects and subsequently used ft_freqstatistics. However, the channel > order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, thus the > > repaired channels were NOT appended to the end of the data. So apparently > > ft_channelrepair not always appends the repaired channels at the end. I > > suppose this is good news for me, meaning that the bug did not affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is indeed > changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will not have > >> had any effect. However, one important case in which channel ordering > >> *will* be different is when one does ft_channelrepair on a data set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the repaired > >> data sets to ft_freqstatistics, there is a good chance the results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might have > caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Mar 25 18:07:33 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 25 Mar 2013 18:07:33 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: <514A1445.50007@berkeley.edu> Message-ID: Hi Harsimrat, Do you believe this is related to the bug I described? (If not, it's better to send an e-mail with a different subject line, to avoid confusion.) Cheers, Eelke On 25 March 2013 17:47, Harsimrat Singh wrote: > Hi All > > I think I am missing something with ft_selectdata. I investigated a bit more > while redoing the analysis with new version of fieldtrip. > > I have 4 class data but i am just doing classification (multivariate > analysis) between the first two classes with 13 and 20 trials each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have > one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > But my total relevant trials are just 13 (class 1) + 20(class2) = 33 for > both classes > I suspect I making a mistake somewhere as in ideal case I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 > 3 4] > > So ft_freqstatistics should be handling 33 trials - with 13 from first > class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > > > On 21 March 2013 08:34, Eelke Spaak wrote: >> >> Hi Ingrid, >> >> Thanks for your question; it made me realize that my e-mail was not >> clear enough. In your case, when you repaired channels that were still >> present in the data, the output channel order of ft_channelrepair will >> be the same as the input channel order. >> >> The problem only occurs if you use ft_channelrepair to repair >> *missing* channels, so e.g. channels switched off during acquisition >> or that were discarded during preprocessing. >> >> Groeten, >> Eelke >> >> On 20 March 2013 20:55, Ingrid Nieuwenhuis >> wrote: >> > Hi Eelke, >> > >> > Thanks for reporting. I did do ft_channelrepair on my EEG data for some >> > subjects and subsequently used ft_freqstatistics. However, the channel >> > order >> > is indentical in all my subjects in the freq. >> > >> > I repaired bad channels using the default setting (method='nearest'). >> > The >> > bad channels were included in the input data to ft_channelrepair (so >> > they >> > were not missing). I just checked, and in data_out after >> > ft_channelrepair, >> > the order of the labels of the data is identical to the data_in, thus >> > the >> > repaired channels were NOT appended to the end of the data. So >> > apparently >> > ft_channelrepair not always appends the repaired channels at the end. I >> > suppose this is good news for me, meaning that the bug did not affect >> > me, >> > since the channels were ordered identically when calling >> > ft_freqstatistics. >> > Do you agree, or am I missing something? And for others that used >> > ft_channelrepair, might be worth checking if the ordering is indeed >> > changed >> > after calling it, because it appears not always to be the case. >> > >> > Thanks, >> > Ingrid >> > >> > >> > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> >> >> Dear FieldTrip community, >> >> >> >> Short version: if you did ft_freqstatistics across subjects with a >> >> different channel ordering across data sets (which is the case if you >> >> use ft_channelrepair), your results might have been erroneous. Read >> >> the following carefully. >> >> >> >> Yesterday, we discovered a possibly severe bug in a utility function >> >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> >> entails that ft_selectdata_old assumes that the channels in all data >> >> input arguments are ordered identically, and does not take into >> >> account the order of the data.label field. This means that when >> >> several data input arguments with different channel orderings are >> >> passed to ft_selectdata_old, the resulting output structure (with a >> >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> >> channel X might end up in another channel Y). Importantly, the same >> >> thus holds for ft_freqstatistics: when doing statistics across >> >> subjects, if the different subjects' data sets have different channel >> >> orderings, the resulting statistics will be wrong. >> >> >> >> We expect that in many cases, the channel ordering across different >> >> data sets will be identical, and in those cases this bug will not have >> >> had any effect. However, one important case in which channel ordering >> >> *will* be different is when one does ft_channelrepair on a data set, >> >> since this function appends the repaired channels to the end of the >> >> data. So, if you have done ft_channelrepair on only a subset of your >> >> subjects' data, and/or used ft_channelrepair to repair different >> >> channels in different subjects, and subsequently passed the repaired >> >> data sets to ft_freqstatistics, there is a good chance the results you >> >> got were wrong. >> >> >> >> Most likely, this bug was introduced with revision 4101, in september >> >> 2011, so it has been in the code for quite a while. Note that >> >> ft_channelrepair only supports repairing missing channels since >> >> revision 5216 (february 2012), and that this was advised against until >> >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> >> was implemented. >> >> >> >> The fix has been implemented and is now available from the FTP server >> >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> >> available on the /home/common/ version of FieldTrip). Note that >> >> ft_selectdata_old still does not work correctly, this is something we >> >> will fix in the near future (ft_selectdata_old is deprecated). We >> >> fixed the behaviour of ft_appendfreq (the preferred replacement >> >> function for ft_selectdata_old when appending freq structures) and >> >> changed ft_freqstatistics to use this function instead. >> >> >> >> The other statistics functions, ft_timelockstatistics and >> >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> >> you to upgrade to the latest version of FieldTrip. If the situation >> >> described above applies to you, you will need to redo your >> >> channel-level (time-)frequency statistics analyses. >> >> >> >> Details on the bug (and a test script) can be found here: >> >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> >> problems related to the bug, please post them there. >> >> >> >> We sincerely apologise for this bug and any trouble it might have >> >> caused. >> >> >> >> Best, >> >> On behalf of the FT core development team, >> >> >> >> Eelke >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > -- >> > Ingrid Nieuwenhuis PhD >> > Postdoctoral Fellow >> > Sleep and Neuroimaging Laboratory >> > Department of Psychology >> > University of California, Berkeley >> > California 94720-1650 >> > Tolman Hall, room 5305 >> > >> > >> > _______________________________________________ >> > 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 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From singhharsimrat at gmail.com Mon Mar 25 18:35:42 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 25 Mar 2013 17:35:42 +0000 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems Message-ID: Hi All I think I have a problem with ft_selectdata. Data Background: I have 4 class data but i am just doing classification (multivariate analysis) between the first two classes with 13 and 20 trials each. After the ft_freqanalysis - all the trials are contained in tf - and tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have one channel as I removed others. When I use tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); to get trials for only the first class I get label: {32x1 cell} dimord: 'rpt_chan_freq_time' freq: [10.5000 12.5000 14.5000] time: [0.3000 0.4000 0.5000 0.6000] powspctrm: [4-D double] cumtapcnt: [13x3 double] cfg: [1x1 struct] Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as tf.powspctrm Similarly, for trials of class 2 tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); Again, the size of tf2 is same as tf1 which is same as tf The only difference in the structure is tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. The first question is- How does ft_freqstatistics handle tf1.cumtapcnt, when I use stat = ft_freqstatistics(cfg,tf1,tf2) Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? This only works if I design the label as cfg. design = [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' its size is 73*2 =146 Problem: My total relevant trials are just 13 (class 1) + 20(class2) = 33 for both classes and not 146. I suspect I making a mistake somewhere as in ideal case, I should be designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); 2*ones(size(tf2.cumtapcnt,1),1)]' size(cg.design) should be 33 and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 3 4] So after doing ft_selectdata, ft_freqstatistics should be handling 33 trials - with 13 from first class, 20 from other class. But now it has full 146 trials even after doing ft_selectdata. I will be very grateful for any help. Best regards Harsimrat On 21 March 2013 08:34, Eelke Spaak wrote: > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > > subjects and subsequently used ft_freqstatistics. However, the channel > order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, thus the > > repaired channels were NOT appended to the end of the data. So apparently > > ft_channelrepair not always appends the repaired channels at the end. I > > suppose this is good news for me, meaning that the bug did not affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is indeed > changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will not have > >> had any effect. However, one important case in which channel ordering > >> *will* be different is when one does ft_channelrepair on a data set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the repaired > >> data sets to ft_freqstatistics, there is a good chance the results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might have > caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 26 08:50:47 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 26 Mar 2013 08:50:47 +0100 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems In-Reply-To: References: Message-ID: <51515357.8090908@donders.ru.nl> Dear Harsimrat, Actually, both cumtapcnt and powspctrm should be subselected. The problem most likely comes from the fact that your data has 32 labels but in powspctrm only one channel left (dimord is rpt_chan_freq_time, dimension of powspctrm is 73 x 1 x 2 x 3, but you have 32 labels). Whatever you did to your data, you made it inconsistent. A way to solve this is to make the label fields have the sime size as powspctrm. A better way would be to find out what made them inconsistent. Not sure about freq and time here, because you mention that these dimension are alright for your tf matrix. That should solve it. ft_selectdata works with all our test data. If not, let us know or send me a snippet of your data together with some code to reproduce this error and I can have a more thorough look. Best, Jörn On 3/25/2013 6:35 PM, Harsimrat Singh wrote: > Hi All > > I think I have a problem with ft_selectdata. > > Data Background: I have 4 class data but i am just doing > classification (multivariate analysis) between the first two classes > with 13 and 20 trials each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I > have one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of > tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > Problem: > My total relevant trials are just 13 (class 1) + 20(class2) = 33 for > both classes and not 146. > I suspect I making a mistake somewhere as in ideal case, I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size > [20 1 3 4] > > So after doing ft_selectdata, ft_freqstatistics should be handling 33 > trials - with 13 from first class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > On 21 March 2013 08:34, Eelke Spaak > wrote: > > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data > for some > > subjects and subsequently used ft_freqstatistics. However, the > channel order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting > (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair > (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, > thus the > > repaired channels were NOT appended to the end of the data. So > apparently > > ft_channelrepair not always appends the repaired channels at the > end. I > > suppose this is good news for me, meaning that the bug did not > affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is > indeed changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case > if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility > function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all > data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different > channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will > not have > >> had any effect. However, one important case in which channel > ordering > >> *will* be different is when one does ft_channelrepair on a data > set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of > your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the > repaired > >> data sets to ft_freqstatistics, there is a good chance the > results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in > september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised > against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP > server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is > something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly > advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might > have caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Tue Mar 26 19:24:51 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Tue, 26 Mar 2013 19:24:51 +0100 Subject: [FieldTrip] problem use OpenMEEG In-Reply-To: References: Message-ID: hi Alexandra, can you try to run system ('om_assemble' ) from the folder where you installed OpenMEEG. FYI that's the trick Brainstorm uses to run OpenMEEG, it changes the current directory when calling the commands. hope this helps, Alex On Sun, Mar 24, 2013 at 10:49 PM, alexandra koulouri wrote: > Hi, > > I would like to run the test example for the OpenMEEG. > I followed the instructions and I installed the OpenMEEG.exe (Windows 8) > > However, when I wrote: > system ('om_assemble' ) > I receive this: > 'om_assemble' is not recognized as an internal or external command, > operable program or batch file. > > During the installation, I selected the option add path to windows for all > users > and there was the following warning: > Warning! PATH too long installer unable to modify PATH! > > I am guessing that's the reason why it doesn't work and probably I need to > change the path manually. > But I don't know what I need to do. > Any suggestions? > > many thanks, > Alexandra > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From candoosy at telus.net Wed Mar 27 00:24:40 2013 From: candoosy at telus.net (Jim McKay) Date: Tue, 26 Mar 2013 16:24:40 -0700 Subject: [FieldTrip] Calculating goodness of fit Message-ID: <51522E38.8040309@telus.net> Hello Fieldtrippers, I am trying to figure out how to calculate the goodness of fit (gof) after a dipole fit on MEG data. The equation for gof has two input variables, the measured data vector and the model data vector from the EC dipole fit. The measured data vector is easy, but I am confused which vector to use for the model data, which is a vector of length (1:Num_sensors). If dip1 is the output from the ft_dipolefitting function, candidates are: dip1.Vdata - perhaps this is the measured data? dip1.Vmodel - sounds promising? dip1.dip.pot - or maybe this? Can someone please clarify what vector to use? Cheers, Jim -- Jim McKay Candoo Systems Inc. - Magnetic field & vibration sensors, systems, and site surveys Tel. 778-840-0361 jim.mckay at candoosys.com www.candoosys.com From singhharsimrat at gmail.com Wed Mar 27 13:54:44 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 27 Mar 2013 12:54:44 +0000 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems In-Reply-To: <51515357.8090908@donders.ru.nl> References: <51515357.8090908@donders.ru.nl> Message-ID: Thanks for your help Jorn It now works ok. Best regards Harsimrat On 26 March 2013 07:50, "Jörn M. Horschig" wrote: > Dear Harsimrat, > > Actually, both cumtapcnt and powspctrm should be subselected. The problem > most likely comes from the fact that your data has 32 labels but in > powspctrm only one channel left (dimord is rpt_chan_freq_time, dimension of > powspctrm is 73 x 1 x 2 x 3, but you have 32 labels). Whatever you did to > your data, you made it inconsistent. A way to solve this is to make the > label fields have the sime size as powspctrm. A better way would be to find > out what made them inconsistent. Not sure about freq and time here, because > you mention that these dimension are alright for your tf matrix. > That should solve it. ft_selectdata works with all our test data. If not, > let us know or send me a snippet of your data together with some code to > reproduce this error and I can have a more thorough look. > > Best, > Jörn > > > > On 3/25/2013 6:35 PM, Harsimrat Singh wrote: > > Hi All > > I think I have a problem with ft_selectdata. > > Data Background: I have 4 class data but i am just doing classification > (multivariate analysis) between the first two classes with 13 and 20 trials > each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have > one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of > tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > Problem: > My total relevant trials are just 13 (class 1) + 20(class2) = 33 for both > classes and not 146. > I suspect I making a mistake somewhere as in ideal case, I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size > [20 1 3 4] > > So after doing ft_selectdata, ft_freqstatistics should be handling 33 > trials - with 13 from first class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > On 21 March 2013 08:34, Eelke Spaak wrote: > >> Hi Ingrid, >> >> Thanks for your question; it made me realize that my e-mail was not >> clear enough. In your case, when you repaired channels that were still >> present in the data, the output channel order of ft_channelrepair will >> be the same as the input channel order. >> >> The problem only occurs if you use ft_channelrepair to repair >> *missing* channels, so e.g. channels switched off during acquisition >> or that were discarded during preprocessing. >> >> Groeten, >> Eelke >> >> On 20 March 2013 20:55, Ingrid Nieuwenhuis >> wrote: >> > Hi Eelke, >> > >> > Thanks for reporting. I did do ft_channelrepair on my EEG data for some >> > subjects and subsequently used ft_freqstatistics. However, the channel >> order >> > is indentical in all my subjects in the freq. >> > >> > I repaired bad channels using the default setting (method='nearest'). >> The >> > bad channels were included in the input data to ft_channelrepair (so >> they >> > were not missing). I just checked, and in data_out after >> ft_channelrepair, >> > the order of the labels of the data is identical to the data_in, thus >> the >> > repaired channels were NOT appended to the end of the data. So >> apparently >> > ft_channelrepair not always appends the repaired channels at the end. I >> > suppose this is good news for me, meaning that the bug did not affect >> me, >> > since the channels were ordered identically when calling >> ft_freqstatistics. >> > Do you agree, or am I missing something? And for others that used >> > ft_channelrepair, might be worth checking if the ordering is indeed >> changed >> > after calling it, because it appears not always to be the case. >> > >> > Thanks, >> > Ingrid >> > >> > >> > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> >> >> Dear FieldTrip community, >> >> >> >> Short version: if you did ft_freqstatistics across subjects with a >> >> different channel ordering across data sets (which is the case if you >> >> use ft_channelrepair), your results might have been erroneous. Read >> >> the following carefully. >> >> >> >> Yesterday, we discovered a possibly severe bug in a utility function >> >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> >> entails that ft_selectdata_old assumes that the channels in all data >> >> input arguments are ordered identically, and does not take into >> >> account the order of the data.label field. This means that when >> >> several data input arguments with different channel orderings are >> >> passed to ft_selectdata_old, the resulting output structure (with a >> >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> >> channel X might end up in another channel Y). Importantly, the same >> >> thus holds for ft_freqstatistics: when doing statistics across >> >> subjects, if the different subjects' data sets have different channel >> >> orderings, the resulting statistics will be wrong. >> >> >> >> We expect that in many cases, the channel ordering across different >> >> data sets will be identical, and in those cases this bug will not have >> >> had any effect. However, one important case in which channel ordering >> >> *will* be different is when one does ft_channelrepair on a data set, >> >> since this function appends the repaired channels to the end of the >> >> data. So, if you have done ft_channelrepair on only a subset of your >> >> subjects' data, and/or used ft_channelrepair to repair different >> >> channels in different subjects, and subsequently passed the repaired >> >> data sets to ft_freqstatistics, there is a good chance the results you >> >> got were wrong. >> >> >> >> Most likely, this bug was introduced with revision 4101, in september >> >> 2011, so it has been in the code for quite a while. Note that >> >> ft_channelrepair only supports repairing missing channels since >> >> revision 5216 (february 2012), and that this was advised against until >> >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> >> was implemented. >> >> >> >> The fix has been implemented and is now available from the FTP server >> >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> >> available on the /home/common/ version of FieldTrip). Note that >> >> ft_selectdata_old still does not work correctly, this is something we >> >> will fix in the near future (ft_selectdata_old is deprecated). We >> >> fixed the behaviour of ft_appendfreq (the preferred replacement >> >> function for ft_selectdata_old when appending freq structures) and >> >> changed ft_freqstatistics to use this function instead. >> >> >> >> The other statistics functions, ft_timelockstatistics and >> >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> >> you to upgrade to the latest version of FieldTrip. If the situation >> >> described above applies to you, you will need to redo your >> >> channel-level (time-)frequency statistics analyses. >> >> >> >> Details on the bug (and a test script) can be found here: >> >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> >> problems related to the bug, please post them there. >> >> >> >> We sincerely apologise for this bug and any trouble it might have >> caused. >> >> >> >> Best, >> >> On behalf of the FT core development team, >> >> >> >> Eelke >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > -- >> > Ingrid Nieuwenhuis PhD >> > Postdoctoral Fellow >> > Sleep and Neuroimaging Laboratory >> > Department of Psychology >> > University of California, Berkeley >> > California 94720-1650 >> > Tolman Hall, room 5305 >> > >> > >> > _______________________________________________ >> > 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 >> > > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricardoojm at gmail.com Wed Mar 27 17:10:05 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Wed, 27 Mar 2013 13:10:05 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel Message-ID: Dear all I am creating a BEM model for eeg, following the appropriate tutorial, but I have a problem when preparing the headmodel. The output I have from the ft_prepare_headmodel command does not contain the "mat", and so, when I try to generate the leadfield, it returns an error message due to non existent "mat". I saw that other users had similar problem, but I haven't found a solution though. So, what is wrong with my script? Thanks a lot in advance! Best, Ricardo load standard_mri.mat mri_orig=mri; disp(mri) % Segmenting the data cfg = []; cfg.output= {'scalp','skull','brain'}; segmentedmri = ft_volumesegment(cfg, mri_orig); disp(segmentedmri) save segmentedmri segmentedmri % MESH cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 1000]; bnd=ft_prepare_mesh(cfg,segmentedmri); disp(bnd(1)) % Head Model = variavel vol cfg = []; cfg.method ='bem_dipoli'; %dipoli singlesphere vol = ft_prepare_headmodel(cfg, segmentedmri); >> disp(vol) bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] skin_surface: 1 source: 3 type: 'dipoli' unit: 'mm' cfg: [1x1 struct] -------------- next part -------------- An HTML attachment was scrubbed... URL: From cas243 at georgetown.edu Wed Mar 27 20:30:15 2013 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Wed, 27 Mar 2013 15:30:15 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab Message-ID: Dear FieldTrip Community, I'd like to better understand the requirement that the calculation of coherence be averaged over > 1 trials, a topic previously discussed on the FieldTrip discussion site (e.g. http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). I worked through the calculation of coherence for n=1 trials at two distinct channels manually (dividing the cross-spectrum by the mean of the power spectra), and indeed the value resolves to 1 as others have previously said it would (where the power spectra and cross spectrum were estimated with the multitaper method). However, I'm still confused because the Matlab function mscohere returns coherence values between 0 and 1 (less than 1) at each calculated frequency for an input of two single time series X and Y, e.g. two single time courses (from the same trial) at two distinct channels. I suspect this may be related to the method for estimating the power/cross spectral density in mscohere (Welch's averaged modified periodogram method) because if I estimate the cross-spectrum and power spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated option), then the coherence estimates are between 0 and 1 (not 1). Can someone please help me to understand this -- why would coherence be 1 using the multitaper method but not using Welch's method? I'd like to understand if coherence is fundamentally required to be estimated over multiple trials (at two distinct channels), or if the requirement for multiple trials is related to the method of calculating the spectra, and if so why that is the case. Thanks immensely, Clara From ith at deakin.edu.au Thu Mar 28 01:04:34 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 28 Mar 2013 00:04:34 +0000 Subject: [FieldTrip] Beamformer for ERP data Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I am trying to do a LCMV beamformer analysis using the ft_sourceanalysis for a ERP data set. Finally I intend to extract the source waveforms using virtual electrodes. But as we can only do meaningful source localisation for a small time interval say (50ms), how can I construct the source time course for a longer post stimulus period (say 500ms)after doing beamforming for shorter (50ms) time intervals? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Mobile : +61430321972 Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From am236 at georgetown.edu Thu Mar 28 02:36:09 2013 From: am236 at georgetown.edu (Andrei Medvedev) Date: Wed, 27 Mar 2013 21:36:09 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab In-Reply-To: References: Message-ID: <51539E89.2040001@georgetown.edu> Dear Clara, As previously discussed, coherence, indeed, FUNDAMENTALLY requires to be calculated over several trials, and this maxim does not depend on the way you calculate it. Because, conceptually, coherence is a measure of phase STABILITY in time i.e., how much it changes from trial to trial. If you have just one trial, you cannot say how stable the phase relationship between two signals is: one trial gives you just one measurement of phase difference (at least, if you use a window-based spectral analysis such as FFT, wavelet, tapers etc; the alternative methods based on instantaneous phase such as Hilbert transform are beyond this discussion at this point). And this is why your manual estimate of coherence on a single trial gives you 1: it should be this way because the cross-spectrum over one trial normalized by the auto-spectra of two signals IDENTICALLY equals 1 (you can simply check it with the formula). Why then does the Matlab mscohere give you values less than 1 even for one trial? It is just because all Matlab spectral functions split your one trial into several sub-segments BY DEFAULT. To check this, you need to take a full control of mscohere (not to use the default values) and explicitly say what windows to use. As an example, you can take two random variables x and y 1000 points long assuming fsample=1000 (1 sec trial). Then calculate coh by two different calls of mscohere: 1) Coh = mscohere(x,y,1000,0,1000,1000); - forcefully take the whole trial without splitting it into smaller parts by default; 2) Coh = mscohere(x,y,500,0,500,1000); - splitting this one trial into two sub-trials 500 points each without overlap. And see what happens. Best, Andrei. On 3/27/2013 3:30 PM, Clara A. Scholl wrote: > Dear FieldTrip Community, > > I'd like to better understand the requirement that the calculation of > coherence be averaged over> 1 trials, a topic previously discussed on > the FieldTrip discussion site (e.g. > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). > > I worked through the calculation of coherence for n=1 trials at two > distinct channels manually (dividing the cross-spectrum by the mean of > the power spectra), and indeed the value resolves to 1 as others have > previously said it would (where the power spectra and cross spectrum > were estimated with the multitaper method). However, I'm still > confused because the Matlab function mscohere returns coherence values > between 0 and 1 (less than 1) at each calculated frequency for an > input of two single time series X and Y, e.g. two single time courses > (from the same trial) at two distinct channels. > > I suspect this may be related to the method for estimating the > power/cross spectral density in mscohere (Welch's averaged modified > periodogram method) because if I estimate the cross-spectrum and power > spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated > option), then the coherence estimates are between 0 and 1 (not 1). > Can someone please help me to understand this -- why would coherence > be 1 using the multitaper method but not using Welch's method? > > I'd like to understand if coherence is fundamentally required to be > estimated over multiple trials (at two distinct channels), or if the > requirement for multiple trials is related to the method of > calculating the spectra, and if so why that is the case. > > Thanks immensely, > Clara > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stan.vanpelt at fcdonders.ru.nl Thu Mar 28 08:57:23 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 28 Mar 2013 08:57:23 +0100 (CET) Subject: [FieldTrip] Beamformer for ERP data In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> Message-ID: <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> Dear Imali, What you could do is the following: 1. determine the source of your activation by beamforming your 50ms time-interval data, or by doing a dipole fit on your ERP. 2. compute spatial filters at that location based on the covariance matrix of the data of the entire epoch you're interested in (e.g., 500ms pre until 500ms post stimulus onset). You could consider first bandpassing this data for the part of the spectrum that you are interested in (e.g. 13-28Hz for beta) . 3. create the virtual waveforms by multiplying the spatial filters with the band-passed data Hope that helps. Best, Stan -- Stan van Pelt, PhD Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Phone: +49 (0)69 96769 517 Fax: +49 (0)69 96769 555 www.esi-frankfurt.de ----- Oorspronkelijk bericht ----- > Van: "IMALI THANUJA HETTIARACHCHI" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 28 maart 2013 01:04:34 > Onderwerp: [FieldTrip] Beamformer for ERP data > Dear Fieldtrippers, > I am trying to do a LCMV beamformer analysis using the > ft_sourceanalysis for a ERP data set. Finally I intend to extract the > source waveforms using virtual electrodes. > But as we can only do meaningful source localisation for a small time > interval say (50ms), how can I construct the source time course for a > longer post stimulus period (say 500ms)after doing beamforming for > shorter (50ms) time intervals? > Many thanks in advance > Kind regards > Imali > Imali Thanuja Hettiarachchi > PhD Candidate > Centre for Intelligent Systems research > Deakin University, Geelong 3217, Australia. > Mobile : +61430321972 > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > Description: Description: Description: > cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From johanna.zumer at gmail.com Thu Mar 28 09:05:59 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 28 Mar 2013 09:05:59 +0100 Subject: [FieldTrip] Beamformer for ERP data In-Reply-To: <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> References: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Imali, In addition to Stan's good advice, you might also find better results by computing the covariance matrix from the unaveraged timelocked data, rather than the averaged ERP data. Cheers, Johanna 2013/3/28 Pelt, S. van (Stan) > Dear Imali, > > What you could do is the following: > 1. determine the source of your activation by beamforming your 50ms > time-interval data, or by doing a dipole fit on your ERP. > 2. compute spatial filters at that location based on the covariance matrix > of the data of the entire epoch you're interested in (e.g., 500ms pre until > 500ms post stimulus onset). You could consider first bandpassing this data > for the part of the spectrum that you are interested in (e.g. 13-28Hz for > beta). > 3. create the virtual waveforms by multiplying the spatial filters with > the band-passed data > > Hope that helps. > > Best, Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > www.esi-frankfurt.de > > ------------------------------ > > *Van: *"IMALI THANUJA HETTIARACHCHI" > *Aan: *fieldtrip at science.ru.nl > *Verzonden: *Donderdag 28 maart 2013 01:04:34 > *Onderwerp: *[FieldTrip] Beamformer for ERP data > > > Dear Fieldtrippers, > > > > I am trying to do a LCMV beamformer analysis using the ft_sourceanalysis > for a ERP data set. Finally I intend to extract the source waveforms using > virtual electrodes. > > > > But as we can only do meaningful source localisation for a small time > interval say (50ms), how can I construct the source time course for a > longer post stimulus period (say 500ms)after doing beamforming for shorter > (50ms) time intervals? > > > > Many thanks in advance > > > > Kind regards > > Imali > > > > *Imali Thanuja Hettiarachchi* > > PhD Candidate > > Centre for Intelligent Systems research > > Deakin University, Geelong 3217, Australia. > > > > Mobile : +61430321972 > > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > > > > [image: Description: Description: Description: > cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] > > > > > > > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Mar 28 09:43:29 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 28 Mar 2013 09:43:29 +0100 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <515402B1.3070700@donders.ru.nl> Hi Ricardo, I assume that you are using the dipoli method? I recently discovered that when the method fails, the error is caught and printed as a normal fprintf message to the command window. Most likely it complained about your segmentation or that something is wrong with the triangulation. I am not sure about the other BEM methods, but you can check the code whether a similar thing is done there. In my limited experience, independent of what BEM method you are using, this is solved by checking the segmentation again and making sure that all boundaries (skull, scalp, brain) are close, i.e. that there are no holes in the brain. Let me know if this is it for you. Best, Jörn On 3/27/2013 5:10 PM, Ricardo Moura wrote: > Dear all > I am creating a BEM model for eeg, following the appropriate tutorial, > but I have a problem when preparing the headmodel. The output I have > from the ft_prepare_headmodel command does not contain the "mat", and > so, when I try to generate the leadfield, it returns an error message > due to non existent "mat". I saw that other users had similar problem, > but I haven't found a solution though. So, what is wrong with my script? > > Thanks a lot in advance! > Best, > Ricardo > > > > > load standard_mri.mat > mri_orig=mri; > disp(mri) > > % Segmenting the data > cfg = []; > cfg.output= {'scalp','skull','brain'}; > segmentedmri = ft_volumesegment(cfg, mri_orig); > disp(segmentedmri) > save segmentedmri segmentedmri > > % MESH > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd=ft_prepare_mesh(cfg,segmentedmri); > disp(bnd(1)) > > % Head Model = variavel vol > cfg = []; > cfg.method ='bem_dipoli'; %dipoli singlesphere > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > >> disp(vol) > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > skin_surface: 1 > source: 3 > type: 'dipoli' > unit: 'mm' > cfg: [1x1 struct] > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From clara.scholl at gmail.com Thu Mar 28 14:12:39 2013 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Thu, 28 Mar 2013 09:12:39 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab In-Reply-To: <51539E89.2040001@georgetown.edu> References: <51539E89.2040001@georgetown.edu> Message-ID: Dear Andrei, Thank you for guiding me through my point of confusion, I really appreciate your detailed consideration! Your response finally clarifies the situation for me. Thanks, Clara On Wed, Mar 27, 2013 at 9:36 PM, Andrei Medvedev wrote: > Dear Clara, > > As previously discussed, coherence, indeed, FUNDAMENTALLY requires to be > calculated over several trials, and this maxim does not depend on the way > you calculate it. Because, conceptually, coherence is a measure of phase > STABILITY in time i.e., how much it changes from trial to trial. If you have > just one trial, you cannot say how stable the phase relationship between > two signals is: one trial gives you just one measurement of phase difference > (at least, if you use a window-based spectral analysis such as FFT, wavelet, > tapers etc; the alternative methods based on instantaneous phase such as > Hilbert transform are beyond this discussion at this point). And this is why > your manual estimate of coherence on a single trial gives you 1: it should > be this way because the cross-spectrum over one trial normalized by the > auto-spectra of two signals IDENTICALLY equals 1 (you can simply check it > with the formula). > > Why then does the Matlab mscohere give you values less than 1 even for one > trial? It is just because all Matlab spectral functions split your one trial > into several sub-segments BY DEFAULT. To check this, you need to take a full > control of mscohere (not to use the default values) and explicitly say what > windows to use. > > As an example, you can take two random variables x and y 1000 points long > assuming fsample=1000 (1 sec trial). Then calculate coh by two different > calls of mscohere: > > 1) Coh = mscohere(x,y,1000,0,1000,1000); - forcefully take the whole trial > without splitting it into smaller parts by default; > > 2) Coh = mscohere(x,y,500,0,500,1000); - splitting this one trial into two > sub-trials 500 points each without overlap. > > And see what happens. > > Best, > Andrei. > > > > On 3/27/2013 3:30 PM, Clara A. Scholl wrote: >> >> Dear FieldTrip Community, >> >> I'd like to better understand the requirement that the calculation of >> coherence be averaged over> 1 trials, a topic previously discussed on >> the FieldTrip discussion site (e.g. >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). >> >> I worked through the calculation of coherence for n=1 trials at two >> distinct channels manually (dividing the cross-spectrum by the mean of >> the power spectra), and indeed the value resolves to 1 as others have >> previously said it would (where the power spectra and cross spectrum >> were estimated with the multitaper method). However, I'm still >> confused because the Matlab function mscohere returns coherence values >> between 0 and 1 (less than 1) at each calculated frequency for an >> input of two single time series X and Y, e.g. two single time courses >> (from the same trial) at two distinct channels. >> >> I suspect this may be related to the method for estimating the >> power/cross spectral density in mscohere (Welch's averaged modified >> periodogram method) because if I estimate the cross-spectrum and power >> spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated >> option), then the coherence estimates are between 0 and 1 (not 1). >> Can someone please help me to understand this -- why would coherence >> be 1 using the multitaper method but not using Welch's method? >> >> I'd like to understand if coherence is fundamentally required to be >> estimated over multiple trials (at two distinct channels), or if the >> requirement for multiple trials is related to the method of >> calculating the spectra, and if so why that is the case. >> >> Thanks immensely, >> Clara >> _______________________________________________ >> 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 From ricardoojm at gmail.com Thu Mar 28 18:39:37 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Thu, 28 Mar 2013 14:39:37 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Jörn, thank you very much for your response! I checked the segmentation and everything seems to be ok (as far as I can say... No error messages were shown during the processing and I checked the generated objects and plots). But I had a strange error while preparing the head model. Somehow the command cannot find the dipoli files, even thought they are really where they should be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue of what it means. And I am running this command on a ubuntu 12.04 32-bit. Do you have any idea of how I can solve it? Thanks once again,Best, Ricardo using the executable "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not found Warning: an error ocurred while running dipoli > In ft_headmodel_dipoli at 201 In ft_prepare_headmodel at 226 Error using fread Invalid file identifier. Use fopen to generate a valid file identifier. Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > In ft_headmodel_dipoli at 209 In ft_prepare_headmodel at 226 On 27 March 2013 13:10, Ricardo Moura wrote: > Dear all > I am creating a BEM model for eeg, following the appropriate tutorial, but > I have a problem when preparing the headmodel. The output I have from the > ft_prepare_headmodel command does not contain the "mat", and so, when I try > to generate the leadfield, it returns an error message due to non existent > "mat". I saw that other users had similar problem, but I haven't found a > solution though. So, what is wrong with my script? > > Thanks a lot in advance! > Best, > Ricardo > > > > > load standard_mri.mat > mri_orig=mri; > disp(mri) > > % Segmenting the data > cfg = []; > cfg.output= {'scalp','skull','brain'}; > segmentedmri = ft_volumesegment(cfg, mri_orig); > disp(segmentedmri) > save segmentedmri segmentedmri > > % MESH > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd=ft_prepare_mesh(cfg,segmentedmri); > disp(bnd(1)) > > % Head Model = variavel vol > cfg = []; > cfg.method ='bem_dipoli'; %dipoli singlesphere > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > >> disp(vol) > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > skin_surface: 1 > source: 3 > type: 'dipoli' > unit: 'mm' > cfg: [1x1 struct] > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Fri Mar 29 07:35:16 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Fri, 29 Mar 2013 07:35:16 +0100 Subject: [FieldTrip] Antw: Re: non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <515544340200005700012398@gwsmtp1.uni-regensburg.de> Hi Ricardo, I have two hints that might help. Firstly, the segmentations and the corresponding meshes can not only intersect each other, but it can also happen that the generated meshes are self-intersecting. This can not be seen from the plots of the segmented brain. The probability for intersections is higher, in my experience, with finer mesh resolutions. You could try something like [800 800 600] instead of [3000 2000 1000]. I usually do some trial and error and then check the volumes with om_check_vol(vol), which will report any intersections and self-intersections in the meshes. The openmeeg plugin needs to be installed for that. Secondly, for to the '\tmp\xyz...': Some of the methods for generating headmodels (at least I know for dipoli and openmeeg) write large temporary files to the hard disk. They have a long random name in order to avoid that some other data is overwritten. These files might get very large, some GB, and they are written per default to \tmp. A while ago I had the problem the temporary files got larger than the space that our system administrator allowed for \tmp. The script ran without errors, but the mat in the resulting structure was empty. The solution was to change the file destination folder to something other than \tmp, which needs to be done directly within the code of the called function (there is no cfg-option or so for that). Hope that helps, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> Ricardo Moura 28.03.2013 18:39 >>> Hi Jörn, thank you very much for your response! I checked the segmentation and everything seems to be ok (as far as I can say... No error messages were shown during the processing and I checked the generated objects and plots). But I had a strange error while preparing the head model. Somehow the command cannot find the dipoli files, even thought they are really where they should be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue of what it means. And I am running this command on a ubuntu 12.04 32-bit. Do you have any idea of how I can solve it? Thanks once again,Best, Ricardo using the executable "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not found Warning: an error ocurred while running dipoli > In ft_headmodel_dipoli at 201 In ft_prepare_headmodel at 226 Error using fread Invalid file identifier. Use fopen to generate a valid file identifier. Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > In ft_headmodel_dipoli at 209 In ft_prepare_headmodel at 226 On 27 March 2013 13:10, Ricardo Moura wrote: Dear all I am creating a BEM model for eeg, following the appropriate tutorial, but I have a problem when preparing the headmodel. The output I have from the ft_prepare_headmodel command does not contain the "mat", and so, when I try to generate the leadfield, it returns an error message due to non existent "mat". I saw that other users had similar problem, but I haven't found a solution though. So, what is wrong with my script? Thanks a lot in advance! Best, Ricardo load standard_mri.mat mri_orig=mri; disp(mri) % Segmenting the data cfg = []; cfg.output= {'scalp','skull','brain'}; segmentedmri = ft_volumesegment(cfg, mri_orig); disp(segmentedmri) save segmentedmri segmentedmri % MESH cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 ( tel:%5B3000%202000 ) 1000]; bnd=ft_prepare_mesh(cfg,segmentedmri); disp(bnd(1)) % Head Model = variavel vol cfg = []; cfg.method ='bem_dipoli'; %dipoli singlesphere vol = ft_prepare_headmodel(cfg, segmentedmri); >> disp(vol) bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] skin_surface: 1 source: 3 type: 'dipoli' unit: 'mm' cfg: [1x1 struct] -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sat Mar 30 15:07:44 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sat, 30 Mar 2013 22:07:44 +0800 Subject: [FieldTrip] can do i use this tool do power envelope correlation Message-ID: Dear all, I see the ft_connectivityanalys could do 'powcorr',I would like to confirm whether is power envelope correlation. thanks, best xiao. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Sat Mar 30 15:28:59 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 30 Mar 2013 15:28:59 +0100 Subject: [FieldTrip] can do i use this tool do power envelope correlation In-Reply-To: References: Message-ID: Dear Xiao, Indeed, ft_connectivityanalysis with cfg.method='powcorr' computes power envelope (i.e. amplitude envelope squared) correlation. Best, Eelke On 30 March 2013 15:07, 陈雪 wrote: > Dear all, > > I see the ft_connectivityanalys could do 'powcorr',I would like to confirm > whether is power envelope correlation. > > thanks, > best > > xiao. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nuria.donamayor at neuro.uni-luebeck.de Fri Mar 1 11:02:55 2013 From: nuria.donamayor at neuro.uni-luebeck.de (=?iso-8859-1?Q?Nuria_Do=F1amayor_Alonso?=) Date: Fri, 1 Mar 2013 11:02:55 +0100 Subject: [FieldTrip] units Message-ID: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> Hey guys, just two very simple questions regarding units. I am calculating dipoles using planar gradiometer data from a 306 Neuromag system (input units T/cm), what are the units of the dipole moment? Also, what are the units of the LCMV beamformer? Thanks! Nuria From konklone at gmail.com Sat Mar 2 03:12:18 2013 From: konklone at gmail.com (Eric Mill) Date: Fri, 1 Mar 2013 20:12:18 -0600 Subject: [FieldTrip] Getting started with realtime EEG data Message-ID: Hi all, My apologies if this is off-topic here, since you all seem like very busy experts! I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. I see that FieldTrip has a realtime acquisition modulefor NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Sun Mar 3 10:58:36 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 3 Mar 2013 10:58:36 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: Message-ID: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Hi Eric, I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. best regards, Robert On 2 Mar 2013, at 3:12, Eric Mill wrote: > Hi all, > > My apologies if this is off-topic here, since you all seem like very busy experts! > > I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. > > I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? > > Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? > > My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. > > Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. > > -- Eric > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Sun Mar 3 11:35:37 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 3 Mar 2013 11:35:37 +0100 Subject: [FieldTrip] units In-Reply-To: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> References: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> Message-ID: <6A809326-5C8C-49E8-B826-0B39600409F0@donders.ru.nl> On 1 Mar 2013, at 11:02, Nuria Doñamayor Alonso wrote: > Hey guys, > just two very simple questions regarding units. I am calculating dipoles using planar gradiometer data from a 306 Neuromag system (input units T/cm), what are the units of the dipole moment? Also, what are the units of the LCMV beamformer? The beamformer spatial filter boils down to this equation w = inv(h' * inv(c) * h) * h' * inv(c) where the data covariance c c = d*d'/(n-1) and d is the data expressed in units of signal strength. Furthermore, h is the lead field expressed in "fieldstrength / dipole strength". If you combine all, you see that w is expressed in dipole strength / signal strength. So multiplying w with d you get dipole strength. Or with (w' * c * w) you get squared dipole strength (i.e. dipole power). Sofar the theory, Regretfully the practice aint so nice. Have a look at http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 or more in general http://bugzilla.fcdonders.nl/buglist.cgi?quicksearch=units There are a number of issues due to inconsistent dealing with units, which is largely due to the code not knowing about the units. One is that the neuromag data is in fieldstrentgh/distance for the planar channels, but fieldstrength for the magnetometers. The leadfield has always been computed as fieldstrength (i.e. the difference between the two coils, not divided by the distance). So the leadfield (which is in "fieldstrength" for all 306 channels) is inconsistent with the data (which is in "fieldstrength" for 102 and "fieldstrength/distance" for 204 channels). This results (as others have reported in the past) in the situation that magnetometers and planar gradiometers don't combine well in a single source reconstruction. If you consider converting units from m to cm or mm, i.e. expressing data in different geometrical units, you have to consider that not onlt the coil poisitions change, but also the signal strength (1 T/mm = 10 T/cm). That has never been considered in the code, so there are also bugs related to this. Finally, the units of conductivity in the volume conduction model is not properly scaled with units (although I think that that does not affect MEG, but it does EEG). So there are issues due to inconsistencies in units of signal strength, units of distance and units of conductivity. There are a number of action points defined in our bugzilla and I am working on getting them resolved together with Vladimir (also for SPM). At the moment I suggest you just to be careful with interpreting absolute units. Relative units (changes between conditions) and statistics are not affected. best Robert > Thanks! > Nuria > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stefan.debener at uni-oldenburg.de Sun Mar 3 13:26:35 2013 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Sun, 03 Mar 2013 13:26:35 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: <5133417B.8020901@uni-oldenburg.de> Hi Eric, We recently modified the Emotiv Epoc system and are very happy with the resulting data quality. The modifications & a truly mobile, outdoor walking, single-trial EEG evaluation study are published here: http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/abstract We have also performed more evaluation studies (unpublished) with this system and it performs very competitive for online P3 speller tasks (e.g. via BCI2000) and online motor imagery (e.g. via openvibe). Moreover, it is possible to read the data on Android smartphones/tablets, which is very promising: http://milab.imm.dtu.dk/eeg All necessary spare parts (electrodes, cap, box, connector, wiring information) can be purchased from www.easycap.de, and assembly is pretty straightforward and done in a few hours if you know how to use a soldering iron. Best, Stefan Am 3/3/13 10:58 AM, schrieb Robert Oostenveld: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. > > I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. > > I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each transl > ate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > >> Hi all, >> >> My apologies if this is off-topic here, since you all seem like very busy experts! >> >> I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. >> >> I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? >> >> Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? >> >> My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. >> >> Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. >> >> -- Eric >> _______________________________________________ >> 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 -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de From stefan.debener at uni-oldenburg.de Sun Mar 3 13:30:39 2013 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Sun, 03 Mar 2013 13:30:39 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: <5133426F.7060700@uni-oldenburg.de> Hoops, forgot to include this link, if you want to know how the modified Emotiv system looks like: http://www.youtube.com/watch?v=TLTko4AGmdk Best, Stefan Am 3/3/13 10:58 AM, schrieb Robert Oostenveld: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. > > I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. > > I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each transl > ate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > >> Hi all, >> >> My apologies if this is off-topic here, since you all seem like very busy experts! >> >> I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. >> >> I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? >> >> Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? >> >> My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. >> >> Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. >> >> -- Eric >> _______________________________________________ >> 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 -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de From konklone at gmail.com Sun Mar 3 23:26:15 2013 From: konklone at gmail.com (Eric Mill) Date: Sun, 3 Mar 2013 17:26:15 -0500 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: This is extremely helpful, and just what I was looking for, thank you (both Robert and Stefan). I have a few followup questions you've inspired. How "swappable" is the hardware? Do all EEG's fundamentally produce the same data from the same brain activity? And/or, does FieldTrip always expose data in its buffer in the same format? For example, I would be fine investing the $750 for an Emotiv 14-channel EEG, or even the $1200 for a KT88-1016, but not until after I've done some development with a cheaper device first. However, I would not want to have to rewrite all my code, or much of it, if I switch devices. I do have a requirement that I can have the same code work with either live or replayed data. From how you describe its buffer approach, it sounds like that's a core value of FieldTrip, and will make that requirement much easier to satisfy. Also, I do have one peculiar requirement, which is that the hardware be suitable for wearing during ordinary sleeping at home. This is more a requirement for the final (potentially more expensive) device, than the development device. The promotional photo for the Emotiv EEG, for example, looks like it might not be so great for that. I think I will be using WebSockets, but there will be an intermediate server. So, I will have a computer (perhaps a Raspberry Pi) receive data from the EEG, and then immediately stream it up an open TCP connection to a web server. This server will then stream it down to the individual browsers of visiting users, and JavaScript will do the visualization, in something like Three.js or Processing.js. So I don't think I'd be making a JavaScript implementation of FieldTrip, but I believe the server software could be made to be general purpose, and reusable in the work of others like yourselves. That would be a satisfying byproduct. The idea here is that the resulting website will show fully live and real time EEG data, specifically while I am sleeping. Since I only sleep for ~1/3 of any given day, the ability to replay things will be helpful in giving the site utility during the other 2/3. I've never done any signal processing before, not even so much as a fast Fourier transform. But I'm willing to learn! I'll be consulting the tutorial you've kindly written, but if you have any suggestions of learning material I should look at when figuring out how to (for example) detect when a subject has entered levels of sleep given streams of EEG data, it would be a lot of help to me. Unfortunately, the paper you linked to ( http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) is behind a paywall and is $35, but if you recommend it highly enough, I'll check it out. Again, thank you for being so welcome to a newbie, and for the recommendations and links. -- Eric On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products > since we made the initial implementation of the ThinkCap. I am still able > to find documentation here > http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdfand > http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell > whether the complete sets now sold by NeuroSky still use the same software > interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The > Epoc has more channels and a head mount for the electrodes. For the Epoc > you have to look into teh different SDK options, the cheapest version only > gives access to processed data, not to the raw data. For both the Epoc and > openeeg a implementation of a stand-allone executable is available in > http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke > for the ThinkCap, this copies the data to a "fieldtrip buffer", where > another (c/c++/java/python/matlab) application can easily read it from and > do the signal processing, not having to worry about the buffering and data > representation any more. > > I know it falls outside your budget, but have a look at > http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. > These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The > rationale for the fieldtrip buffer is that it allows us to develop analysis > pipelines using EEG data files on disk (using ft_read_data). Once the > offline analysis pipeline performs as desired, we just switch from reading > to disk to reading from the buffer (also ft_read_data). We happen to do > this using MATLAB for the rapid application development, but the same > strategy (develop for file, run in real-time) can be used with another > programming environment. > > I think that for signal processing you'll better off if you develop the > code using some good quality data from a file on disk. You can always enact > a real-time data stream by replaying data from that EEG file, or using the > sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, > constantly having to wear the headset. That is fine for artefact detection > (you can blink while you code), but not if the tasks get more complicated, > e.g. relaxing to increase your occipital alpha/10Hz won't work well if you > also have in realtime have to monitor whether your applications picks up > the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the > possibilities of a web-standards implementation. Web Sockets would be > needed in Javascript if we want to have the browser connect to a > "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky > w.r.t. it working on all platforms. A server-side implementation offers > more choice, python/java/php reading the data from a FT buffer or from the > device, and then pass it on in html format to the connected web ) but would > not scale as easily with multiple client connections if data processing > needs to be done on the server. We then considered the best option to be > to implement a RESTless server implementation. The server would one the one > hand contains the FT buffer (where it receives the data over low-level TCP) > and on the other hand have a web server with the RESTless interface. I.e. > the requests that are represented here > http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would > each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" > and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You > can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > > > Hi all, > > > > My apologies if this is off-topic here, since you all seem like very > busy experts! > > > > I'm trying to figure out what I need to get started with capturing > real-time EEG data using consumer-priced headsets (<$200). I don't actually > have any interest in using MATLAB, though - I just want to capture the raw > data, in real time. > > > > I see that FieldTrip has a realtime acquisition module for NeuroSky's > "ThinkCap", though I can't find a current product by NeuroSky called that. > Is there something else of theirs I could buy that would work with > FieldTrip? > > > > Or, should I be looking elsewhere entirely? What should someone who > wants real-time EEG data do? > > > > My plan is to stream this data and visualize it on the web in real time. > My background is in web development, not cognitive science, but I'm willing > to learn what I have to make something interesting. I'd also love to have > the project result in libraries useful for other people in the field. > > > > Thanks for any advice you can give on what EEG to buy, and/or where to > learn the core concepts I'll need to use the data. > > > > -- Eric > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 4 07:16:04 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 4 Mar 2013 07:16:04 +0100 Subject: [FieldTrip] troubles while reading 4D MEG files in getting the MEG channels In-Reply-To: References: <1538559706.484002.1361969272444.JavaMail.root@bureau-frontal1> Message-ID: Hi Sophie, That's strange. I assume that the same problem occurs when you try it with the xxx.COH dataset? Could you create yourself an account on our bugzilla.fcdonders.nl website, and file a bug about this? If you then upload one of the xxx.COH datasets (along with the config-file), as well as the MEG_LABEL variable we can have a look at it. Best wishes, Jan-Mathijs On Feb 27, 2013, at 1:51 PM, sophie chen wrote: > Dear all, > > I am trying to read MEG 4D files with Fieldtrip version 20130226 using ft_preprocessing file with a preselection of MEG channels ( 'MEG' or a cell array of channel names, here is MEG_LABEL) but the output > data contains only 152 channels while I have 248 channels... I tried the same code with Fieldtrip version 20121015, and I get everything properly (i.e. 248 channels) > Following the script I am running and the corresponding results in matlab. > > > cfg = []; > cfg.dataset = 'c,rfDC'; > cfg.trialdef.eventtype = 'TRIGGER'; > cfg.trialdef.eventvalue = 2; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim = 2; > [cfg] = ft_definetrial(cfg); > > % cfg.channel = 'MEG'; > cfg.channel = MEG_LABEL; > cfg.continous = 'yes'; > data_2 = ft_preprocessing (cfg) > > I get this >> > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 123 > evaluating trialfunction 'ft_trialfun_general' > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_trialfun_general at 71 > In ft_definetrial at 162 > undoing the Supine balancing > reading the events from 'c,rfDC' > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_read_event at 174 > In ft_trialfun_general at 80 > In ft_definetrial at 162 > found 677 events > created 249 trials > the call to "ft_definetrial" took 5 seconds > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_preprocessing at 394 > processing channel { 'A2' 'A104' 'A241' 'A138' 'A71' 'A125' 'A20' 'A65' 'A9' 'A114' 'A175' 'A228' 'A35' 'A191' 'A37' 'A170' 'A207' 'A224' 'A82' 'A238' 'A28' 'A239' 'A13' 'A165' 'A204' 'A25' 'A70' 'A11' 'A47' 'A64' 'A177' 'A127' 'A247' 'A194' 'A5' 'A242' 'A168' 'A31' 'A245' 'A219' 'A105' 'A222' 'A76' 'A188' 'A215' 'A235' 'A181' 'A38' 'A230' 'A91' 'A212' 'A24' 'A96' 'A57' 'A86' 'A116' 'A141' 'A120' 'A80' 'A210' 'A113' 'A27' 'A135' 'A167' 'A206' 'A100' 'A43' 'A200' 'A102' 'A132' 'A122' 'A62' 'A21' 'A229' 'A55' 'A32' 'A85' 'A58' 'A60' 'A88' 'A79' 'A203' 'A145' 'A139' 'A156' 'A68' 'A159' 'A236' 'A161' 'A6' 'A126' 'A94' 'A15' 'A193' 'A150' 'A36' 'A225' 'A195' 'A172' 'A108' 'A81' 'A171' 'A218' 'A173' 'A201' 'A74' 'A29' 'A164' 'A232' 'A69' 'A157' 'A97' 'A124' 'A40' 'A178' 'A179' 'A33' 'A147' 'A148' 'A89' 'A119' 'A52' 'A190' 'A73' 'A136' 'A184' 'A51' 'A77' 'A129' 'A197' 'A182' 'A46' 'A92' 'A41' 'A90' 'A23' 'A154' 'A18' 'A248' 'A149' 'A118' 'A152' 'A140' 'A110' 'A185' 'A162' 'A106' 'A187' 'A221' 'A133' 'A158' 'A216' } > reading and preprocessing > reading and preprocessing trial 249 from 249 > > the call to "ft_preprocessing" took 20 seconds > > data_2 = > > hdr: [1x1 struct] > label: {152x1 cell} > time: {1x249 cell} > trial: {1x249 cell} > fsample: 2.0345e+03 > sampleinfo: [249x2 double] > trialinfo: [249x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > This is what I get with Fieldtrip 20121015: > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 123 > evaluating trialfunction 'ft_trialfun_general' > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > reading the events from 'c,rfDC' > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > found 677 events > created 249 trials > the call to "ft_definetrial" took 7 seconds > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > processing channel { 'A22' 'A2' 'A104' 'A241' 'A138' 'A214' 'A71' 'A26' 'A93' 'A39' 'A125' 'A20' 'A65' 'A9' 'A8' 'A95' 'A114' 'A175' 'A16' 'A228' 'A35' 'A191' 'A37' 'A170' 'A207' 'A112' 'A224' 'A82' 'A238' 'A202' 'A220' 'A28' 'A239' 'A13' 'A165' 'A204' 'A233' 'A98' 'A25' 'A70' 'A72' 'A11' 'A47' 'A160' 'A64' 'A3' 'A177' 'A63' 'A155' 'A10' 'A127' 'A67' 'A115' 'A247' 'A174' 'A194' 'A5' 'A242' 'A176' 'A78' 'A168' 'A31' 'A223' 'A245' 'A219' 'A12' 'A186' 'A105' 'A222' 'A76' 'A50' 'A188' 'A231' 'A45' 'A180' 'A99' 'A234' 'A215' 'A235' 'A181' 'A38' 'A230' 'A91' 'A212' 'A24' 'A66' 'A42' 'A96' 'A57' 'A86' 'A56' 'A116' 'A151' 'A141' 'A120' 'A189' 'A80' 'A210' 'A143' 'A113' 'A27' 'A137' 'A135' 'A167' 'A75' 'A240' 'A206' 'A107' 'A130' 'A100' 'A43' 'A200' 'A102' 'A132' 'A183' 'A199' 'A122' 'A19' 'A62' 'A21' 'A229' 'A84' 'A213' 'A55' 'A32' 'A85' 'A146' 'A58' 'A60' 'A88' 'A79' 'A169' 'A54' 'A203' 'A145' 'A103' 'A163' 'A139' 'A49' 'A166' 'A156' 'A128' 'A68' 'A159' 'A236' 'A161' 'A121' 'A4' 'A61' 'A6' 'A126' 'A14' 'A94' 'A15' 'A193' 'A150' 'A227' 'A59' 'A36' 'A225' 'A195' 'A30' 'A109' 'A172' 'A108' 'A81' 'A171' 'A218' 'A173' 'A201' 'A74' 'A29' 'A164' 'A205' 'A232' 'A69' 'A157' 'A97' 'A217' 'A101' 'A124' 'A40' 'A123' 'A153' 'A178' 'A1' 'A179' 'A33' 'A147' 'A117' 'A148' 'A87' 'A89' 'A243' 'A119' 'A52' 'A142' 'A211' 'A190' 'A53' 'A192' 'A73' 'A226' 'A136' 'A184' 'A51' 'A237' 'A77' 'A129' 'A131' 'A198' 'A197' 'A182' 'A46' 'A92' 'A41' 'A90' 'A7' 'A23' 'A83' 'A154' 'A34' 'A17' 'A18' 'A248' 'A149' 'A118' 'A208' 'A152' 'A140' 'A144' 'A209' 'A110' 'A111' 'A244' 'A185' 'A246' 'A162' 'A106' 'A187' 'A48' 'A221' 'A196' 'A133' 'A158' 'A44' 'A134' 'A216' } > reading and preprocessing > reading and preprocessing trial 249 from 249 > > the call to "ft_preprocessing" took 24 seconds > > data_2 = > > hdr: [1x1 struct] > label: {248x1 cell} > time: {1x249 cell} > trial: {1x249 cell} > fsample: 2.0345e+03 > sampleinfo: [249x2 double] > trialinfo: [249x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > I hope this helps to find out where the problem is coming from... > Thanks in advance for your help > > Cheers, > > Sophie Chen > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 4 11:11:24 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 4 Mar 2013 11:11:24 +0100 (CET) Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well In-Reply-To: <512FD5B5.8080700@gmail.com> References: <512FD5B5.8080700@gmail.com> Message-ID: <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> hi Ye, here is a FAQ about the function of the ft_volumereslice function: http://fieldtrip.fcdonders.nl/faq/how_change_mri_orientation_size_fov One of the reasons why it is suggested to use the ft_volumereslice function before segmentation is that some of the segmentation-processes require isotropic voxels (this means that a voxel must have the same size into each direction). The ft_volumereslice function is reslicing the image and returns it with isotropic voxel-size. But if your mri images are isotropic, you do not need to bother with this. But you have to be careful when you use the ft_volumereslice function and you do not specify the resolution or the dimensions of its output. In this case, it will return the image resliced to a default resolution and a default dimension (it is 256X256X256 with 1 mm resolution if I remember well), and it is possible that your image will loose some information. I suspect that this happened when you resliced your mri. Can you see the whole brain when you plot the resliced mri with the ft_sourcplot function? The solution for this problem is that you define the resolution and the dimensions yourself for ft_volumereslice. I hope this helps. Best, Lilla > Hello All, > > I found the problem I mentioned in the previous email was caused by > using "mri_sliced = ft_volumereslice([], mri);" before using > ft_volumesegment. > After erasing the line "mri_sliced = ft_volumereslice([], mri);", the > segmented brain seems to be normal and fits the sensor helmet well now, > as show in the attached figure(notvolumnsliced.jpg). > For another of my subject, if the "ft_volumereslice" is included, the > brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" > it looks normal(subject2.jpg). > > I notice in the fieldtrip headmodel tutorial > (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), > "ft_volumereslice" is not used. but in the field trip beamformer > tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. > > I am wondering if I should include "ft_volumereslice" in my source > localization code. Can anyone give me some suggestions? > > > > thanks ahead, > Ye > > > > > On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. segmented brain seems not fitting the sensor helmet well (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 11:38:21 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512F87FD.80500 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >> segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: brain.png >> Type: image/png >> Size: 15197 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: head.jpg >> Type: image/jpeg >> Size: 50294 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 31 >> ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Joachim.Gross at glasgow.ac.uk Mon Mar 4 15:37:49 2013 From: Joachim.Gross at glasgow.ac.uk (Joachim Gross) Date: Mon, 4 Mar 2013 14:37:49 +0000 Subject: [FieldTrip] 5-year Post-Doc Position in Glasgow Message-ID: <9967549B-AA9A-40DC-A640-E01C60730107@glasgow.ac.uk> Research Associate Ref: M00513 Salary: Grade 6/7 £26,264 - £29,541 / £32,267 - £36,298 per annum You will contribute to a 5-year Wellcome Trust funded research project entitled “Natural and modulated neural communication: State-dependent decoding and driving of human Brain Oscillations” (Joint Investigators: Gregor Thut, Joachim Gross). The job requires working in an interdisciplinary team of researchers on longstanding questions of how brain oscillations orchestrate brain functions, or relate to brain dysfunction. This will involve the development and/or application of new analysis methods to eavesdrop on brain communication and decode some of the information coded in brain oscillations (MEG/EEG). The successful applicant will be part of a larger team of researchers where information decoding (MEG/EEG) is complemented with controlled intervention into brain oscillations by transcranial stimulation to modulate brain function (combined TMS/tACS-EEG). For more information on the position and environment please write to Joachim.Gross at glasgow.ac.uk, orGregor.Thut at glasgow.ac.uk Apply online at www.glasgow.ac.uk/jobs Closing date: 1 April 2013 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Mon Mar 4 18:45:22 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Mon, 04 Mar 2013 18:45:22 +0100 Subject: [FieldTrip] MNE surface data: normalising and averaging? In-Reply-To: <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> Message-ID: <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Dear Fieldtrippers, I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! Best regards, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 4 22:01:51 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 04 Mar 2013 22:01:51 +0100 Subject: [FieldTrip] MNE surface data: normalising and averaging? In-Reply-To: <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Message-ID: <51350BBF.4040807@donders.ru.nl> Hi Gregor, would there be any reason why the following approach might not work? http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp The specific steps are in more detail explained in this (new) tutorial: http://fieldtrip.fcdonders.nl/development/beamformingextended Best, Jörn On 3/4/2013 6:45 PM, Gregor Volberg wrote: > Dear Fieldtrippers, > I need to ask for a helpful hint on MNE source reconstructions. > Following this tutorial > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained > nice individual cortical meshes and source points; the MNE forward and > inverse solution for the individuals all work well. I would now like > to normalize the individual grids to a template brain in order to do > statistics and averaging for plotting. I figured out that I could use > ft_sourceinterpolate to tranform the grid into a volumetric > representation, and then use ft_volumenormalise to normalise to a > standard brain. But this did not work too well for source structures > containing time series (like 'mne'-stcutures) where the computational > load gets very high. I also tried to use a grid of one subject as a > template for the other subject's grids with ft_sourceinterpolate and > cfg.interpmethod = 'smudge', but this seems to require two grids with > the same number of source points as input(?). > Is there a way to do a normalisation directly on brain triangulations > / source grids ? Thanks for any help! > Best regards, > Gregor > -- > Dr. rer. nat. Gregor Volberg > > ( > mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanbelluzo at gmail.com Tue Mar 5 00:27:29 2013 From: sanbelluzo at gmail.com (Santiago Belluzo) Date: Mon, 4 Mar 2013 20:27:29 -0300 Subject: [FieldTrip] Emotiv + FieldTrip + Matlab Message-ID: *Hi, I'm new to FieldTrip and I'm interested in using it to capture **realtime data from the Emotiv headset using the function emotiv2ft.I`ve tried some examples like signalviewer andpowerviewer with random signal from signalproxy to check that the FieldTripBuffer works fine. Then i`ve tried to use emotiv2ft and have problems. * *I'm not sure about how to call to this interface from within **Matlab.* *I`ve read some messages from the mailinglist with similar problem but in there is not clear for me how they solve it. * *I´ll be waiting for any help!.* *Thanks.* -- Santiago -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Tue Mar 5 09:03:24 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Tue, 05 Mar 2013 09:03:24 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <51350BBF.4040807@donders.ru.nl> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> Message-ID: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Hi Jörn, thank you for your fast response! I wasn't aware that this approach also works with irregularly spaced surface grids as input. I will try it this way. Thanks again, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> Hi Gregor, would there be any reason why the following approach might not work? http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp The specific steps are in more detail explained in this (new) tutorial: http://fieldtrip.fcdonders.nl/development/beamformingextended Best, Jörn On 3/4/2013 6:45 PM, Gregor Volberg wrote: Dear Fieldtrippers, I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! Best regards, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Mar 5 10:24:51 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 5 Mar 2013 10:24:51 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Message-ID: <348B78CB-0BFC-4446-800E-E4CF6BD838F6@donders.ru.nl> Hi Gregor, To follow up on this: I guess what Jörn meant is that you could use the irregular 3D grids, as the target grids onto which the surface data will be interpolated. This makes the interpolated 3D-grid data directly averageable. JM On Mar 5, 2013, at 9:03 AM, Gregor Volberg wrote: > Hi Jörn, > > thank you for your fast response! I wasn't aware that this approach also works with irregularly spaced surface grids as input. I will try it this way. > > Thanks again, > Gregor > > > > > -- > Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> > Hi Gregor, > > would there be any reason why the following approach might not work? > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp > > The specific steps are in more detail explained in this (new) tutorial: > http://fieldtrip.fcdonders.nl/development/beamformingextended > > Best, > Jörn > > On 3/4/2013 6:45 PM, Gregor Volberg wrote: >> Dear Fieldtrippers, >> >> I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). >> Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! >> Best regards, >> Gregor >> >> -- >> Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) >> University of Regensburg >> Institute for Experimental Psychology >> 93040 Regensburg, Germany >> Tel: +49 941 943 3862 >> Fax: +49 941 943 3233 >> http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >> >> >> >> >> _______________________________________________ >> >> 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 Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eschulz at lrz.tu-muenchen.de Tue Mar 5 10:30:03 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Tue, 5 Mar 2013 10:30:03 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: Dear Fieldtrip experts, I would like to create a leadfield based on the standard brain provided by the fieldtrip package and standard electrode positions. Unfortunately, whatever I'm trying it ends up in a number of error messages. Is anybody out there who could provide some support? Thank you very much in advance, Best, Enrico -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 5 10:33:37 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Mar 2013 10:33:37 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Message-ID: <5135BBF1.5090005@donders.ru.nl> Hi again, as a second link I meant to paste this one: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended The procedure, however, is in more detail explained in the first link I pasted, in this tutorial an example of how to use that is illustrated. Hope it works out! Best, Jörn On 3/5/2013 9:03 AM, Gregor Volberg wrote: > > Hi Jörn, > > > thank you for your fast response! I wasn't aware that this approach > also works with irregularly spaced surface grids as input. I will try > it this way. > > > Thanks again, > > Gregor > > > > > > -- > Dr. rer. nat. Gregor Volberg > ( > mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > > >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> > > Hi Gregor, > > would there be any reason why the following approach might not work? > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp > > The specific steps are in more detail explained in this (new) tutorial: > http://fieldtrip.fcdonders.nl/development/beamformingextended > > Best, > Jörn > > On 3/4/2013 6:45 PM, Gregor Volberg wrote: > >> Dear Fieldtrippers, >> >> I need to ask for a helpful hint on MNE source reconstructions. >> Following this tutorial >> http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained >> nice individual cortical meshes and source points; the MNE forward >> and inverse solution for the individuals all work well. I would now >> like to normalize the individual grids to a template brain in order >> to do statistics and averaging for plotting. I figured out that I >> could use ft_sourceinterpolate to tranform the grid into a volumetric >> representation, and then use ft_volumenormalise to normalise to a >> standard brain. But this did not work too well for source structures >> containing time series (like 'mne'-stcutures) where the computational >> load gets very high. I also tried to use a grid of one subject as a >> template for the other subject's grids with ft_sourceinterpolate and >> cfg.interpmethod = 'smudge', but this seems to require two grids with >> the same number of source points as input(?). >> >> Is there a way to do a normalisation directly on brain triangulations >> / source grids ? Thanks for any help! >> >> Best regards, >> >> Gregor >> >> -- >> Dr. rer. nat. Gregor Volberg >> > > ( >> mailto:gregor.volberg at psychologie.uni-regensburg.de ) >> University of Regensburg >> Institute for Experimental Psychology >> 93040 Regensburg, Germany >> Tel: +49 941 943 3862 >> Fax: +49 941 943 3233 >> http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >> >> >> >> _______________________________________________ >> >> >> >> >> 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 -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 5 11:33:05 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Mar 2013 11:33:05 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <5135C9E1.3030906@donders.ru.nl> Dear Enrico, we are always very happy to provide support and help. If you just copy and paste your cfg settings, the function-call itself and the error you got, then we can try to find what is going wrong. Feel free to write this to the general discussion list rather than to any specific person - that way others running intro similar issues might find the here proposed solution easier. Best, Jörn On 3/5/2013 10:30 AM, Enrico Schulz wrote: > Dear Fieldtrip experts, > > I would like to create a leadfield based on the standard brain > provided by the fieldtrip package and standard electrode positions. > Unfortunately, whatever I'm trying it ends up in a number of error > messages. > > Is anybody out there who could provide some support? > > Thank you very much in advance, > Best, > Enrico > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Tue Mar 5 12:08:08 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Tue, 5 Mar 2013 12:08:08 +0100 (CET) Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Dear Enrico, I think more information is needed about the error messages and about how you try to compute leadfield in order to help. If you have not encountered the FT tutorial sites, example scripts and FAQs yet, maybe you can check out those as well because they provide information on source-reconstruction, leadfields... etc.. (For example, a tutorial for EEG headmodels: http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example script for leadfield computation: http://fieldtrip.fcdonders.nl/example/compute_leadfield). Best, Lilla > Dear Fieldtrip experts, > > I would like to create a leadfield based on the standard brain provided by > the fieldtrip package and standard electrode positions. > Unfortunately, whatever I'm trying it ends up in a number of error > messages. > > Is anybody out there who could provide some support? > > Thank you very much in advance, > Best, > Enrico > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hamid.mohseni at eng.ox.ac.uk Tue Mar 5 19:03:23 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Tue, 5 Mar 2013 18:03:23 +0000 Subject: [FieldTrip] Downloading tutorial data Message-ID: Hi, I cannot download tutorial files e.g.: ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip I tried both chrome and firefox, is there any reason? -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Wed Mar 6 05:24:28 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 5 Mar 2013 23:24:28 -0500 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: Sorry, that was a very long response on my part - but the one actual question I have in there is, how easy is it to switch from one EEG device to another? Should I expect to have to rework my code entirely, or will the core data format and signal processing work be the same? Is standardizing the data stream one of the things using an intermediary like Field Trip does? -- Eric On Sun, Mar 3, 2013 at 5:26 PM, Eric Mill wrote: > This is extremely helpful, and just what I was looking for, thank you > (both Robert and Stefan). I have a few followup questions you've inspired. > > How "swappable" is the hardware? Do all EEG's fundamentally produce the > same data from the same brain activity? And/or, does FieldTrip always > expose data in its buffer in the same format? > > For example, I would be fine investing the $750 for an Emotiv 14-channel > EEG, or even the $1200 for a KT88-1016, but not until after I've done some > development with a cheaper device first. However, I would not want to have > to rewrite all my code, or much of it, if I switch devices. > > I do have a requirement that I can have the same code work with either > live or replayed data. From how you describe its buffer approach, it sounds > like that's a core value of FieldTrip, and will make that requirement much > easier to satisfy. > > Also, I do have one peculiar requirement, which is that the hardware be > suitable for wearing during ordinary sleeping at home. This is more a > requirement for the final (potentially more expensive) device, than the > development device. The promotional photo for the Emotiv EEG, > for example, looks like it might not be so great for that. > > I think I will be using WebSockets, but there will be an intermediate > server. So, I will have a computer (perhaps a Raspberry Pi) receive data > from the EEG, and then immediately stream it up an open TCP connection to a > web server. This server will then stream it down to the individual browsers > of visiting users, and JavaScript will do the visualization, in something > like Three.js or Processing.js. > > So I don't think I'd be making a JavaScript implementation of FieldTrip, > but I believe the server software could be made to be general purpose, and > reusable in the work of others like yourselves. That would be a satisfying > byproduct. > > The idea here is that the resulting website will show fully live and real > time EEG data, specifically while I am sleeping. Since I only sleep for > ~1/3 of any given day, the ability to replay things will be helpful in > giving the site utility during the other 2/3. > > I've never done any signal processing before, not even so much as a fast > Fourier transform. But I'm willing to learn! I'll be consulting the > tutorial you've kindly written, > but if you have any suggestions of learning material I should look at when > figuring out how to (for example) detect when a subject has entered levels > of sleep given streams of EEG data, it would be a lot of help to me. > > Unfortunately, the paper you linked to ( > http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) is > behind a paywall and is $35, but if you recommend it highly enough, I'll > check it out. > > Again, thank you for being so welcome to a newbie, and for the > recommendations and links. > > -- Eric > > > On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Eric, >> >> I think that NeuroSky renamed and discontinued some of their products >> since we made the initial implementation of the ThinkCap. I am still able >> to find documentation here >> http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdfand >> http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell >> whether the complete sets now sold by NeuroSky still use the same software >> interface, but NeuroSky is rather open with their development tools. >> >> Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The >> Epoc has more channels and a head mount for the electrodes. For the Epoc >> you have to look into teh different SDK options, the cheapest version only >> gives access to processed data, not to the raw data. For both the Epoc and >> openeeg a implementation of a stand-allone executable is available in >> http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke >> for the ThinkCap, this copies the data to a "fieldtrip buffer", where >> another (c/c++/java/python/matlab) application can easily read it from and >> do the signal processing, not having to worry about the buffering and data >> representation any more. >> >> I know it falls outside your budget, but have a look at >> http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. >> These KT88-1016 systems are available from ebay. >> >> Let me add a bit from the developers perspective and software design. The >> rationale for the fieldtrip buffer is that it allows us to develop analysis >> pipelines using EEG data files on disk (using ft_read_data). Once the >> offline analysis pipeline performs as desired, we just switch from reading >> to disk to reading from the buffer (also ft_read_data). We happen to do >> this using MATLAB for the rapid application development, but the same >> strategy (develop for file, run in real-time) can be used with another >> programming environment. >> >> I think that for signal processing you'll better off if you develop the >> code using some good quality data from a file on disk. You can always enact >> a real-time data stream by replaying data from that EEG file, or using the >> sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, >> constantly having to wear the headset. That is fine for artefact detection >> (you can blink while you code), but not if the tasks get more complicated, >> e.g. relaxing to increase your occipital alpha/10Hz won't work well if you >> also have in realtime have to monitor whether your applications picks up >> the alpha. >> >> Some time ago we (i.e. Boris Reuderink and me) looked into the >> possibilities of a web-standards implementation. Web Sockets would be >> needed in Javascript if we want to have the browser connect to a >> "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky >> w.r.t. it working on all platforms. A server-side implementation offers >> more choice, python/java/php reading the data from a FT buffer or from the >> device, and then pass it on in html format to the connected web ) but would >> not scale as easily with multiple client connections if data processing >> needs to be done on the server. We then considered the best option to be >> to implement a RESTless server implementation. The server would one the one >> hand contains the FT buffer (where it receives the data over low-level TCP) >> and on the other hand have a web server with the RESTless interface. I.e. >> the requests that are represented here >> http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would >> each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" >> and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You >> can ask Boris (CC) offline whether he has given it further thought. >> >> best regards, >> Robert >> >> >> >> On 2 Mar 2013, at 3:12, Eric Mill wrote: >> >> > Hi all, >> > >> > My apologies if this is off-topic here, since you all seem like very >> busy experts! >> > >> > I'm trying to figure out what I need to get started with capturing >> real-time EEG data using consumer-priced headsets (<$200). I don't actually >> have any interest in using MATLAB, though - I just want to capture the raw >> data, in real time. >> > >> > I see that FieldTrip has a realtime acquisition module for NeuroSky's >> "ThinkCap", though I can't find a current product by NeuroSky called that. >> Is there something else of theirs I could buy that would work with >> FieldTrip? >> > >> > Or, should I be looking elsewhere entirely? What should someone who >> wants real-time EEG data do? >> > >> > My plan is to stream this data and visualize it on the web in real >> time. My background is in web development, not cognitive science, but I'm >> willing to learn what I have to make something interesting. I'd also love >> to have the project result in libraries useful for other people in the >> field. >> > >> > Thanks for any advice you can give on what EEG to buy, and/or where to >> learn the core concepts I'll need to use the data. >> > >> > -- Eric >> > _______________________________________________ >> > 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 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 6 07:37:00 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 06 Mar 2013 07:37:00 +0100 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: <5136E40C.3000509@donders.ru.nl> Hi Hamid, Your link works for me, and also other links on the tutorial page work for me. Not sure what might go wrong for you. Have you tried copy&pasting the link rather than clicking? I doubt the following, but maybe there is some firewall setting restricting access to the ftp-port for you? Best, Jörn On 3/5/2013 7:03 PM, Hamid Mohseni wrote: > Hi, > > I cannot download tutorial files e.g.: > > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip > > I tried both chrome and firefox, is there any reason? > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Mar 6 09:08:04 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 6 Mar 2013 09:08:04 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: Hi Eric, Yes, FieldTrip's raw data format is the same regardless of acquisition device, so I expect no problems switching from one device to another. Note, though, that I have not worked with the realtime buffer, but I think it ought to work the same as with offline data processing. Certain analysis pipelines (e.g. source reconstruction) require accurate information about the electrode positions. The ease at which you could obtain these might differ between different devices. However, based on the info you've given so far I guess this will not be a problem for you. Best, Eelke On 6 March 2013 05:24, Eric Mill wrote: > Sorry, that was a very long response on my part - but the one actual > question I have in there is, how easy is it to switch from one EEG device to > another? Should I expect to have to rework my code entirely, or will the > core data format and signal processing work be the same? Is standardizing > the data stream one of the things using an intermediary like Field Trip > does? > > -- Eric > > > On Sun, Mar 3, 2013 at 5:26 PM, Eric Mill wrote: >> >> This is extremely helpful, and just what I was looking for, thank you >> (both Robert and Stefan). I have a few followup questions you've inspired. >> >> How "swappable" is the hardware? Do all EEG's fundamentally produce the >> same data from the same brain activity? And/or, does FieldTrip always expose >> data in its buffer in the same format? >> >> For example, I would be fine investing the $750 for an Emotiv 14-channel >> EEG, or even the $1200 for a KT88-1016, but not until after I've done some >> development with a cheaper device first. However, I would not want to have >> to rewrite all my code, or much of it, if I switch devices. >> >> I do have a requirement that I can have the same code work with either >> live or replayed data. From how you describe its buffer approach, it sounds >> like that's a core value of FieldTrip, and will make that requirement much >> easier to satisfy. >> >> Also, I do have one peculiar requirement, which is that the hardware be >> suitable for wearing during ordinary sleeping at home. This is more a >> requirement for the final (potentially more expensive) device, than the >> development device. The promotional photo for the Emotiv EEG, for example, >> looks like it might not be so great for that. >> >> I think I will be using WebSockets, but there will be an intermediate >> server. So, I will have a computer (perhaps a Raspberry Pi) receive data >> from the EEG, and then immediately stream it up an open TCP connection to a >> web server. This server will then stream it down to the individual browsers >> of visiting users, and JavaScript will do the visualization, in something >> like Three.js or Processing.js. >> >> So I don't think I'd be making a JavaScript implementation of FieldTrip, >> but I believe the server software could be made to be general purpose, and >> reusable in the work of others like yourselves. That would be a satisfying >> byproduct. >> >> The idea here is that the resulting website will show fully live and real >> time EEG data, specifically while I am sleeping. Since I only sleep for ~1/3 >> of any given day, the ability to replay things will be helpful in giving the >> site utility during the other 2/3. >> >> I've never done any signal processing before, not even so much as a fast >> Fourier transform. But I'm willing to learn! I'll be consulting the tutorial >> you've kindly written, but if you have any suggestions of learning material >> I should look at when figuring out how to (for example) detect when a >> subject has entered levels of sleep given streams of EEG data, it would be a >> lot of help to me. >> >> Unfortunately, the paper you linked to >> (http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) >> is behind a paywall and is $35, but if you recommend it highly enough, I'll >> check it out. >> >> Again, thank you for being so welcome to a newbie, and for the >> recommendations and links. >> >> -- Eric >> >> >> On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld >> wrote: >>> >>> Hi Eric, >>> >>> I think that NeuroSky renamed and discontinued some of their products >>> since we made the initial implementation of the ThinkCap. I am still able >>> to find documentation here >>> http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf >>> and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell >>> whether the complete sets now sold by NeuroSky still use the same software >>> interface, but NeuroSky is rather open with their development tools. >>> >>> Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The >>> Epoc has more channels and a head mount for the electrodes. For the Epoc you >>> have to look into teh different SDK options, the cheapest version only gives >>> access to processed data, not to the raw data. For both the Epoc and openeeg >>> a implementation of a stand-allone executable is available in >>> http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for >>> the ThinkCap, this copies the data to a "fieldtrip buffer", where another >>> (c/c++/java/python/matlab) application can easily read it from and do the >>> signal processing, not having to worry about the buffering and data >>> representation any more. >>> >>> I know it falls outside your budget, but have a look at >>> http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. >>> These KT88-1016 systems are available from ebay. >>> >>> Let me add a bit from the developers perspective and software design. The >>> rationale for the fieldtrip buffer is that it allows us to develop analysis >>> pipelines using EEG data files on disk (using ft_read_data). Once the >>> offline analysis pipeline performs as desired, we just switch from reading >>> to disk to reading from the buffer (also ft_read_data). We happen to do this >>> using MATLAB for the rapid application development, but the same strategy >>> (develop for file, run in real-time) can be used with another programming >>> environment. >>> >>> I think that for signal processing you'll better off if you develop the >>> code using some good quality data from a file on disk. You can always enact >>> a real-time data stream by replaying data from that EEG file, or using the >>> sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, >>> constantly having to wear the headset. That is fine for artefact detection >>> (you can blink while you code), but not if the tasks get more complicated, >>> e.g. relaxing to increase your occipital alpha/10Hz won't work well if you >>> also have in realtime have to monitor whether your applications picks up the >>> alpha. >>> >>> Some time ago we (i.e. Boris Reuderink and me) looked into the >>> possibilities of a web-standards implementation. Web Sockets would be >>> needed in Javascript if we want to have the browser connect to a "fieldtrip >>> buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it >>> working on all platforms. A server-side implementation offers more choice, >>> python/java/php reading the data from a FT buffer or from the device, and >>> then pass it on in html format to the connected web ) but would not scale as >>> easily with multiple client connections if data processing needs to be done >>> on the server. We then considered the best option to be to implement a >>> RESTless server implementation. The server would one the one hand contains >>> the FT buffer (where it receives the data over low-level TCP) and on the >>> other hand have a web server with the RESTless interface. I.e. the requests >>> that are represented here >>> http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would >>> each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" and >>> "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask >>> Boris (CC) offline whether he has given it further thought. >>> >>> best regards, >>> Robert >>> >>> >>> >>> On 2 Mar 2013, at 3:12, Eric Mill wrote: >>> >>> > Hi all, >>> > >>> > My apologies if this is off-topic here, since you all seem like very >>> > busy experts! >>> > >>> > I'm trying to figure out what I need to get started with capturing >>> > real-time EEG data using consumer-priced headsets (<$200). I don't actually >>> > have any interest in using MATLAB, though - I just want to capture the raw >>> > data, in real time. >>> > >>> > I see that FieldTrip has a realtime acquisition module for NeuroSky's >>> > "ThinkCap", though I can't find a current product by NeuroSky called that. >>> > Is there something else of theirs I could buy that would work with >>> > FieldTrip? >>> > >>> > Or, should I be looking elsewhere entirely? What should someone who >>> > wants real-time EEG data do? >>> > >>> > My plan is to stream this data and visualize it on the web in real >>> > time. My background is in web development, not cognitive science, but I'm >>> > willing to learn what I have to make something interesting. I'd also love to >>> > have the project result in libraries useful for other people in the field. >>> > >>> > Thanks for any advice you can give on what EEG to buy, and/or where to >>> > learn the core concepts I'll need to use the data. >>> > >>> > -- Eric >>> > _______________________________________________ >>> > 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 >> >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Gregor.Volberg at psychologie.uni-regensburg.de Wed Mar 6 09:50:55 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Wed, 06 Mar 2013 09:50:55 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Message-ID: <5137117F0200005700011F41@gwsmtp1.uni-regensburg.de> Hi Gio, Jan-Mathijs and Jörn, thank you all for your helpful replies. Gio, a special 'thank you' for your very detailled response. These are very interesting points, though somewhat beyond of what I try to do. I will be working through the suggested literature and the new tutorial and might come back later if there are further questions. Best regard, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> Gio Piantoni 05.03.2013 09:20 >>> Hi Gregor, I also like the surface approach a lot, but things get really complicated when you have to average across subjects. I don't know if you are familiar with statistics in freesurfer, but what they do is to convert the source points of the single subject to a subject-specific sphere. Then the sphere is averaged across subjects. The coregistration between these spheres takes advantage of landmarks. See my attempt at: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-September/005585.html If I understand you correctly, you are at step 3). You can use smudge to get to the high-resolution smoothwm (or pial). Then the number of vertices in smoothwm corresponds to the number of vertices in the sphere. Here you have two options: use fieldtrip code or MNE code. I tried using fieldtrip code, but where I got stuck was to do statistics on the averaged sphere (taken from fsaverage). I used this code: https://github.com/gpiantoni/eventbased/blob/77c3f85ef94baf9d4ab629d48a31e8046c924518/powsource_grand.m#L136-L158 where data{i1,i2,p,h} is already projected onto the subject-specific sphere. However, after projecting to the averaged sphere, you need to do statistics on a 2-d cortical sheet and, from my understanding, the subfunctions to create clusters do not work all that well. I think it'd be very powerful to do statistics on a 2d sheet. See http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004749.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2012-February/004766.html for discussion. I did not get far because the clustering methods needed updated to work on cortical sheets in an efficient manner. Another route you can try is to use the MNE/freesurfer software to do that. See for example: http://martinos.org/mne/manual/morph.html You'd just write the surface to disk and use MNE/freesurfer. I personally don't like the method to correct for multiple comparisons in freesurfer (which I think might give false positive) and I think that the fieldtrip stats is better, but I had some problems getting to work on 2-d cortical sheets. For the moment, I decided to go with the volume-based approach, although I have the feeling that it's less accurate and less sensitive. See also: Tucholka, A., Fritsch, V., Poline, J.-B., and Thirion, B. (2012). An empirical comparison of surface-based and volume-based group studies in neuroimaging. Neuroimage 63, 1443–1453. Maybe I confused you more than helped, but if you manage to do statistics on surfaces, please let me know because I'd be interested in using it. Hope this helps. Gio -- Giovanni Piantoni, MSc Dept. Sleep & Cognition Netherlands Institute for Neuroscience Meibergdreef 47 1105 BA Amsterdam (NL) +31 20 5665492 gio at gpiantoni.com www.gpiantoni.com On Mon, Mar 4, 2013 at 6:45 PM, Gregor Volberg wrote: > Dear Fieldtrippers, > > I need to ask for a helpful hint on MNE source reconstructions. Following > this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I > obtained nice individual cortical meshes and source points; the MNE forward > and inverse solution for the individuals all work well. I would now like to > normalize the individual grids to a template brain in order to do statistics > and averaging for plotting. I figured out that I could use > ft_sourceinterpolate to tranform the grid into a volumetric representation, > and then use ft_volumenormalise to normalise to a standard brain. But this > did not work too well for source structures containing time series (like > 'mne'-stcutures) where the computational load gets very high. I also tried > to use a grid of one subject as a template for the other subject's grids > with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to > require two grids with the same number of source points as input(?). > Is there a way to do a normalisation directly on brain triangulations / > source grids ? Thanks for any help! > Best regards, > Gregor > > -- > Dr. rer. nat. Gregor Volberg > ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Wed Mar 6 10:37:37 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Wed, 6 Mar 2013 09:37:37 +0000 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Thanks, It works fine today, Regards On 6 March 2013 06:37, "Jörn M. Horschig" wrote: > Hi Hamid, > > Your link works for me, and also other links on the tutorial page work for > me. Not sure what might go wrong for you. Have you tried copy&pasting the > link rather than clicking? I doubt the following, but maybe there is some > firewall setting restricting access to the ftp-port for you? > > Best, > Jörn > > > > On 3/5/2013 7:03 PM, Hamid Mohseni wrote: > > Hi, > > I cannot download tutorial files e.g.: > > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip > > I tried both chrome and firefox, is there any reason? > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.ye.mei at gmail.com Wed Mar 6 22:35:53 2013 From: frank.ye.mei at gmail.com (Ye Mei) Date: Wed, 06 Mar 2013 16:35:53 -0500 Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well, (jan-mathijs schoffelen) In-Reply-To: References: Message-ID: <5137B6B9.5080400@gmail.com> Hi Jan-Mathijs, Thank you very much for the reply. I think the problem starts at "mri_sliced = ft_volumereslice([], mri);" before using "ft_volumesegment.". The attached file "beforevolumnslice.png" is the result of "imagesc(squeeze(mri.anatomy(:,111,:)))"; The attached file "aftervolumnslice.png" is the result of "imagesc(squeeze(mri_sliced.anatomy(:,111,:)))". We can see part of the head in "aftervolumnslice.png" is already sliced away. Could one do source localization without using "mri_sliced = ft_volumereslice([], mri);"? To circumvent the problem, I am trying to use FreeSurfer instead of ft_volumereslice and ft_volumesegment. I had several .mgz files from freesurfer. Can I do the following? -------- mri=ft_read_mri("brain.mgz"); %brain.mgz is the segmented brain by FreeSurfer cfg = []; cfg.method ='fiducial'; cfg.fiducial.nas = [30 132 96];% position of Nasion cfg.fiducial.lpa = [127 113 170];% position of LPA cfg.fiducial.rpa = [125 115 18]% position of RPA cfg.fiducial.zpoint = [125 125 220] [mri_aligned] = ft_volumerealign(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, mri_aligned); ... --------- thanks ahead, Ye On 13-02-28 05:10 PM, fieldtrip-request at science.ru.nl wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: NIHC-BrainGain Tutorial Day - March 21, 2013 > (Robert Oostenveld) > 2. Re: segmented brain seems not fitting the sensor helmet well > (jan-mathijs schoffelen) > 3. Re: segmented brain seems not fitting the sensor helmet well > (Ye Mei) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 28 Feb 2013 17:46:39 +0100 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] NIHC-BrainGain Tutorial Day - March 21, 2013 > Message-ID: <9741C083-F00A-4BC9-86EF-FB99715576A7 at donders.ru.nl> > Content-Type: text/plain; charset=windows-1252 > > Dear FieldTrip users, > > The NIHC-BrainGain Tutorial Day marks the end of the BrainGain project. For the last 6 years, the development and continued support of FieldTrip for normal/offline and realtime/online analysis has received support from the BrainGain project. > > There is now more information available online on this tutorial day, please see > https://www.hersenenencognitie.nl/contents/1876 > https://www.hersenenencognitie.nl/contents/1915 > > If you happen to be close to Nijmegen, you might also want to come to the "Breinfest" on Tuesday evening 19 March in the city centre with talks by international speakers and BCI demo's for the general public. Personally, I will be demonstrating how real-time data streaming and processing can be done using the FieldTrip buffer to various platforms (OS X, WIndows, Linux), to the Raspberry Pi and even to an Arduino (yes, fieldtrip runs on an arduino! ... well, a small part of it runs on an arduino). See http://www.ru.nl/breinfest for details on the evening. > > best regards, > Robert > > > > On 19 Feb 2013, at 14:30, Robert Oostenveld wrote: > >> NIHC-BrainGain Tutorial Day: >> Tools and novelties in neurotechnology research >> >> We invite PhD students, post-docs and senior researchers working in the fields of brain-computer interfacing (BCI), neurofeedback, cognitive neuroscience, neuroinformatics, neurosurgery and related topics to our Tutorial Day on March 21st, 2013 in the Sanadome Nijmegen. >> The day marks the end of the BrainGain consortium, a six-year joint-effort project on Brain-Computer Interfacing and related technologies. More information on BrainGain can be found here. >> >> The Tutorial Day will consist of a 'tools' track and a 'novelties? track. The 'tools' track is intended to provide both newcomers to the field and experienced researchers with an overview of the tools needed to integrate cognitive neuroscience and advanced invasive and non-invasive technology. Topics range from data streaming to modelling and statistics, and from online fMRI decoding to a crash course in neuroethics., You will also receive some helpful insights for a future career, in case you are interested in applying for a grant in the near future or considering setting up your own company. >> The 'novelties' track covers a wide range of topics indicating some of the possible topics to be further explored in BCI and neurotechnology research, including genetics, robotics and intracranial recordings. >> There is no need to stick to one of the two tracks the whole day: you are free to switch between tracks any time. >> >> In parallel to the lectures, there will be several interesting demonstrations. >> >> The full programme and registration form can be found on the NIHC website (https://www.hersenenencognitie.nl). Please register before 1 March 2013. Participation is free. Lunch and drinks will be provided. >> >> We hope to welcome you on March 21st in Nijmegen! >> >> Susanna Bicknell >> Radboud University Nijmegen >> ____________________________________________________________________ >> Faculty of Science | Finance and Economic Affairs | Project Management | LC-IMPACT >> Faculty of Social Sciences | Donders Centre for Cognition | BRAINGAIN | Project Manager >> T +31 24 3653300 | HG00.616 (Monday, Thursday) >> Faculty of Science | IMAPP | T +31 24 3652972 | HG07.315 (Tuesday, Wednesday) >> Postal address: P.O. Box 9010, 6500 GL Nijmegen, The Netherlands >> Visiting and courier service address: Heyendaalseweg 135, 6525 AJ Nijmegen, The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 2 > Date: Thu, 28 Feb 2013 18:54:14 +0100 > From: jan-mathijs schoffelen > To: FieldTrip discussion list > Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor > helmet well > Message-ID: > Content-Type: text/plain; charset="us-ascii" > > Hi Ye, > > Looks like a coregistration problem to me. In other words, something went wrong in ft_volumesegment, because the images were not sufficiently aligned. You need to investigate the input and output of ft_volumesegment. > Do you use ft_volumerealign after calling ft_volumesegment? This should be the other way around. > > Best, > > Jan-Mathijs > > > On Feb 28, 2013, at 5:38 PM, Ye Mei wrote: > >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Thu, 28 Feb 2013 17:09:57 -0500 > From: Ye Mei > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor > helmet well > Message-ID: <512FD5B5.8080700 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hello All, > > I found the problem I mentioned in the previous email was caused by > using "mri_sliced = ft_volumereslice([], mri);" before using > ft_volumesegment. > After erasing the line "mri_sliced = ft_volumereslice([], mri);", the > segmented brain seems to be normal and fits the sensor helmet well now, > as show in the attached figure(notvolumnsliced.jpg). > For another of my subject, if the "ft_volumereslice" is included, the > brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" > it looks normal(subject2.jpg). > > I notice in the fieldtrip headmodel tutorial > (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), > "ft_volumereslice" is not used. but in the field trip beamformer > tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. > > I am wondering if I should include "ft_volumereslice" in my source > localization code. Can anyone give me some suggestions? > > > > thanks ahead, > Ye > > > > > On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. segmented brain seems not fitting the sensor helmet well (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 11:38:21 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512F87FD.80500 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: brain.png >> Type: image/png >> Size: 15197 bytes >> Desc: not available >> URL: >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: head.jpg >> Type: image/jpeg >> Size: 50294 bytes >> Desc: not available >> URL: >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 31 >> ***************************************** > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: notvolumnsliced.jpg > Type: image/jpeg > Size: 28621 bytes > Desc: not available > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: subject2.jpg > Type: image/jpeg > Size: 27415 bytes > Desc: not available > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: subject2vc.jpg > Type: image/jpeg > Size: 27788 bytes > Desc: not available > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 27, Issue 32 > ***************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: beforevolumnslice.png Type: image/png Size: 73996 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aftervolumnslice.png Type: image/png Size: 63576 bytes Desc: not available URL: From ajaymaddirala at gmail.com Thu Mar 7 08:29:43 2013 From: ajaymaddirala at gmail.com (ajay maddirala) Date: Wed, 6 Mar 2013 23:29:43 -0800 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Hi, I need MEG pure data. 150 channel 147 for recording brain signals 3 channels for record environment noise. please help me thank you. On Wed, Mar 6, 2013 at 1:37 AM, Hamid Mohseni wrote: > Thanks, It works fine today, > > Regards > > > On 6 March 2013 06:37, "Jörn M. Horschig" wrote: > >> Hi Hamid, >> >> Your link works for me, and also other links on the tutorial page work >> for me. Not sure what might go wrong for you. Have you tried copy&pasting >> the link rather than clicking? I doubt the following, but maybe there is >> some firewall setting restricting access to the ftp-port for you? >> >> Best, >> Jörn >> >> >> >> On 3/5/2013 7:03 PM, Hamid Mohseni wrote: >> >> Hi, >> >> I cannot download tutorial files e.g.: >> >> ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip >> >> I tried both chrome and firefox, is there any reason? >> >> -- >> Hamid R. Mohseni, PhD >> Post-Doctoral Research Assistant >> Institute of Biomedical Engineering >> University of Oxford, OX3 7DQ, UK >> Tel: +44 (0) 1865 2 83826 >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- AJAY KUMAR.MADDIRALA, Research Scholar, Department of Electronics & Electrical Engg (EEE), Indian Institute of Technology Guwahati (IITG), Guwahati, Assam State, India. cell +918011212952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Mar 7 08:29:35 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 07 Mar 2013 08:29:35 +0100 Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well, (jan-mathijs schoffelen) In-Reply-To: <5137B6B9.5080400@gmail.com> References: <5137B6B9.5080400@gmail.com> Message-ID: <513841DF.7090701@donders.ru.nl> Hi Ye, could the problem be related to setting a wrong (or no) coordinate system? I am not an expert in anatomical preprocessing, but to me it seems that volumereslice assumes a false origin, thereby 'moving' the brain out of the picture. Also your first pictures you sent seem to me like a coordinate mismatch. Additionally, as you suggested, I think volumereslice is not necessary at all. It already looks fine beforehands and obviously, you do not specify any parameter, so why use it after all? I'd try to do it without ft_volumereslice, but check what coordinate system you are in, e.g. use ft_determine_coordsys(mri) after reading in your mri. Best, Jörn On 3/6/2013 10:35 PM, Ye Mei wrote: > Hi Jan-Mathijs, > > Thank you very much for the reply. > > I think the problem starts at "mri_sliced = ft_volumereslice([], > mri);" before using "ft_volumesegment.". > > The attached file "beforevolumnslice.png" is the result of > "imagesc(squeeze(mri.anatomy(:,111,:)))"; > The attached file "aftervolumnslice.png" is the result of > "imagesc(squeeze(mri_sliced.anatomy(:,111,:)))". > > We can see part of the head in "aftervolumnslice.png" is already > sliced away. > > Could one do source localization without using "mri_sliced = > ft_volumereslice([], mri);"? > > To circumvent the problem, I am trying to use FreeSurfer instead of > ft_volumereslice and ft_volumesegment. I had several .mgz files from > freesurfer. > Can I do the following? > -------- > mri=ft_read_mri("brain.mgz"); %brain.mgz is the segmented brain by > FreeSurfer > > cfg = []; > cfg.method ='fiducial'; > cfg.fiducial.nas = [30 132 96];% position of Nasion > cfg.fiducial.lpa = [127 113 170];% position of LPA > cfg.fiducial.rpa = [125 115 18]% position of RPA > cfg.fiducial.zpoint = [125 125 220] > [mri_aligned] = ft_volumerealign(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, mri_aligned); > ... > --------- > > thanks ahead, > Ye > > > On 13-02-28 05:10 PM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Re: NIHC-BrainGain Tutorial Day - March 21, 2013 >> (Robert Oostenveld) >> 2. Re: segmented brain seems not fitting the sensor helmet well >> (jan-mathijs schoffelen) >> 3. Re: segmented brain seems not fitting the sensor helmet well >> (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 17:46:39 +0100 >> From: Robert Oostenveld >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] NIHC-BrainGain Tutorial Day - March 21, 2013 >> Message-ID: <9741C083-F00A-4BC9-86EF-FB99715576A7 at donders.ru.nl> >> Content-Type: text/plain; charset=windows-1252 >> >> Dear FieldTrip users, >> >> The NIHC-BrainGain Tutorial Day marks the end of the BrainGain >> project. For the last 6 years, the development and continued support >> of FieldTrip for normal/offline and realtime/online analysis has >> received support from the BrainGain project. >> >> There is now more information available online on this tutorial day, >> please see >> https://www.hersenenencognitie.nl/contents/1876 >> https://www.hersenenencognitie.nl/contents/1915 >> >> If you happen to be close to Nijmegen, you might also want to come to >> the "Breinfest" on Tuesday evening 19 March in the city centre with >> talks by international speakers and BCI demo's for the general >> public. Personally, I will be demonstrating how real-time data >> streaming and processing can be done using the FieldTrip buffer to >> various platforms (OS X, WIndows, Linux), to the Raspberry Pi and >> even to an Arduino (yes, fieldtrip runs on an arduino! ... well, a >> small part of it runs on an arduino). See http://www.ru.nl/breinfest >> for details on the evening. >> >> best regards, >> Robert >> >> >> >> On 19 Feb 2013, at 14:30, Robert Oostenveld wrote: >> >>> NIHC-BrainGain Tutorial Day: >>> Tools and novelties in neurotechnology research >>> We invite PhD students, post-docs and senior researchers working >>> in the fields of brain-computer interfacing (BCI), neurofeedback, >>> cognitive neuroscience, neuroinformatics, neurosurgery and related >>> topics to our Tutorial Day on March 21st, 2013 in the Sanadome >>> Nijmegen. >>> The day marks the end of the BrainGain consortium, a six-year >>> joint-effort project on Brain-Computer Interfacing and related >>> technologies. More information on BrainGain can be found here. >>> The Tutorial Day will consist of a 'tools' track and a 'novelties? >>> track. The 'tools' track is intended to provide both newcomers to >>> the field and experienced researchers with an overview of the tools >>> needed to integrate cognitive neuroscience and advanced invasive and >>> non-invasive technology. Topics range from data streaming to >>> modelling and statistics, and from online fMRI decoding to a crash >>> course in neuroethics., You will also receive some helpful insights >>> for a future career, in case you are interested in applying for a >>> grant in the near future or considering setting up your own company. >>> The 'novelties' track covers a wide range of topics indicating some >>> of the possible topics to be further explored in BCI and >>> neurotechnology research, including genetics, robotics and >>> intracranial recordings. >>> There is no need to stick to one of the two tracks the whole day: >>> you are free to switch between tracks any time. >>> In parallel to the lectures, there will be several interesting >>> demonstrations. >>> The full programme and registration form can be found on the NIHC >>> website (https://www.hersenenencognitie.nl). Please register before >>> 1 March 2013. Participation is free. Lunch and drinks will be provided. >>> We hope to welcome you on March 21st in Nijmegen! >>> Susanna Bicknell >>> Radboud University Nijmegen >>> ____________________________________________________________________ >>> Faculty of Science | Finance and Economic Affairs | Project >>> Management | LC-IMPACT >>> Faculty of Social Sciences | Donders Centre for Cognition | >>> BRAINGAIN | Project Manager >>> T +31 24 3653300 | HG00.616 (Monday, Thursday) >>> Faculty of Science | IMAPP | T +31 24 3652972 | HG07.315 (Tuesday, >>> Wednesday) >>> Postal address: P.O. Box 9010, 6500 GL Nijmegen, The Netherlands >>> Visiting and courier service address: Heyendaalseweg 135, 6525 AJ >>> Nijmegen, The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Thu, 28 Feb 2013 18:54:14 +0100 >> From: jan-mathijs schoffelen >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Ye, >> >> Looks like a coregistration problem to me. In other words, something >> went wrong in ft_volumesegment, because the images were not >> sufficiently aligned. You need to investigate the input and output of >> ft_volumesegment. >> Do you use ft_volumerealign after calling ft_volumesegment? This >> should be the other way around. >> >> Best, >> >> Jan-Mathijs >> >> >> On Feb 28, 2013, at 5:38 PM, Ye Mei wrote: >> >>> Hello FieldtripList, >>> >>> After segmentation and alignment using >>> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >>> segmented >>> brain seems rotated forward in the sensor helmet(brain.png) and the >>> cerebellum part seems to be segmented out. However, his head MRI seems >>> fitting the sensor helmet well(head.jpg). My another subject's brain >>> seem to be correctly segmented without missing the cerebellum part. And >>> the brain is not rotated forward. >>> >>> Could might be the problem? >>> >>> thanks ahead, >>> Ye >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 3 >> Date: Thu, 28 Feb 2013 17:09:57 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512FD5B5.8080700 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello All, >> >> I found the problem I mentioned in the previous email was caused by >> using "mri_sliced = ft_volumereslice([], mri);" before using >> ft_volumesegment. >> After erasing the line "mri_sliced = ft_volumereslice([], mri);", the >> segmented brain seems to be normal and fits the sensor helmet well now, >> as show in the attached figure(notvolumnsliced.jpg). >> For another of my subject, if the "ft_volumereslice" is included, the >> brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" >> it looks normal(subject2.jpg). >> >> I notice in the fieldtrip headmodel tutorial >> (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), >> "ft_volumereslice" is not used. but in the field trip beamformer >> tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. >> >> I am wondering if I should include "ft_volumereslice" in my source >> localization code. Can anyone give me some suggestions? >> >> >> >> thanks ahead, >> Ye >> >> >> >> >> On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >>> Send fieldtrip mailing list submissions to >>> fieldtrip at science.ru.nl >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> or, via email, send a message with subject or body 'help' to >>> fieldtrip-request at science.ru.nl >>> >>> You can reach the person managing the list at >>> fieldtrip-owner at science.ru.nl >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of fieldtrip digest..." >>> >>> >>> Today's Topics: >>> >>> 1. segmented brain seems not fitting the sensor helmet well (Ye >>> Mei) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Thu, 28 Feb 2013 11:38:21 -0500 >>> From: Ye Mei >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] segmented brain seems not fitting the sensor >>> helmet well >>> Message-ID: <512F87FD.80500 at gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >>> >>> Hello FieldtripList, >>> >>> After segmentation and alignment using >>> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >>> segmented >>> brain seems rotated forward in the sensor helmet(brain.png) and the >>> cerebellum part seems to be segmented out. However, his head MRI seems >>> fitting the sensor helmet well(head.jpg). My another subject's brain >>> seem to be correctly segmented without missing the cerebellum part. And >>> the brain is not rotated forward. >>> >>> Could might be the problem? >>> >>> thanks ahead, >>> Ye >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: brain.png >>> Type: image/png >>> Size: 15197 bytes >>> Desc: not available >>> URL: >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: head.jpg >>> Type: image/jpeg >>> Size: 50294 bytes >>> Desc: not available >>> URL: >>> >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> End of fieldtrip Digest, Vol 27, Issue 31 >>> ***************************************** >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: notvolumnsliced.jpg >> Type: image/jpeg >> Size: 28621 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: subject2.jpg >> Type: image/jpeg >> Size: 27415 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: subject2vc.jpg >> Type: image/jpeg >> Size: 27788 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 32 >> ***************************************** > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at DONDERS.RU.NL Thu Mar 7 09:49:27 2013 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Thu, 7 Mar 2013 09:49:27 +0100 Subject: [FieldTrip] new set of template sourcemodels uploaded Message-ID: Dear all, I just uploaded a new set of template sourcemodels into fieldtrip/template/sourcemodel, and I removed the old ones. You can read about it here: http://fieldtrip.fcdonders.nl/template/sourcemodel This change may be of consequence for your own analyses, if you rely on these templates. This is only likely when you are using beamformers for source reconstruction, and you use sourcemodels (grids) that have been created using an inverse warp of a template sourcemodel. Essentially, the change has consequences if you use cfg.grid.warpmni = 'yes' in ft_prepare_sourcemodel. The old sourcemodels are different from the new ones, and a group analysis across subjects can obviously only be performed when the subjects have been processed all with the same template sourcemodel. Of course we recommend the new version, but if you prefer to stick to the old version, you can only recover them from older versions of FieldTrip, because we have removed them from the release version as of now (i.e. svn revision number 7600, March 7, 2013). Happy computing, Jan-Mathijs Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Mar 7 10:01:00 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 7 Mar 2013 10:01:00 +0100 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Hi Ajay, I also need pure MEG data, but typically the data I record is quite noisy ;-). Seriously, you may want to have a look here: http://cobre.mrn.org/megsim/ Please try to be a bit more specific next time when asking questions on this list. Best wishes, Jan-Mathijs On Mar 7, 2013, at 8:29 AM, ajay maddirala wrote: > Hi, I need MEG pure data. > > 150 channel > > 147 for recording brain signals > 3 channels for record environment noise. > please help me thank you. > AJAY KUMAR.MADDIRALA, > Research Scholar, > Department of Electronics & Electrical Engg (EEE), > Indian Institute of Technology Guwahati (IITG), > Guwahati, > Assam State, > India. > cell +918011212952 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Thu Mar 7 13:08:56 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Thu, 7 Mar 2013 13:08:56 +0100 Subject: [FieldTrip] auditory evoked gamma Message-ID: Hi, I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 8 02:16:32 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 7 Mar 2013 20:16:32 -0500 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: Message-ID: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Hi Nenad On 7 Mar 2013, at 7:08, Nenad Polomac wrote: > I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. best regards, Robert From smoratti at psi.ucm.es Fri Mar 8 08:51:00 2013 From: smoratti at psi.ucm.es (Stephan Moratti) Date: Fri, 8 Mar 2013 08:51:00 +0100 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Message-ID: Dear Nenad, An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). It should also work for EEG and is easy to implement. Best, Stephan El 08/03/2013, a las 02:16, Robert Oostenveld escribió: > Hi Nenad > > On 7 Mar 2013, at 7:08, Nenad Polomac wrote: >> I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. > > > Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. > > One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. > > If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. > > best regards, > Robert > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Peyman.Adjamian at ihr.mrc.ac.uk Fri Mar 8 09:47:52 2013 From: Peyman.Adjamian at ihr.mrc.ac.uk (Peyman Adjamian) Date: Fri, 8 Mar 2013 08:47:52 +0000 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: Message-ID: <82BB4DFB02A77749989A31D0F5BFA1A006AAEE0A@eir.nus.ihr.mrc.ac.uk> Dear Nenad, >From my experience, auditory gamma activity is not a robust effect, certainly not as prevalent and robust as the visual gamma activity which is best induced by high contrast stimuli at certain spatial frequencies. So whether you observe auditory gamma activity or not very much depends on your type of stimulus. Can I ask what auditory stimuli you are using to induce gamma activity? Assuming that auditory gamma activity exists at all, and given that you use the appropriate stimulus, you should see it with DICS or some other beamformer. To avoid correlated sources, you can analyse right and left channels separately perhaps. I hope this helps. Peyman ========================================================================== Dr Peyman Adjamian Investigator Scientist MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115) 922 3431 Fax: (0115) 951 8503 Email: peyman at ihr.mrc.ac.uk From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Nenad Polomac Sent: 07 March 2013 12:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] auditory evoked gamma Hi, I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eschulz at lrz.tu-muenchen.de Fri Mar 8 13:31:32 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Fri, 8 Mar 2013 13:31:32 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Message-ID: Dear Lilla and Jörn, thank you very much for your reply on my problem. I already checked the example sites but got still error messages. For creating the (leadfield) grid variable used the template files provided by Fieldtrip. vol structure: load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); I created a sensor structure based on the "standard_1020.elc" file. sens = chanpos: [65x3 double] elecpos: [65x3 double] label: {65x1 cell} type: 'ext1020' unit: 'mm' pnt: [65x3 double] I started creating the leadfiled: cfg = []; cfg.elec = sens; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; [grid65] = ft_prepare_leadfield(cfg); Finally I got the following error message. ??? Reference to non-existent field 'pnt'. Error in ==> ft_prepare_vol_sens at 301 sens.pnt = sens.pnt(selsens,:); Error in ==> prepare_headmodel at 90 [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ==> ft_prepare_leadfield at 148 [vol, sens, cfg] = prepare_headmodel(cfg, data); That error message is funny because my sens variable has a sens.pnt subnode. I (hopefully) solved the problem by editing the " ft_prepare_vol_sens"function and loading the sens variable just before the error line in the 295. It is running now but is that way correct? Any help is highly appreciated. Thank you very much. Best, Enrico On 5 March 2013 12:08, wrote: > Dear Enrico, > > I think more information is needed about the error messages and about how > you try to compute leadfield in order to help. > > If you have not encountered the FT tutorial sites, example scripts and > FAQs yet, maybe you can check out those as well because they provide > information on source-reconstruction, leadfields... etc.. > (For example, a tutorial for EEG headmodels: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example script > for leadfield computation: > http://fieldtrip.fcdonders.nl/example/compute_leadfield). > > Best, > Lilla > > > > Dear Fieldtrip experts, > > > > I would like to create a leadfield based on the standard brain provided > by > > the fieldtrip package and standard electrode positions. > > Unfortunately, whatever I'm trying it ends up in a number of error > > messages. > > > > Is anybody out there who could provide some support? > > > > Thank you very much in advance, > > Best, > > Enrico > > > > > > -- > > Dr. Enrico Schulz > > Postdoc > > Klinikum rechts der Isar der Technischen Universität München > > Neurologische Klinik und Poliklinik > > Neuro-Kopf-Zentrum > > Ismaningerstr. 22 > > 81675 München > > > > Tel.: 089-4140-7664 > > _______________________________________________ > > 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 > -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Mar 8 15:52:27 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 08 Mar 2013 15:52:27 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Message-ID: <5139FB2A.50300@donders.ru.nl> Dear Enrico, the error you are describing is clearly from a rather old version of FieldTrip, because sens.pnt is deprecated. Could you make sure that you are using the newest FieldTrip version? Since you load from c:\...\fieldtrip-20130307\... I assume that you downloaded the newest version already. It might be that either you have not updated your startup script in adding the correct FieldTrip version or that you are adding both, an old and a new FieldTrip version to your Matlab path. You could check in Matlab what function is being used by typing: / which ft_prepare_vol_sens/ If you want to add only the newest FieldTrip and remove the old one, you can call///restoredefaultpath/ in Matlab. The add c:\MATLAB\R2009b\work\fieldtrip-20130307\ to your path and call /ft_def//aults/. That should solve the issue. Note that your Matlab is _definitely_ calling an old FT version, because the line tyour error comes from does not exist anymore (i.e. it has been rewritten, because sens.pnt is deprecated) Hope it works out for you! Best, Jörn. On 3/8/2013 1:31 PM, Enrico Schulz wrote: > Dear Lilla and Jörn, > > thank you very much for your reply on my problem. > I already checked the example sites but got still error messages. > > For creating the (leadfield) grid variable used the template files > provided by Fieldtrip. > vol structure: > load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); > > I created a sensorstructure based on the "standard_1020.elc" file. > > sens = > > chanpos: [65x3 double] > elecpos: [65x3 double] > label: {65x1 cell} > type: 'ext1020' > unit: 'mm' > pnt: [65x3 double] > > I started creating the leadfiled: > cfg = []; > cfg.elec = sens; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid65] = ft_prepare_leadfield(cfg); > > > Finally I got the following error message. > ??? Reference to non-existent field 'pnt'. > > Error in ==> ft_prepare_vol_sens at 301 > sens.pnt = sens.pnt(selsens,:); > > Error in ==> prepare_headmodel at 90 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order', > cfg.order); > > Error in ==> ft_prepare_leadfield at 148 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > That error message is funny because my sens variable has a sens.pnt > subnode. > > I (hopefully) solved the problem by editing the "ft_prepare_vol_sens" > function and loading the sens variable just before the error line in > the 295. It is running now but is that way correct? > > Any help is highly appreciated. > Thank you very much. > Best, > Enrico > > > On 5 March 2013 12:08, > wrote: > > Dear Enrico, > > I think more information is needed about the error messages and > about how > you try to compute leadfield in order to help. > > If you have not encountered the FT tutorial sites, example scripts and > FAQs yet, maybe you can check out those as well because they provide > information on source-reconstruction, leadfields... etc.. > (For example, a tutorial for EEG headmodels: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an > example script > for leadfield computation: > http://fieldtrip.fcdonders.nl/example/compute_leadfield). > > Best, > Lilla > > > > Dear Fieldtrip experts, > > > > I would like to create a leadfield based on the standard brain > provided by > > the fieldtrip package and standard electrode positions. > > Unfortunately, whatever I'm trying it ends up in a number of error > > messages. > > > > Is anybody out there who could provide some support? > > > > Thank you very much in advance, > > Best, > > Enrico > > > > > > -- > > Dr. Enrico Schulz > > Postdoc > > Klinikum rechts der Isar der Technischen Universität München > > Neurologische Klinik und Poliklinik > > Neuro-Kopf-Zentrum > > Ismaningerstr. 22 > > 81675 München > > > > Tel.: 089-4140-7664 > > _______________________________________________ > > 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 > > > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mushfa.yousuf at googlemail.com Fri Mar 8 16:12:52 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Fri, 8 Mar 2013 16:12:52 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> Message-ID: Hello; I have few problems while calculating combine “MEG & EEG” source reconstruction and I need your help to troubleshoot the problems. I have a data from a Parkinson’s disease patient who underwent DBS and we recorded 306 MEG channels and 64 EEG channels simultaneously, first I have calculated the leadfield individually for both EEG and MEG. I have defined all the calculations step by step so that I can describe my problems very precisely. *CALCULATE THE LEADFIELD FOR MEG CHANNELS:-* // I have defined the Pre-Stimulus data i.e. Stim-off data in the original code. *Reading raw data set for MEG channels* * * cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'MEG'}; *// In order to read raw data only for MEG channels* dataFIC12 = ft_preprocessing(cfg); After that I have defined the *time of window of interest* for the MEG raw data set cfg.toilim = [0 0.5]; dataPost = ft_redefinetrial(cfg, dataFIC12); and calculate the *Power Spectral density matrix* for the MEG channels data set cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the stimulation frequency cfg.pad = 1; freqPost = ft_freqanalysis(cfg, dataPost); Now next step for me is to choose the method for the Head Model. I have noticed that Singlesphere is the common method which can be used for both EEG and MEG. So I have selected the singlesphere method for the calculation of volume conduction model. mri = ft_read_mri(‘ms1879865-0004-00001-000192-01.img'); // READ MRI cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the segmented mri cfg = []; cfg.method = 'singlesphere'; // *METHOD* vol1 = ft_prepare_headmodel(cfg, segmentedmri1); Now next step is to calculate the LEADFIELD cfg = []; cfg.grad = freqPost.grad; cfg.vol = vol1; cfg.reducerank = 2; // MEG cfg.channel = {'MEG'}; cfg.grid.resolution = 1; // I choose a resolution 1 [grid1] = ft_prepare_leadfield(cfg); *disp(grid1)* * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* * dim: [15 16 16]* * pos: [3840x3 double]* * unit: 'cm'* * inside: [1x2037 double]* * outside: [1x1803 double]* * cfg: [1x1 struct]* * leadfield: {1x3840 cell}* * * * * Ø It has to be noticed that Inside Dipole is 2037. * * *CALCULATE THE LEADFIELD FOR EEG CHANNELS:-* *Reading raw data set for EEG channels* * * cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'EEG'}; *// In order to read raw data only for EEG channels* dataFIC12 = ft_preprocessing(cfg); After that I have defined the *time of window of interest* for the EEG raw data set cfg.toilim = [0 0.5]; dataPost = ft_redefinetrial(cfg, dataFIC12); and calculate the *Power Spectral density matrix* for the EEG channels data set cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [129 129]; // Frequency of interest is 129 Hz cfg.pad = 1; freqPost = ft_freqanalysis(cfg, dataPost); *HEAD MODEL FOR EEG* mri = ft_read_mri(‘ms1879865-0004-00001-000192-01.img'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri2 = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singlesphere'; // METHOD vol2 = ft_prepare_headmodel(cfg, segmentedmri2); *LEADFIELD:*** cfg = []; cfg.elec = freqPost.elec; cfg.vol = vol2; cfg.reducerank = 3; % 3 for EEG cfg.channel = {'EEG'}; cfg.grid.resolution = 9.54; // Increase the resolution so that the inside dipoles for EEG should be close to the inside dipoles of MEG [grid2] = ft_prepare_leadfield(cfg); *disp(grid2)* * xgrid: [1x16 double]* * ygrid: [1x16 double]* * zgrid: [1x13 double]* * dim: [16 16 13]* * pos: [3328x3 double]* * unit: 'mm'* * inside: [1x2038 double]* * outside: [1x1290 double]* * cfg: [1x1 struct]* * leadfield: {1x3328 cell}* Ø It has to be noticed that Inside Dipole is 2038. *Concatenate of MEG and EEG LEADFIELD:-* Now I have the individual LEADFIELD of both MEG and EEG grid1 and grid2 respectively. *disp(grid1)* * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* * dim: [15 16 16]* * pos: [3840x3 double]* * unit: 'cm'* * inside: [1x2037 double]* * outside: [1x1803 double]* * cfg: [1x1 struct]* * leadfield: {1x3840 cell}* * * *disp(grid2)* * xgrid: [1x16 double]* * ygrid: [1x16 double]* * zgrid: [1x13 double]* * dim: [16 16 13]* * pos: [3328x3 double]* * unit: 'mm'* * inside: [1x2038 double]* * outside: [1x1290 double]* * cfg: [1x1 struct]* * leadfield: {1x3328 cell}* * * *Few things to be noticed here * * * Ø *unit is different for both MEG ‘cm’ and EEG ‘mm’* Ø *I have used the same method for calculating the Volume for both MEG & EEG => “Singlesphere” * Ø *Concatenating the “pos” vector of EEG and MEG and the other vectors* * * *Grid.pos = cat(1,grid1.pos,grid2.pos);* *Grid.xgrid = [grid1.xgrid grid2.xgrid];* *Grid.ygrid = [grid1.ygrid grid2.ygrid];* *Grid.zgrid = [grid1.zgrid grid2.zgrid];* *Grid.inside = [grid1.inside grid2.inside];* *Grid.outside = [grid1.outside grid2.outside];* *Grid.leadfield = [grid1.leadfield grid2.leadfield];* *Grid.dim = [grid1.dim grid2.dim];* * * *Combined Source Reconstruction:-* cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'MEG',’EEG’}; *// In order to read raw data for MEG & EEG channels* dataFIC12 = ft_preprocessing(cfg); After that as previously defined, I have calculated the Spectral density. Now I have to calculate the inverse solution for both EEG & MEG data trials. *Source Analysis: without contrasting condition:-* * * cfg = []; cfg.method = 'dics'; cfg.frequency = 129; cfg.grid = Grid; // Concatenated grid cfg.vol = vol1; // As vol1 = vol2 : both singlesphere cfg.powmethod = 'trace'; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0.0001; sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost contains both MEG * * and EEG row data* * *** I have received the following error: scanning grid 2037/4075 ??? Error using ==> svd Input to SVD must not contain NaN or Inf. Error in ==> beamformer_dics>pinv at 568 [U,S,V] = svd(A,0); Error in ==> beamformer_dics at 314 filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ==> ft_sourceanalysis at 595 dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), optarg{:}); Error in ==> code at 227 sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); Ø If you notice that till 2037 grid it represents the MEG grid and after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which also represent inside dipole). Ø Secondly I try to use other method for the head modeling i.e openmeeg, dipoli and bemcp method which leads me to different errors which I was unable to trouble shoot. · Openmeeg = OpenMEEG binaries are not correctly installed · Dipoli = vol.mat file was missing after calculating the headmodel · Bemcp = vol.mat file contains NaN fiels which leads to wrong leadfield computation. *I apologize for the long email. I wanted to show the steps which I used so that it is easier to debug the problem.* * * Thank you; Mushfa Yousuf On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Dear Mushfa > > In principle it can be made to work, but you'll have to do a little bit of > work outside fieldtrip. You would start with > 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part > 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part > Subsequently you would (manually) concatenate the leadfields of the MEG > and EEG. Here you have to make sure that the channel order is consistent > with that in your combined data. > The resulting structure with combined leadfields can be passed into > ft_sourceanalysis as cfg.grid. > > However, I foresee a problem with the scaling. At this moment FieldTrip is > not (yet) very precise in maintaining the correct units throughout. > Consequently you might get different units for the EEG and MEG contribution > to each dipole, causing weird cancelation effects. You'll just have to > check carefully that the leadfield units and the data units consistently > scaled between megmag, megplanar and eeg. > > This brings me to another known problem for the combined vectorview > magnetometer and planar gradiometer channels: at this moment the forward > computation computes both in T (or fT), whereas the data is represented as > T for the magnetometers and T/m for the gradiometers. So the gradiometer > leadfields are off by a factor "1/baseline", which is approximately 1/70 if > I recall correctly. Many neuromag users use only the planar channels, and > therefore don't notice. We are working on fixing the neuromag > channel/gradiometer units. That is not as simple as it appears, because > conversions of the geometrical dimensions from m to cm or mm also affect > the gradiometer baseline. So converting the data from m to mm should result > in the planar channel data getting 1000 times smaller, whereas the > magnetometer channels shoudl stay the same. See > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 and > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want to follow > this. > > best regards > Robert > > > > On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: > > Hello Fieldtrippers, > > I am currently doing source analysis using beamformer method in fieldtrip. > > The data i work on is a simultaneous measurement of MEG (306) with EEG > (128) on PD patients. > > I was successful in calculating the sources for both the modalities alone. > > I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation > > of the lead field. But, then when i want to use the created vol for the > source analysis i have two structures one for EEG and the second one for > MEG. Now, i can only define only one to estimate the sources. How to use > > this for both the modalities? Any help would be appreciated. > > With regards > Mushfa > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Fri Mar 8 17:48:00 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Fri, 8 Mar 2013 09:48:00 -0700 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Message-ID: <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> Dear Stephan, If I may ask, have you implemented this approach successfully in Fieldtrip? I agree that it can work well for auditory gamma, but have only done this in BESA. The minimumnormestimate.m function in FT is a time domain only technique as far as I know. If you have done this in Fieldtrip and can provide some guidance, I would very much appreciate the pointers. Best, Don On Mar 8, 2013, at 12:51 AM, Stephan Moratti wrote: Dear Nenad, An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). It should also work for EEG and is easy to implement. Best, Stephan El 08/03/2013, a las 02:16, Robert Oostenveld > escribió: Hi Nenad On 7 Mar 2013, at 7:08, Nenad Polomac wrote: I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. best regards, Robert _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Sat Mar 9 02:11:11 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Sat, 9 Mar 2013 02:11:11 +0100 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> Message-ID: Dear Don, I have done it using Brainstorm (sorry Fieldtrippers) as in Brainstorm minimum norm in the frequency domain is implemented. But as the minimum norm estimate (MNE) is applied to each time point I guess the following approach should easily work: Estimate your gamma response with ft_frequanalysis and ask for the fourier components instead of power. Create a data structure that you normally feed into the minimum norm algorithm with source analysis. The data structure has two time points. Copy the real and imaginary part into the two time points each. Run the minimum norm estimate on that data structure (I guess you will have to estimate some noise covariance matrix from a baseline or so before). Then, take the modulus of the minimum norm estimates across the two "time points" (that include the inverse real and imaginary part). I have never tried it with field trip and the approach above is just an idea. I am happy of any feedback if it works or if there is a more elegant solution. Sorry that I don't have a "fixed" solution. I will try it myself. I hope I could help. Best, Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 08/03/2013, a las 17:48, Rojas, Don escribió: > Dear Stephan, > > If I may ask, have you implemented this approach successfully in Fieldtrip? I agree that it can work well for auditory gamma, but have only done this in BESA. The minimumnormestimate.m function in FT is a time domain only technique as far as I know. If you have done this in Fieldtrip and can provide some guidance, I would very much appreciate the pointers. > > Best, > > Don > > On Mar 8, 2013, at 12:51 AM, Stephan Moratti wrote: > >> Dear Nenad, >> >> An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: >> >> 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). >> >> It should also work for EEG and is easy to implement. >> >> Best, >> >> Stephan >> >> El 08/03/2013, a las 02:16, Robert Oostenveld escribió: >> >>> Hi Nenad >>> >>> On 7 Mar 2013, at 7:08, Nenad Polomac wrote: >>>> I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. >>> >>> >>> Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. >>> >>> One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. >>> >>> If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. >>> >>> best regards, >>> Robert >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> ________________________________________________________ >> Stephan Moratti, PhD >> >> see also: http://web.me.com/smoratti/ >> >> Universidad Complutense de Madrid >> Facultad de Psicología >> Departamento de Psicología Básica I >> Campus de Somosaguas >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> and >> >> Center for Biomedical Technology >> Laboratory for Cognitive and Computational Neuroscience >> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >> Campus Montegancedo >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> >> email: smoratti at psi.ucm.es >> Tel.: +34 679219982 >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Mar 9 02:56:44 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 9 Mar 2013 01:56:44 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? Message-ID: Hi Fieldtrip list, Firstly I'd like to thank those who have asked questions using ICA on neuromag 306 data and the answers given. It's been extremely informative and taught me a lot about the general principles of ICA (it's no longer completely black magic, only partially...). I have two and a bit questions about using ICA on neuromag data, the first on the full rank assumption. After maxfiltering, the output data is rank deficient due to removal of the b-out components. I see that fastica is able to detect this and makes adjustments to the amounts of components extracted accordingly, but is doing this justified? What actually happens to the data if ICA is applied to a rank deficient data set? Are there any papers that examine this? Secondly, I've been including all the meg channels (mags + grads) when running ICA (due to my interpretation of the conversation in http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) then examining the time series components for those related to artifact (specifically ECG and EOG), while using a magnetometer only layout to view component topographies as a backup. My question (well, really a confirmation) is, by removing the artifact components calculated using the mixed sensors, does this remove the associated components from all the sensor types? Viewing pre and post ICA data appears to confirm this, but expert opinion is always good. The bit of a question is - is it acceptable to use a magnetometer only layout to interpret topoplots of the components if the components are based on mixed sensors? I've been using it because the readily identifiable artifact components have a distribution I'd expect from ECG and EOG as does the associated time series but I'm wanting to make sure. Also, if this is the wrong forum to ask these questions can someone suggest one that might be a better fit? Thanks again, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 9 12:12:04 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 9 Mar 2013 11:12:04 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> Message-ID: Hi Peter, Regarding your first question: after maxfilter, you need to do a pca, simply because your rank of data has been reduced from 306 to about 64. You can do this by: cfg = []; cfg.method = 'runica'; n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); cfg.runica.pca = n_comp; cfg.runica.stop = 1e-7; comp = ft_componentanalysis(cfg, data); Here, n_comp is the number of component and it is equal to the rank of data set. If you don't do this, the algorithm takes a long time and normally does not converge. Note that the data should be continuous and it is highly recommended to remove big and jump artefacts before ICA (for example using ft_databrowser). I found ICA using infomax 'runica' quite robust with high accuracy fro removing EOG and ECG. Regarding your second question: Using only 'MAG' to investigate the topograph of component is fine, and better than 'GRAD', but have a look at the components time-series as well. If you remove that component it will be removed from the whole data set. On 9 March 2013 01:56, Peter Goodin wrote: > Hi Fieldtrip list, > > Firstly I'd like to thank those who have asked questions using ICA on > neuromag 306 data and the answers given. It's been extremely informative > and taught me a lot about the general principles of ICA (it's no longer > completely black magic, only partially...). > > I have two and a bit questions about using ICA on neuromag data, the first > on the full rank assumption. After maxfiltering, the output data is rank > deficient due to removal of the b-out components. I see that fastica is > able to detect this and makes adjustments to the amounts of components > extracted accordingly, but is doing this justified? What actually happens > to the data if ICA is applied to a rank deficient data set? Are there any > papers that examine this? > > Secondly, I've been including all the meg channels (mags + grads) when > running ICA (due to my interpretation of the conversation in > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) > then examining the time series components for those related to artifact > (specifically ECG and EOG), while using a magnetometer only layout to view > component topographies as a backup. My question (well, really a > confirmation) is, by removing the artifact components calculated using the > mixed sensors, does this remove the associated components from all the > sensor types? Viewing pre and post ICA data appears to confirm this, but > expert opinion is always good. The bit of a question is - is it acceptable > to use a magnetometer only layout to interpret topoplots of the components > if the components are based on mixed sensors? I've been using it because > the readily identifiable artifact components have a distribution I'd expect > from ECG and EOG as does the associated time series but I'm wanting to make > sure. > > Also, if this is the wrong forum to ask these questions can someone > suggest one that might be a better fit? > > Thanks again, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Mar 9 13:13:57 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 9 Mar 2013 12:13:57 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk>, Message-ID: Hi Hamid, Thanks very much for the response. I'm concerned to do PCA on my dataset due to a recent conversation on the EEGlab mailing list where Arnaud Delorme states that PCA prior to ICA may create artifacts in the data (he does say that this occurs especially in frequency space, but doesn't discount problems in the time series). I'm using fastica to decompose my data as this appears to take into account the rank deficiency (especially when using tsss) through examination of data specific co-variance matrices, but thank you for the the script to use the runICA algorithm. If I have the time (and patience) I might do a quick exploration of PCA and runICA vs. fastICA. Additionally, thank you for confirmation regarding using the mags to examine components. I agree, far better than attempting to decipher the grads topoplots... Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, 9 March 2013 10:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? Hi Peter, Regarding your first question: after maxfilter, you need to do a pca, simply because your rank of data has been reduced from 306 to about 64. You can do this by: cfg = []; cfg.method = 'runica'; n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); cfg.runica.pca = n_comp; cfg.runica.stop = 1e-7; comp = ft_componentanalysis(cfg, data); Here, n_comp is the number of component and it is equal to the rank of data set. If you don't do this, the algorithm takes a long time and normally does not converge. Note that the data should be continuous and it is highly recommended to remove big and jump artefacts before ICA (for example using ft_databrowser). I found ICA using infomax 'runica' quite robust with high accuracy fro removing EOG and ECG. Regarding your second question: Using only 'MAG' to investigate the topograph of component is fine, and better than 'GRAD', but have a look at the components time-series as well. If you remove that component it will be removed from the whole data set. On 9 March 2013 01:56, Peter Goodin > wrote: Hi Fieldtrip list, Firstly I'd like to thank those who have asked questions using ICA on neuromag 306 data and the answers given. It's been extremely informative and taught me a lot about the general principles of ICA (it's no longer completely black magic, only partially...). I have two and a bit questions about using ICA on neuromag data, the first on the full rank assumption. After maxfiltering, the output data is rank deficient due to removal of the b-out components. I see that fastica is able to detect this and makes adjustments to the amounts of components extracted accordingly, but is doing this justified? What actually happens to the data if ICA is applied to a rank deficient data set? Are there any papers that examine this? Secondly, I've been including all the meg channels (mags + grads) when running ICA (due to my interpretation of the conversation in http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) then examining the time series components for those related to artifact (specifically ECG and EOG), while using a magnetometer only layout to view component topographies as a backup. My question (well, really a confirmation) is, by removing the artifact components calculated using the mixed sensors, does this remove the associated components from all the sensor types? Viewing pre and post ICA data appears to confirm this, but expert opinion is always good. The bit of a question is - is it acceptable to use a magnetometer only layout to interpret topoplots of the components if the components are based on mixed sensors? I've been using it because the readily identifiable artifact components have a distribution I'd expect from ECG and EOG as does the associated time series but I'm wanting to make sure. Also, if this is the wrong forum to ask these questions can someone suggest one that might be a better fit? Thanks again, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 9 13:29:44 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 9 Mar 2013 12:29:44 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: <6c0212a7-8817-4c48-9a03-d0ab7f132243@HUB04.ad.oak.ox.ac.uk> References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> <6c0212a7-8817-4c48-9a03-d0ab7f132243@HUB04.ad.oak.ox.ac.uk> Message-ID: I'm concerned to do PCA on my dataset due to a recent conversation on the EEGlab mailing list .... This is good to know, but in our case we don't reduce the rank of data set and we don't remove any information using PCA dimension reduction. So I think it should be fine. On 9 March 2013 12:13, Peter Goodin wrote: > Hi Hamid, > > Thanks very much for the response. > > I'm concerned to do PCA on my dataset due to a recent conversation on > the EEGlab mailing list where Arnaud Delorme states that PCA prior to ICA > may create artifacts in the data (he does say that this occurs especially > in frequency space, but doesn't discount problems in the time series). > > I'm using fastica to decompose my data as this appears to take into > account the rank deficiency (especially when using tsss) through > examination of data specific co-variance matrices, but thank you for the > the script to use the runICA algorithm. If I have the time (and patience) I > might do a quick exploration of PCA and runICA vs. fastICA. > > Additionally, thank you for confirmation regarding using the mags to > examine components. I agree, far better than attempting to decipher the > grads topoplots... > > Peter. > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > *Sent:* Saturday, 9 March 2013 10:12 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] ICA on neuromag data - invalid assumption of > full rank data & mixed sensors? > > Hi Peter, > > Regarding your first question: after maxfilter, you need to do a pca, > simply because your rank of data has been reduced from 306 to about 64. You > can do this by: > > cfg = []; > cfg.method = 'runica'; > n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); > cfg.runica.pca = n_comp; > cfg.runica.stop = 1e-7; > comp = ft_componentanalysis(cfg, data); > > Here, n_comp is the number of component and it is equal to the rank of > data set. If you don't do this, the algorithm takes a long time and > normally does not converge. Note that the data should be continuous and it > is highly recommended to remove big and jump artefacts before ICA (for > example using ft_databrowser). I found ICA using infomax 'runica' quite > robust with high accuracy fro removing EOG and ECG. > > > Regarding your second question: Using only 'MAG' to investigate the > topograph of component is fine, and better than 'GRAD', but have a look at > the components time-series as well. If you remove that component it will be > removed from the whole data set. > > > > > On 9 March 2013 01:56, Peter Goodin wrote: > >> Hi Fieldtrip list, >> >> Firstly I'd like to thank those who have asked questions using ICA on >> neuromag 306 data and the answers given. It's been extremely informative >> and taught me a lot about the general principles of ICA (it's no longer >> completely black magic, only partially...). >> >> I have two and a bit questions about using ICA on neuromag data, the >> first on the full rank assumption. After maxfiltering, the output data is >> rank deficient due to removal of the b-out components. I see that fastica >> is able to detect this and makes adjustments to the amounts of components >> extracted accordingly, but is doing this justified? What actually happens >> to the data if ICA is applied to a rank deficient data set? Are there any >> papers that examine this? >> >> Secondly, I've been including all the meg channels (mags + grads) when >> running ICA (due to my interpretation of the conversation in >> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) >> then examining the time series components for those related to artifact >> (specifically ECG and EOG), while using a magnetometer only layout to view >> component topographies as a backup. My question (well, really a >> confirmation) is, by removing the artifact components calculated using the >> mixed sensors, does this remove the associated components from all the >> sensor types? Viewing pre and post ICA data appears to confirm this, but >> expert opinion is always good. The bit of a question is - is it acceptable >> to use a magnetometer only layout to interpret topoplots of the components >> if the components are based on mixed sensors? I've been using it because >> the readily identifiable artifact components have a distribution I'd expect >> from ECG and EOG as does the associated time series but I'm wanting to make >> sure. >> >> Also, if this is the wrong forum to ask these questions can someone >> suggest one that might be a better fit? >> >> Thanks again, >> >> Peter. >> >> __________________________ >> Peter Goodin, >> BSc (Hons), Ph.D Candidate. >> >> Brain and Psychological Sciences Research Centre (BPsych) >> Swinburne University, >> Hawthorn, Vic, 3122 >> >> Monash Alfred Psychiatry Research Centre (MAPrc) >> Level 1, Old Baker Building >> Commercial Road >> Melbourne, Vic, 3004 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallisgj at gmail.com Sat Mar 9 15:34:00 2013 From: wallisgj at gmail.com (George Wallis) Date: Sat, 09 Mar 2013 14:34:00 +0000 Subject: [FieldTrip] Trialwise log of TF transform before condition averaging? Message-ID: <513B4858.9090007@gmail.com> Dear fieldtrip experts When computing condition averages of TF transformed data, I take the log of the trialwise data before averaging over the trials for a given condition. As I was taking the log of the trialwise data for trialwise analyses, this seemed the most consistent approach. However, I notice it isn't implemented in fieldtrip (it requires a tweak of the ft_freqanalysis function), and the tf averages tend to look noisier this way than if they are averaged before taking the log. Does anyone have any insight into whether this is a sensible way to generate condition averages? I originally thought this would reduce the influence of outlier trials - but since it is equivalent to taking the log of the product of all the trials within a condition, perhaps it is going to do the opposite? George From eschulz at lrz.tu-muenchen.de Sat Mar 9 19:55:54 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Sat, 9 Mar 2013 19:55:54 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: <5139FB2A.50300@donders.ru.nl> References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> <5139FB2A.50300@donders.ru.nl> Message-ID: Dear Jörn, thank you very much for your support. You were right. Matlab called an old version of the function which came from the EEGlab external folder. After deleting SPM and EEGlab from pathdef, it is running now without code editing and error messages. Best, Enrico On 8 March 2013 15:52, "Jörn M. Horschig" wrote: > Dear Enrico, > > the error you are describing is clearly from a rather old version of > FieldTrip, because sens.pnt is deprecated. Could you make sure that you are > using the newest FieldTrip version? Since you load from > c:\...\fieldtrip-20130307\... I assume that you downloaded the newest > version already. It might be that either you have not updated your startup > script in adding the correct FieldTrip version or that you are adding both, > an old and a new FieldTrip version to your Matlab path. You could check in > Matlab what function is being used by typing: > * > which ft_prepare_vol_sens* > > If you want to add only the newest FieldTrip and remove the old one, you > can call* **restoredefaultpath* in Matlab. The add c:\MATLAB\R2009b\work\fieldtrip-20130307\ > to your path and call *ft_def**aults*. That should solve the issue. Note > that your Matlab is *definitely* calling an old FT version, because the > line tyour error comes from does not exist anymore (i.e. it has been > rewritten, because sens.pnt is deprecated) > > Hope it works out for you! Best, > Jörn. > > > > On 3/8/2013 1:31 PM, Enrico Schulz wrote: > > Dear Lilla and Jörn, > > thank you very much for your reply on my problem. > I already checked the example sites but got still error messages. > > For creating the (leadfield) grid variable used the template files > provided by Fieldtrip. > vol structure: > > load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); > > I created a sensor structure based on the "standard_1020.elc" file. > > sens = > > chanpos: [65x3 double] > elecpos: [65x3 double] > label: {65x1 cell} > type: 'ext1020' > unit: 'mm' > pnt: [65x3 double] > > I started creating the leadfiled: > cfg = []; > cfg.elec = sens; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid65] = ft_prepare_leadfield(cfg); > > > Finally I got the following error message. > ??? Reference to non-existent field 'pnt'. > > Error in ==> ft_prepare_vol_sens at 301 > sens.pnt = sens.pnt(selsens,:); > > Error in ==> prepare_headmodel at 90 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order', > cfg.order); > > Error in ==> ft_prepare_leadfield at 148 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > That error message is funny because my sens variable has a sens.pnt subno > de. > > I (hopefully) solved the problem by editing the " ft_prepare_vol_sens"function and loading the sens > variable just before the error line in the 295. It is running now but is that > way correct? > > Any help is highly appreciated. > Thank you very much. > Best, > Enrico > > > On 5 March 2013 12:08, wrote: > >> Dear Enrico, >> >> I think more information is needed about the error messages and about how >> you try to compute leadfield in order to help. >> >> If you have not encountered the FT tutorial sites, example scripts and >> FAQs yet, maybe you can check out those as well because they provide >> information on source-reconstruction, leadfields... etc.. >> (For example, a tutorial for EEG headmodels: >> http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example >> script >> for leadfield computation: >> http://fieldtrip.fcdonders.nl/example/compute_leadfield). >> >> Best, >> Lilla >> >> >> > Dear Fieldtrip experts, >> > >> > I would like to create a leadfield based on the standard brain provided >> by >> > the fieldtrip package and standard electrode positions. >> > Unfortunately, whatever I'm trying it ends up in a number of error >> > messages. >> > >> > Is anybody out there who could provide some support? >> > >> > Thank you very much in advance, >> > Best, >> > Enrico >> > >> > >> > -- >> > Dr. Enrico Schulz >> > Postdoc >> > Klinikum rechts der Isar der Technischen Universität München >> > Neurologische Klinik und Poliklinik >> > Neuro-Kopf-Zentrum >> > Ismaningerstr. 22 >> > 81675 München >> > >> > Tel.: 089-4140-7664 >> > _______________________________________________ >> > 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 >> > > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sun Mar 10 02:38:44 2013 From: russgport at gmail.com (Russell G Port) Date: Sat, 9 Mar 2013 19:38:44 -0600 Subject: [FieldTrip] source interpolate - tmp = interpmat*tmp; inner matrix must agree Message-ID: Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: *People can skip the first part of code, I included it as possibly useful information for this plead * %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); *Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition* %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; *Heres where it falls apart, because I try to source interpolate* %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with the current problem * cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos *(position of the leadfield locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), 'sphereradius', cfg.sphereradius) (0.*05*); what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata*. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Sun Mar 10 13:34:23 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Sun, 10 Mar 2013 13:34:23 +0100 Subject: [FieldTrip] auditory evoked gamma Message-ID: Dear all, Thank you very much for thorough discussion! I will try to figure out something! All the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Sun Mar 10 18:22:54 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Sun, 10 Mar 2013 18:22:54 +0100 Subject: [FieldTrip] problem with MEG leadfield Message-ID: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> Hi everybody I'm trying to generate a field for a simulated dipole using the command ft_dipolesimulation, for a MEG study. I do the following: -read the hdr -import the sensor structure with the following lines grad=hdr.grad; radius = sqrt(sum(grad.chanpos.^2,2)); grad.chanpos = grad.chanpos./ [radius radius radius]; grad.label=hdr.label(1:306)'; -then I create the vol structure using the following code vol = []; vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 cm vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; At this point I have the grad structure, and the vol structure. Then I give all the options for the dipole simulation with the code %% create a dipole simulation with a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.grad = grad; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; cfg.dip.frequency = 10; %Hz cfg.ntrials = 10; cfg.triallength = 20; % seconds cfg.fsample = 250; % Hz but when I try to esecute the line raw1 = ft_dipolesimulation(cfg); I find this error ??? Error using ==> ft_compute_leadfield at 301 unsupported volume conductor model for MEG Error in ==> ft_dipolesimulation at 198 lf = ft_compute_leadfield(dippos{trial}, sens, vol); I really cannot understand why volume conductor model is not supported. Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not able to see it. Thank you! Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3491530515 tel +39 0818675361 fax +39 0818675128 "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From hamid.mohseni at eng.ox.ac.uk Sun Mar 10 19:32:25 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sun, 10 Mar 2013 18:32:25 +0000 Subject: [FieldTrip] Trialwise log of TF transform before condition averaging? In-Reply-To: References: Message-ID: Hi George, You are right, getting logarithm of the trials and then average is equivalent to the multiplying trials and then getting log. It remains that whether summing or multiplying trials can reduce the outliers. I therefore really doubt this way of analysis can remove or suppress the outliers. Thanks On 9 March 2013 14:34, George Wallis wrote: > Dear fieldtrip experts > > When computing condition averages of TF transformed data, I take the log > of the trialwise data before averaging over the trials for a given > condition. As I was taking the log of the trialwise data for trialwise > analyses, this seemed the most consistent approach. However, I notice it > isn't implemented in fieldtrip (it requires a tweak of the ft_freqanalysis > function), and the tf averages tend to look noisier this way than if they > are averaged before taking the log. > > Does anyone have any insight into whether this is a sensible way to > generate condition averages? I originally thought this would reduce the > influence of outlier trials - but since it is equivalent to taking the log > of the product of all the trials within a condition, perhaps it is going to > do the opposite? > > George > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 11 03:09:59 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 11 Mar 2013 10:09:59 +0800 Subject: [FieldTrip] creating leadfiled Message-ID: Dear Fieldtrip experts, I would like to create a leadfield based on the standard brain provided by the fieldtrip package and standard electrode positions. I do it like this : load standard_singleshell % from template\headmodel cfg = []; cfg.elec = sens;% also from template cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; [grid] = ft_prepare_leadfield(cfg); Finally I got the following error message. converting units from 'mm' to 'cm' ??? Error using ==> ft_prepare_vol_sens at 495 unsupported volume conductor model for EEG Error in ==> prepare_headmodel at 84 [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ==> ft_prepare_leadfield at 147 [vol, sens, cfg] = prepare_headmodel(cfg, data); but when I use 'standard_bem' (from template )is OK . Is anybody out there who could provide some support? Thank you very much in advance, Best, mengtongxiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 11 08:45:48 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 11 Mar 2013 15:45:48 +0800 Subject: [FieldTrip] Calculating the cross spectral density matrix Message-ID: Dear all: I calculate the cross spectral density matrix and my data from rest. I want do beta-band activity(14-30Hz).so I use a center frequency of about 22 Hz.we select a time window of 0.5s.I do this as follow: cfg = []; cfg.toilim = [0.5 1]; dataP = ft_redefinetrial(cfg, data_org); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 8; cfg.foilim = [22 22]; freqP = ft_freqanalysis(cfg, dataP); And i got this wrong message ??? Error using ==> dpss at 45 Time-bandwidth product NW must be less than N/2. Error in ==> ft_specest_mtmfft>double_dpss at 303 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_specest_mtmfft at 115 tap = double_dpss(ndatsample,ndatsample*(tapsmofrq./fsample))'; Error in ==> ft_freqanalysis at 526 [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt); thanks for your attention. best, mengtongxiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 11 09:47:24 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 11 Mar 2013 09:47:24 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> Message-ID: <513D9A1C.2040009@donders.ru.nl> Dear Mushfa, I never tried what you did, however from what I know of the matter and from what Robert wrote, I can see that you made some errors in your script that I can point to. I can, however, neither guarantee that this solves all or any of your problems nor that it's all correct what you are doing. So, I can only tell you some minor things: 1) When defining trial, setting cfg.trialdef.eventtype to '?' should actually only be done if you do not know the eventtype. Also note that it might be better to use all your trials rather than a subset - better signal-to-noise that way ;) 2) No reason to segment the brain twice - this operation should be done only once and the segmented brain you base the two leadfield-matrices on *must* be exactly the same. So you can save time by removing the computation of vol2. 3) Specifying only one frequency might not be a good idea, because of imperfect sampling. 4) 'singlesphere' is created specifically for MEG data. BEM models are good for EEG, not sure how good they are for MEG, but the dipoli implementation only works under unix (Linux/Mac) and openMEEG has to be downloaded manually first to make it work. 5) As Robert said, units are not always properly controlled for using FieldTrip. You can use ft_convert_units to make them match. 6) Please check again how 'grid' is defined, e.g. the .dim field shouldn't be concatenated. 7) You do not only need to concatenate the grids, but also the data, hope you did that ;) But I would really rather concatenated the two freq structures you used to compute the sourcemodel/leadfield than to compute it newly. If you concatenate you can be sure that the channel order is persistent. If you keep on having problems, I would suggest to use breakpoints or /dbstop if error/ and then step through the function to see where the error comes from, i.e. why there are NaNs or Infs in (lf*Cf*lf), and start off with looking at if there are NaNs or Infs in lf or Cf already. That's all I can help you with, cause that's were my knowledge ends ;) Maybe someone else is wiser than I am. Good luck! Best, Jörn On 3/8/2013 4:12 PM, Mushfa Yousuf wrote: > > Hello; > > I have few problems while calculating combine "MEG & EEG" source > reconstruction and I need your help to troubleshoot the problems. > > I have a data from a Parkinson's disease patient who underwent DBS and > we recorded 306 MEG channels and 64 EEG channels simultaneously, first > I have calculated the leadfield individually for both EEG and MEG. > > I have defined all the calculations step by step so that I can > describe my problems very precisely. > > *_CALCULATE THE LEADFIELD FOR MEG CHANNELS:-_* > > // I have defined the Pre-Stimulus data i.e. Stim-off data in the > original code. > > _Reading raw data set for MEG channels_ > > __ > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'MEG'}; *// In order to read raw data only for MEG > channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that I have defined the _time of window of interest_ for the MEG > raw data set > > cfg.toilim = [0 0.5]; > > dataPost = ft_redefinetrial(cfg, dataFIC12); > > and calculate the _Power Spectral density matrix_ for the MEG channels > data set > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'powandcsd'; > > cfg.tapsmofrq = 2; > > cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the > stimulation frequency > > cfg.pad = 1; > > freqPost = ft_freqanalysis(cfg, dataPost); > > Now next step for me is to choose the method for the Head Model. I > have noticed that Singlesphere is the common method which can be used > for both EEG and MEG. So I have selected the singlesphere method for > the calculation of volume conduction model. > > mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); // READ MRI > > cfg = []; > > cfg.write = 'no'; > > cfg.coordsys = 'ctf'; > > segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the segmented mri > > cfg = []; > > cfg.method = 'singlesphere'; // *METHOD* > > vol1 = ft_prepare_headmodel(cfg, segmentedmri1); > > Now next step is to calculate the LEADFIELD > > cfg = []; > > cfg.grad = freqPost.grad; > > cfg.vol = vol1; > > cfg.reducerank = 2; // MEG > > cfg.channel = {'MEG'}; > > cfg.grid.resolution = 1; // I choose a resolution 1 > > [grid1] = ft_prepare_leadfield(cfg); > > *disp(grid1)* > > * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* > > * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* > > * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* > > * dim: [15 16 16]* > > * pos: [3840x3 double]* > > * unit: 'cm'* > > * inside: [1x2037 double]* > > * outside: [1x1803 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3840 cell}* > > ** > > ** > > ØIt has to be noticed that Inside Dipole is 2037. > > ** > > *_CALCULATE THE LEADFIELD FOR EEG CHANNELS:-_* > > _Reading raw data set for EEG channels_ > > __ > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'EEG'}; *// In order to read raw data only for EEG > channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that I have defined the _time of window of interest_ for the EEG > raw data set > > cfg.toilim = [0 0.5]; > > dataPost = ft_redefinetrial(cfg, dataFIC12); > > and calculate the _Power Spectral density matrix_ for the EEG channels > data set > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'powandcsd'; > > cfg.tapsmofrq = 2; > > cfg.foilim = [129 129]; // Frequency of interest is 129 Hz > > cfg.pad = 1; > > freqPost = ft_freqanalysis(cfg, dataPost); > > _HEAD MODEL FOR EEG_ > > mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); > > cfg = []; > > cfg.write = 'no'; > > cfg.coordsys = 'ctf'; > > segmentedmri2 = ft_volumesegment(cfg, mri); > > cfg = []; > > cfg.method = 'singlesphere'; // METHOD > > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > _LEADFIELD:___ > > cfg = []; > > cfg.elec = freqPost.elec; > > cfg.vol = vol2; > > cfg.reducerank = 3; % 3 for EEG > > cfg.channel = {'EEG'}; > > cfg.grid.resolution = 9.54; // Increase the resolution so that the > inside dipoles for > > EEG should be close to the inside dipoles of MEG > > [grid2] = ft_prepare_leadfield(cfg); > > *disp(grid2)* > > * xgrid: [1x16 double]* > > * ygrid: [1x16 double]* > > * zgrid: [1x13 double]* > > * dim: [16 16 13]* > > * pos: [3328x3 double]* > > * unit: 'mm'* > > * inside: [1x2038 double]* > > * outside: [1x1290 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3328 cell}* > > ØIt has to be noticed that Inside Dipole is 2038. > > *_Concatenate of MEG and EEG LEADFIELD:-_* > > Now I have the individual LEADFIELD of both MEG and EEG grid1 and > grid2 respectively. > > *disp(grid1)* > > * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* > > * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* > > * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* > > * dim: [15 16 16]* > > * pos: [3840x3 double]* > > * unit: 'cm'* > > * inside: [1x2037 double]* > > * outside: [1x1803 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3840 cell}* > > ** > > *disp(grid2)* > > * xgrid: [1x16 double]* > > * ygrid: [1x16 double]* > > * zgrid: [1x13 double]* > > * dim: [16 16 13]* > > * pos: [3328x3 double]* > > * unit: 'mm'* > > * inside: [1x2038 double]* > > * outside: [1x1290 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3328 cell}* > > ** > > *Few things to be noticed here * > > ** > > Ø*unit is different for both MEG 'cm' and EEG 'mm'* > > Ø*I have used the same method for calculating the Volume for both MEG > & EEG => "Singlesphere" * > > Ø*Concatenating the "pos" vector of EEG and MEG and the other vectors* > > ** > > *Grid.pos = cat(1,grid1.pos,grid2.pos);* > > *Grid.xgrid = [grid1.xgrid grid2.xgrid];* > > *Grid.ygrid = [grid1.ygrid grid2.ygrid];* > > *Grid.zgrid = [grid1.zgrid grid2.zgrid];* > > *Grid.inside = [grid1.inside grid2.inside];* > > *Grid.outside = [grid1.outside grid2.outside];* > > *Grid.leadfield = [grid1.leadfield grid2.leadfield];* > > *Grid.dim = [grid1.dim grid2.dim];* > > ** > > *_Combined Source Reconstruction:-_* > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'MEG','EEG'}; *// In order to read raw data for MEG & > EEG channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that as previously defined, I have calculated the Spectral density. > > Now I have to calculate the inverse solution for both EEG & MEG data > trials. > > _Source Analysis: without contrasting condition:-_ > > __ > > cfg = []; > > cfg.method = 'dics'; > > cfg.frequency = 129; > > cfg.grid = Grid; // Concatenated grid > > cfg.vol = vol1; // As vol1 = vol2 : both singlesphere > > cfg.powmethod = 'trace'; > > cfg.dics.projectnoise = 'yes'; > > cfg.dics.lambda = 0.0001; > > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost > contains both MEG * > > *and EEG row data* > > **** > > I have received the following error: > > scanning grid 2037/4075 > > ??? Error using ==> svd > > Input to SVD must not contain NaN or Inf. > > Error in ==> beamformer_dics>pinv at 568 > > [U,S,V] = svd(A,0); > > Error in ==> beamformer_dics at 314 > > filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, > > use PINV/SVD to cover rank deficient leadfield > > Error in ==> ft_sourceanalysis at 595 > > dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), > > optarg{:}); > > Error in ==> code at 227 > > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > ØIf you notice that till 2037 grid it represents the MEG grid and > after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which also > represent inside dipole). > > ØSecondly I try to use other method for the head modeling i.e > openmeeg, dipoli and bemcp method which leads me to different errors > which I was unable to trouble shoot. > > ·Openmeeg = OpenMEEG binaries are not correctly installed > > ·Dipoli =vol.mat file was missing after calculating the headmodel > > ·Bemcp =vol.mat file contains NaN fiels which leads to wrong > > leadfield computation. > > *_I apologize for the long email. I wanted to show the steps which I > used so that it is easier to debug the problem._* > > *__* > > Thank you; > > Mushfa Yousuf > > > > On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld > > wrote: > > Dear Mushfa > > In principle it can be made to work, but you'll have to do a > little bit of work outside fieldtrip. You would start with > 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part > 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part > Subsequently you would (manually) concatenate the leadfields of > the MEG and EEG. Here you have to make sure that the channel order > is consistent with that in your combined data. > The resulting structure with combined leadfields can be passed > into ft_sourceanalysis as cfg.grid. > > However, I foresee a problem with the scaling. At this moment > FieldTrip is not (yet) very precise in maintaining the correct > units throughout. Consequently you might get different units for > the EEG and MEG contribution to each dipole, causing weird > cancelation effects. You'll just have to check carefully that the > leadfield units and the data units consistently scaled between > megmag, megplanar and eeg. > > This brings me to another known problem for the combined > vectorview magnetometer and planar gradiometer channels: at this > moment the forward computation computes both in T (or fT), whereas > the data is represented as T for the magnetometers and T/m for the > gradiometers. So the gradiometer leadfields are off by a factor > "1/baseline", which is approximately 1/70 if I recall correctly. > Many neuromag users use only the planar channels, and therefore > don't notice. We are working on fixing the neuromag > channel/gradiometer units. That is not as simple as it appears, > because conversions of the geometrical dimensions from m to cm or > mm also affect the gradiometer baseline. So converting the data > from m to mm should result in the planar channel data getting 1000 > times smaller, whereas the magnetometer channels shoudl stay the > same. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 and > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want to > follow this. > > best regards > Robert > > > > On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: > >> Hello Fieldtrippers, >> >> I am currently doing source analysis using beamformer method in fieldtrip. >> >> The data i work on is a simultaneous measurement of MEG (306) with EEG >> (128) on PD patients. >> >> I was successful in calculating the sources for both the modalities alone. >> >> I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation >> >> >> of the lead field. But, then when i want to use the created vol for the >> source analysis i have two structures one for EEG and the second one for >> MEG. Now, i can only define only one to estimate the sources. How to use >> >> >> this for both the modalities? Any help would be appreciated. >> >> With regards >> Mushfa >> _______________________________________________ >> 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 > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 11 10:18:42 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 11 Mar 2013 10:18:42 +0100 (CET) Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <1959.87.78.53.29.1362993522.squirrel@87.78.53.29> hi, the singleshell volume conduction model (standard_singleshell) is implemented for MEG data, while BEM models are used for EEG. It seems to me that you use EEG template electrodes, therefore those will work only with EEG volume conduction models. You can look at the reference documentation of ft_prepare_headmodel (http://fieldtrip.fcdonders.nl/reference/ft_prepare_headmodel) to see which headmodels work with which type of data. If you would like to compute a leadfield with the singlehell model, you need a structure with gradiometer definition in the cfg.grad instead of the EEG electrode definition in cfg.elec. I hope this helps. Best, Lilla > Dear Fieldtrip experts, > I would like to create a leadfield based on the standard brain provided > by the fieldtrip package and standard electrode positions. > I do it like this : > load standard_singleshell % from template\headmodel > cfg = []; > cfg.elec = sens;% also from template > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid] = ft_prepare_leadfield(cfg); > > Finally I got the following error message. > converting units from 'mm' to 'cm' > ??? Error using ==> ft_prepare_vol_sens at 495 > unsupported volume conductor model for EEG > Error in ==> prepare_headmodel at 84 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', > cfg.channel, 'order', cfg.order); > Error in ==> ft_prepare_leadfield at 147 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > but when I use 'standard_bem' (from template )is OK . > > Is anybody out there who could provide some support? > Thank you very much in advance, > Best, > mengtongxiao > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 11 10:41:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 11 Mar 2013 10:41:33 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: <513D9A1C.2040009@donders.ru.nl> References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> <513D9A1C.2040009@donders.ru.nl> Message-ID: <513DA6CD.7030402@donders.ru.nl> whoopsy, just realized that you use singlesphere, not singleshell. I was talking about singleshell ;) On 3/11/2013 9:47 AM, "Jörn M. Horschig" wrote: > Dear Mushfa, > > I never tried what you did, however from what I know of the matter and > from what Robert wrote, I can see that you made some errors in your > script that I can point to. I can, however, neither guarantee that > this solves all or any of your problems nor that it's all correct what > you are doing. So, I can only tell you some minor things: > 1) When defining trial, setting cfg.trialdef.eventtype to '?' should > actually only be done if you do not know the eventtype. Also note that > it might be better to use all your trials rather than a subset - > better signal-to-noise that way ;) > > 2) No reason to segment the brain twice - this operation should be > done only once and the segmented brain you base the two > leadfield-matrices on *must* be exactly the same. So you can save time > by removing the computation of vol2. > > 3) Specifying only one frequency might not be a good idea, because of > imperfect sampling. > > 4) 'singlesphere' is created specifically for MEG data. BEM models are > good for EEG, not sure how good they are for MEG, but the dipoli > implementation only works under unix (Linux/Mac) and openMEEG has to > be downloaded manually first to make it work. > > 5) As Robert said, units are not always properly controlled for using > FieldTrip. You can use ft_convert_units to make them match. > > 6) Please check again how 'grid' is defined, e.g. the .dim field > shouldn't be concatenated. > > 7) You do not only need to concatenate the grids, but also the data, > hope you did that ;) But I would really rather concatenated the two > freq structures you used to compute the sourcemodel/leadfield than to > compute it newly. If you concatenate you can be sure that the channel > order is persistent. > > > If you keep on having problems, I would suggest to use breakpoints or > /dbstop if error/ and then step through the function to see where the > error comes from, i.e. why there are NaNs or Infs in (lf*Cf*lf), and > start off with looking at if there are NaNs or Infs in lf or Cf > already. That's all I can help you with, cause that's were my > knowledge ends ;) Maybe someone else is wiser than I am. Good luck! > > Best, > Jörn > > On 3/8/2013 4:12 PM, Mushfa Yousuf wrote: >> >> Hello; >> >> I have few problems while calculating combine "MEG & EEG" source >> reconstruction and I need your help to troubleshoot the problems. >> >> I have a data from a Parkinson's disease patient who underwent DBS >> and we recorded 306 MEG channels and 64 EEG channels simultaneously, >> first I have calculated the leadfield individually for both EEG and MEG. >> >> I have defined all the calculations step by step so that I can >> describe my problems very precisely. >> >> *_CALCULATE THE LEADFIELD FOR MEG CHANNELS:-_* >> >> // I have defined the Pre-Stimulus data i.e. Stim-off data in the >> original code. >> >> _Reading raw data set for MEG channels_ >> >> __ >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'MEG'}; *// In order to read raw data only for MEG >> channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that I have defined the _time of window of interest_ for the >> MEG raw data set >> >> cfg.toilim = [0 0.5]; >> >> dataPost = ft_redefinetrial(cfg, dataFIC12); >> >> and calculate the _Power Spectral density matrix_ for the MEG >> channels data set >> >> cfg = []; >> >> cfg.method = 'mtmfft'; >> >> cfg.output = 'powandcsd'; >> >> cfg.tapsmofrq = 2; >> >> cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the >> stimulation frequency >> >> cfg.pad = 1; >> >> freqPost = ft_freqanalysis(cfg, dataPost); >> >> Now next step for me is to choose the method for the Head Model. I >> have noticed that Singlesphere is the common method which can be used >> for both EEG and MEG. So I have selected the singlesphere method for >> the calculation of volume conduction model. >> >> mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); // READ MRI >> >> cfg = []; >> >> cfg.write = 'no'; >> >> cfg.coordsys = 'ctf'; >> >> segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the >> segmented mri >> >> cfg = []; >> >> cfg.method = 'singlesphere'; // *METHOD* >> >> vol1 = ft_prepare_headmodel(cfg, segmentedmri1); >> >> Now next step is to calculate the LEADFIELD >> >> cfg = []; >> >> cfg.grad = freqPost.grad; >> >> cfg.vol = vol1; >> >> cfg.reducerank = 2; // MEG >> >> cfg.channel = {'MEG'}; >> >> cfg.grid.resolution = 1; // I choose a resolution 1 >> >> [grid1] = ft_prepare_leadfield(cfg); >> >> *disp(grid1)* >> >> * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* >> >> * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* >> >> * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* >> >> * dim: [15 16 16]* >> >> * pos: [3840x3 double]* >> >> * unit: 'cm'* >> >> * inside: [1x2037 double]* >> >> * outside: [1x1803 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3840 cell}* >> >> ** >> >> ** >> >> ØIt has to be noticed that Inside Dipole is 2037. >> >> ** >> >> *_CALCULATE THE LEADFIELD FOR EEG CHANNELS:-_* >> >> _Reading raw data set for EEG channels_ >> >> __ >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'EEG'}; *// In order to read raw data only for EEG >> channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that I have defined the _time of window of interest_ for the >> EEG raw data set >> >> cfg.toilim = [0 0.5]; >> >> dataPost = ft_redefinetrial(cfg, dataFIC12); >> >> and calculate the _Power Spectral density matrix_ for the EEG >> channels data set >> >> cfg = []; >> >> cfg.method = 'mtmfft'; >> >> cfg.output = 'powandcsd'; >> >> cfg.tapsmofrq = 2; >> >> cfg.foilim = [129 129]; // Frequency of interest is 129 Hz >> >> cfg.pad = 1; >> >> freqPost = ft_freqanalysis(cfg, dataPost); >> >> _HEAD MODEL FOR EEG_ >> >> mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); >> >> cfg = []; >> >> cfg.write = 'no'; >> >> cfg.coordsys = 'ctf'; >> >> segmentedmri2 = ft_volumesegment(cfg, mri); >> >> cfg = []; >> >> cfg.method = 'singlesphere'; // METHOD >> >> vol2 = ft_prepare_headmodel(cfg, segmentedmri2); >> >> _LEADFIELD:___ >> >> cfg = []; >> >> cfg.elec = freqPost.elec; >> >> cfg.vol = vol2; >> >> cfg.reducerank = 3; % 3 for EEG >> >> cfg.channel = {'EEG'}; >> >> cfg.grid.resolution = 9.54; // Increase the resolution so that the >> inside dipoles for >> >> EEG should be close to the inside dipoles of MEG >> >> [grid2] = ft_prepare_leadfield(cfg); >> >> *disp(grid2)* >> >> * xgrid: [1x16 double]* >> >> * ygrid: [1x16 double]* >> >> * zgrid: [1x13 double]* >> >> * dim: [16 16 13]* >> >> * pos: [3328x3 double]* >> >> * unit: 'mm'* >> >> * inside: [1x2038 double]* >> >> * outside: [1x1290 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3328 cell}* >> >> ØIt has to be noticed that Inside Dipole is 2038. >> >> *_Concatenate of MEG and EEG LEADFIELD:-_* >> >> Now I have the individual LEADFIELD of both MEG and EEG grid1 and >> grid2 respectively. >> >> *disp(grid1)* >> >> * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* >> >> * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* >> >> * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* >> >> * dim: [15 16 16]* >> >> * pos: [3840x3 double]* >> >> * unit: 'cm'* >> >> * inside: [1x2037 double]* >> >> * outside: [1x1803 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3840 cell}* >> >> ** >> >> *disp(grid2)* >> >> * xgrid: [1x16 double]* >> >> * ygrid: [1x16 double]* >> >> * zgrid: [1x13 double]* >> >> * dim: [16 16 13]* >> >> * pos: [3328x3 double]* >> >> * unit: 'mm'* >> >> * inside: [1x2038 double]* >> >> * outside: [1x1290 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3328 cell}* >> >> ** >> >> *Few things to be noticed here * >> >> ** >> >> Ø*unit is different for both MEG 'cm' and EEG 'mm'* >> >> Ø*I have used the same method for calculating the Volume for both MEG >> & EEG => "Singlesphere" * >> >> Ø*Concatenating the "pos" vector of EEG and MEG and the other vectors* >> >> ** >> >> *Grid.pos = cat(1,grid1.pos,grid2.pos);* >> >> *Grid.xgrid = [grid1.xgrid grid2.xgrid];* >> >> *Grid.ygrid = [grid1.ygrid grid2.ygrid];* >> >> *Grid.zgrid = [grid1.zgrid grid2.zgrid];* >> >> *Grid.inside = [grid1.inside grid2.inside];* >> >> *Grid.outside = [grid1.outside grid2.outside];* >> >> *Grid.leadfield = [grid1.leadfield grid2.leadfield];* >> >> *Grid.dim = [grid1.dim grid2.dim];* >> >> ** >> >> *_Combined Source Reconstruction:-_* >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'MEG','EEG'}; *// In order to read raw data for MEG >> & EEG channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that as previously defined, I have calculated the Spectral >> density. >> >> Now I have to calculate the inverse solution for both EEG & MEG data >> trials. >> >> _Source Analysis: without contrasting condition:-_ >> >> __ >> >> cfg = []; >> >> cfg.method = 'dics'; >> >> cfg.frequency = 129; >> >> cfg.grid = Grid; // Concatenated grid >> >> cfg.vol = vol1; // As vol1 = vol2 : both singlesphere >> >> cfg.powmethod = 'trace'; >> >> cfg.dics.projectnoise = 'yes'; >> >> cfg.dics.lambda = 0.0001; >> >> sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost >> contains both MEG * >> >> *and EEG row data* >> >> **** >> >> I have received the following error: >> >> scanning grid 2037/4075 >> >> ??? Error using ==> svd >> >> Input to SVD must not contain NaN or Inf. >> >> Error in ==> beamformer_dics>pinv at 568 >> >> [U,S,V] = svd(A,0); >> >> Error in ==> beamformer_dics at 314 >> >> filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, >> >> use PINV/SVD to cover rank deficient leadfield >> >> Error in ==> ft_sourceanalysis at 595 >> >> dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), >> >> optarg{:}); >> >> Error in ==> code at 227 >> >> sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); >> >> ØIf you notice that till 2037 grid it represents the MEG grid and >> after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which >> also represent inside dipole). >> >> ØSecondly I try to use other method for the head modeling i.e >> openmeeg, dipoli and bemcp method which leads me to different errors >> which I was unable to trouble shoot. >> >> ·Openmeeg = OpenMEEG binaries are not correctly installed >> >> ·Dipoli =vol.mat file was missing after calculating the headmodel >> >> ·Bemcp =vol.mat file contains NaN fiels which leads to wrong >> >> leadfield computation. >> >> *_I apologize for the long email. I wanted to show the steps which I >> used so that it is easier to debug the problem._* >> >> *__* >> >> Thank you; >> >> Mushfa Yousuf >> >> >> >> On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld >> > wrote: >> >> Dear Mushfa >> >> In principle it can be made to work, but you'll have to do a >> little bit of work outside fieldtrip. You would start with >> 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part >> 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part >> Subsequently you would (manually) concatenate the leadfields of >> the MEG and EEG. Here you have to make sure that the channel >> order is consistent with that in your combined data. >> The resulting structure with combined leadfields can be passed >> into ft_sourceanalysis as cfg.grid. >> >> However, I foresee a problem with the scaling. At this moment >> FieldTrip is not (yet) very precise in maintaining the correct >> units throughout. Consequently you might get different units for >> the EEG and MEG contribution to each dipole, causing weird >> cancelation effects. You'll just have to check carefully that the >> leadfield units and the data units consistently scaled between >> megmag, megplanar and eeg. >> >> This brings me to another known problem for the combined >> vectorview magnetometer and planar gradiometer channels: at this >> moment the forward computation computes both in T (or fT), >> whereas the data is represented as T for the magnetometers and >> T/m for the gradiometers. So the gradiometer leadfields are off >> by a factor "1/baseline", which is approximately 1/70 if I recall >> correctly. Many neuromag users use only the planar channels, and >> therefore don't notice. We are working on fixing the neuromag >> channel/gradiometer units. That is not as simple as it appears, >> because conversions of the geometrical dimensions from m to cm or >> mm also affect the gradiometer baseline. So converting the data >> from m to mm should result in the planar channel data getting >> 1000 times smaller, whereas the magnetometer channels shoudl stay >> the same. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 >> and http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want >> to follow this. >> >> best regards >> Robert >> >> >> >> On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: >> >>> Hello Fieldtrippers, >>> >>> I am currently doing source analysis using beamformer method in fieldtrip. >>> >>> The data i work on is a simultaneous measurement of MEG (306) with EEG >>> (128) on PD patients. >>> >>> I was successful in calculating the sources for both the modalities alone. >>> >>> I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation >>> >>> >>> of the lead field. But, then when i want to use the created vol for the >>> source analysis i have two structures one for EEG and the second one for >>> MEG. Now, i can only define only one to estimate the sources. How to use >>> >>> >>> this for both the modalities? Any help would be appreciated. >>> >>> With regards >>> Mushfa >>> _______________________________________________ >>> 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 >> >> >> >> >> _______________________________________________ >> 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 -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 11 10:46:33 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 11 Mar 2013 10:46:33 +0100 (CET) Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> References: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> Message-ID: <2126.87.78.53.29.1362995193.squirrel@87.78.53.29> hi Sara, I am not entirely sure of this: But I think you get the error message because your vol structure is recognized as a concentric-spheres type volume conduction model which is supported for EEG data, while your input is MEG data. You can check it here (in the reference documentation of ft_prepare_headmodel) which headmodels are implemented for MEG: http://fieldtrip.fcdonders.nl/reference/ft_prepare_headmodel. Best, Lilla > Hi everybody > I'm trying to generate a field for a simulated dipole using the > command ft_dipolesimulation, for a MEG study. > > I do the following: > -read the hdr > > -import the sensor structure with the following lines > grad=hdr.grad; > radius = sqrt(sum(grad.chanpos.^2,2)); > grad.chanpos = grad.chanpos./ [radius radius radius]; > grad.label=hdr.label(1:306)'; > > -then I create the vol structure using the following code > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 > cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; > > At this point I have the grad structure, and the vol structure. > Then I give all the options for the dipole simulation with the code > > %% create a dipole simulation with a custom timecourse > cfg = []; > cfg.vol = vol; % see above > cfg.grad = grad; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; > cfg.dip.frequency = 10; %Hz > cfg.ntrials = 10; > cfg.triallength = 20; % seconds > cfg.fsample = 250; % Hz > > but when I try to esecute the line > > raw1 = ft_dipolesimulation(cfg); > > I find this error > > ??? Error using ==> ft_compute_leadfield at 301 > unsupported volume conductor model for MEG > > Error in ==> ft_dipolesimulation at 198 > lf = ft_compute_leadfield(dippos{trial}, sens, vol); > > > I really cannot understand why volume conductor model is not supported. > Any suggestion? I'm pretty sure that the mistake is trivial, but I'm > not able to see it. > > Thank you! > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3491530515 > tel +39 0818675361 > fax +39 0818675128 > > > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From hamid.mohseni at eng.ox.ac.uk Mon Mar 11 12:55:30 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Mon, 11 Mar 2013 11:55:30 +0000 Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> References: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> Message-ID: Hi, In MEG normally people use single layer volume conductor and It is believed that three layer is not useful and can deteriorate the results (this is in contrast to EEG). Therefore, you should use a single shell or a single sphere for MEG, which models only the brain (conductivity of the scalp is assumed to be same as the air). Thanks On 10 March 2013 17:22, wrote: > Hi everybody > I'm trying to generate a field for a simulated dipole using the command > ft_dipolesimulation, for a MEG study. > > I do the following: > -read the hdr > > -import the sensor structure with the following lines > grad=hdr.grad; > radius = sqrt(sum(grad.chanpos.^2,2)); > grad.chanpos = grad.chanpos./ [radius radius radius]; > grad.label=hdr.label(1:306)'; > > -then I create the vol structure using the following code > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 > cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; > > At this point I have the grad structure, and the vol structure. > Then I give all the options for the dipole simulation with the code > > %% create a dipole simulation with a custom timecourse > cfg = []; > cfg.vol = vol; % see above > cfg.grad = grad; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; > cfg.dip.frequency = 10; %Hz > cfg.ntrials = 10; > cfg.triallength = 20; % seconds > cfg.fsample = 250; % Hz > > but when I try to esecute the line > > raw1 = ft_dipolesimulation(cfg); > > I find this error > > ??? Error using ==> ft_compute_leadfield at 301 > unsupported volume conductor model for MEG > > Error in ==> ft_dipolesimulation at 198 > lf = ft_compute_leadfield(dippos{**trial}, sens, vol); > > > I really cannot understand why volume conductor model is not supported. > Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not > able to see it. > > Thank you! > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3491530515 > tel +39 0818675361 > fax +39 0818675128 > > > "I disapprove of what you say, but I will defend to the death your right > to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ------------------------------**------------------------------**---- > This message was sent using IMP, the Internet Messaging Program. > > > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Mon Mar 11 16:05:21 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Mon, 11 Mar 2013 16:05:21 +0100 Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: References: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> Message-ID: <20130311160521.ay852ph1ws0gs0s0@arco.cib.na.cnr.it> Thank you Hamid and Lilla your observations were correct and I solved my problem :-) Thanks for helping Best regards Sara > Hi, > > In MEG normally people use single layer volume conductor and It > is believed that three layer is not useful and can deteriorate the results > (this is in contrast to EEG). Therefore, you should use a single shell or > a single sphere for MEG, which models only the brain (conductivity of the > scalp is assumed to be same as the air). > > Thanks > > > > > On 10 March 2013 17:22, wrote: > >> Hi everybody >> I'm trying to generate a field for a simulated dipole using the command >> ft_dipolesimulation, for a MEG study. >> >> I do the following: >> -read the hdr >> >> -import the sensor structure with the following lines >> grad=hdr.grad; >> radius = sqrt(sum(grad.chanpos.^2,2)); >> grad.chanpos = grad.chanpos./ [radius radius radius]; >> grad.label=hdr.label(1:306)'; >> >> -then I create the vol structure using the following code >> vol = []; >> vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 >> cm >> vol.c = [1 1/80 1]; % conductivity >> vol.o = [0 0 0]; >> >> At this point I have the grad structure, and the vol structure. >> Then I give all the options for the dipole simulation with the code >> >> %% create a dipole simulation with a custom timecourse >> cfg = []; >> cfg.vol = vol; % see above >> cfg.grad = grad; % see above >> cfg.dip.pos = [0 0.5 0.3]; >> cfg.dip.mom = [1 0 0]'; >> cfg.dip.frequency = 10; %Hz >> cfg.ntrials = 10; >> cfg.triallength = 20; % seconds >> cfg.fsample = 250; % Hz >> >> but when I try to esecute the line >> >> raw1 = ft_dipolesimulation(cfg); >> >> I find this error >> >> ??? Error using ==> ft_compute_leadfield at 301 >> unsupported volume conductor model for MEG >> >> Error in ==> ft_dipolesimulation at 198 >> lf = ft_compute_leadfield(dippos{**trial}, sens, vol); >> >> >> I really cannot understand why volume conductor model is not supported. >> Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not >> able to see it. >> >> Thank you! >> Dott.ssa Sara Rombetto >> >> Istituto di Cibernetica >> "E. Caianiello" >> Via Campi Flegrei, 34 >> 80078 Pozzuoli (NA) >> Italy >> mob +39 3491530515 >> tel +39 0818675361 >> fax +39 0818675128 >> >> >> "I disapprove of what you say, but I will defend to the death your right >> to say >> it." [Evelyn Beatrice Hall, The Friends Of Voltaire] >> >> ------------------------------**------------------------------**---- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3491530515 tel +39 0818675361 fax +39 0818675128 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From mengtongxiao at gmail.com Tue Mar 12 12:21:52 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Tue, 12 Mar 2013 19:21:52 +0800 Subject: [FieldTrip] analysis of source level connectivity Message-ID: Dear all: I am interesting in connectivity and use the fieldtrip get the source. How do I use it do connectivity. Where can I find some script. I kown use 'svd' I can get 'project along the strongest dipole direction', where is the dilpole. ROI to the strongest dipole or strongest dipole to ROI ? thanks best, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Tue Mar 12 14:28:39 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 12 Mar 2013 14:28:39 +0100 Subject: [FieldTrip] Workshop "Disentangling the brain web" Message-ID: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> sorry for double posting. on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be organizing a small workshop at CIMeC (Rovereto, Italy). we have managed to attract several exciting invited speakers but are considering contributions from postdocs / phd students. see attached pdf. all the best, nathan -------------- next part -------------- A non-text attachment was scrubbed... Name: cimec_meg_workshop2013.pdf Type: application/pdf Size: 391680 bytes Desc: not available URL: From cmuehl at gmail.com Tue Mar 12 15:20:18 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Tue, 12 Mar 2013 15:20:18 +0100 Subject: [FieldTrip] Call for Papers: 3rd Workshop on Affective Brain-Computer Interfaces at ACII 2013 Message-ID: ** Second Call for Papers ** 3rd Workshop on Affective Brain-Computer Interfaces (aBCI) Workshop at ACII 2013 (September 2-5), Geneva, Switzerland, September 2, 2013 http://hmi.ewi.utwente.nl/abci2013 http://www.acii2013.org During the last decade, brain computer interface (BCI) research has developed into a major research field establishing methodological frameworks, guidelines and a core community of established researchers. Besides proving valuable as a communication channel that bypasses impeded muscular pathways, the novel technology also spurred the investigation of applications for able-bodied users, foremost in the fields of entertainment, health and lifestyle. Affective BCI systems allowing users to control computer games, support relaxation training, or trigger your alarm clock during a shallow sleep stage have been proposed, implemented, and sold. Moreover, the affordable hardware and software tools also encouraged artists to play with the idea of a direct access to people’s most private information: their affective and cognitive states. From these explorations followed a number of interesting installations, suggesting novel ways of human-computer as well as human-human interaction: neurotechnology-based systems that encourage affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. The third workshop on affective brain-computer interfaces will explore the advantages and limitations of using neuro-physiological signals as a modality for the automatic recognition of affective and cognitive states, and the possibilities of using this information about the user state in applications for domains like health, arts, and entertainment. The goal is to bring researchers, artists, and practitioners together to present state-of-the-art progress and their visions, and thus to spur the development of guidelines and frameworks for affective BCI. Topics of interest include, but are not limited to: • affective/cognitive state induction and data collection for affective BCI • detection of mental state via BCI and other modalities • innovative concepts for adaptive interfaces and affective BCI • demos of affective BCI systems and artworks Submission Instructions * The papers should feature original empirical work, theoretical work, or a well defendable but arguable position of the authors. * Papers will be published in the proceedings of ACII 2013 by IEEE. Papers should be limited to 6 pages. * Further details about the submission instructions and format can be found on the website of ACII 2013. * For further information, contact abci at ewi.utwente.nl Important Dates: April 20, 2013: Submission of manuscripts May 20, 2013: Acceptance/Rejection notification June 17, 2013: Submission of camera-ready papers and presenting author’s registration September 2, 2013: Date of the Workshop Programme Chairs: * Brendan Allison, University of California, San Diego, USA * Guilliaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland, * Christian Mühl, INRIA Bordeaux - Sud-Ouest, France * Anton Nijholt, Universiteit Twente, the Netherlands Programme Committee: * Egon L. van den Broek, TNO Technical Sciences, Delft, The Netherlands * Anne-Marie Brouwer, TNO Perceptual and Cognitive Systems, Soesterberg, the Netherlands * Stephen Fairclough, John Moores University, Liverpool, UK * Didier Grandjean, Swiss Center for Affective Sciences, Geneva, Switzerland * Hayrettin Gürkök, University of Twente, Enschede, the Netherlands * Jonghwa Kim, University of Augsburg, Germany * Brent Lance, Army Research Laboratory/TNB, Aberdeen Proving Ground, USA, * Fabien Lotte, INRIA Bordeaux - Sud-Ouest, France * Winfried Menninghaus, Freie Universität Berlin, Germany * Gary Garcia Molina, Philips Research North America, Briarcliff, USA * Christopher Honey, Princeton University, USA * Ioannis Patras, Queen Mary University, London, UK * Mannes Poel, University of Twente, Enschede, the Netherlands * Olga Sourina, NanYang Technological University, Singapore * Ed Tan, Universiteit van Amsterdam, the Netherlands * Aleksander Valjamae, University of Graz, Austria * Thorsten Zander, Technische Universität Berlin, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Tue Mar 12 15:50:58 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 12 Mar 2013 10:50:58 -0400 Subject: [FieldTrip] Workshop "Disentangling the brain web" In-Reply-To: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> References: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> Message-ID: I realize I just missed the Toronto workshop - does anyone know when the Berkeley, CA workshop might take place? On Tue, Mar 12, 2013 at 9:28 AM, Nathan Weisz wrote: > sorry for double posting. > > on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be > organizing a small workshop at CIMeC (Rovereto, Italy). > > we have managed to attract several exciting invited speakers but are > considering contributions from postdocs / phd students. see attached pdf. > > all the best, > nathan > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Tue Mar 12 15:50:58 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 12 Mar 2013 10:50:58 -0400 Subject: [FieldTrip] Workshop "Disentangling the brain web" In-Reply-To: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> References: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> Message-ID: I realize I just missed the Toronto workshop - does anyone know when the Berkeley, CA workshop might take place? On Tue, Mar 12, 2013 at 9:28 AM, Nathan Weisz wrote: > sorry for double posting. > > on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be > organizing a small workshop at CIMeC (Rovereto, Italy). > > we have managed to attract several exciting invited speakers but are > considering contributions from postdocs / phd students. see attached pdf. > > all the best, > nathan > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Markus.Butz at uni-duesseldorf.de Wed Mar 13 12:11:21 2013 From: Markus.Butz at uni-duesseldorf.de (Markus Butz) Date: Wed, 13 Mar 2013 11:11:21 +0000 (GMT) Subject: [FieldTrip] Problems reading in DICOM Message-ID: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Dear list,  I am experiencing problems reading in external MRI in DICOM format from a CD (doing it the first time though).  I wanted to do it the new and easy way as described here: http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom % read the DICOM files  mri = ft_read_mri('single_file_of_DICOM_series.IMA'); However, I have no single slices with extension *.ima but one dataset with the extension *.dcm and the other dataset with no extension for the single slice files. I am also not sure where to copy the DICOMDIR file. When I try to open a single file of the *.dcm series I get: mri = ft_read_mri('508652C3.dcm'); ??? Undefined function or variable "hdr". Error in ==> ft_read_mri at 216   hdr     = hdr(keep);  Trying to read in a single file of the no extension series I get: mri = ft_read_mri('73850486'); ??? Error using ==> dicominfo at 41 The specified file is not in DICOM format The Image Processing toolbox V 7.2 is installed and this is fieldtrip-20111101. Any help appreciated! Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Mar 13 12:23:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 13 Mar 2013 12:23:54 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Message-ID: Dear Markus, There have been several changes to ft_read_mri over the past 1,5 year. The first step I would suggest is to update your fieldtrip version to something more recent, perhaps that solves the problem 'automatically'. Best, Eelke On 13 March 2013 12:11, Markus Butz wrote: > Dear list, > > I am experiencing problems reading in external MRI in DICOM format from a CD > (doing it the first time though). > I wanted to do it the new and easy way as described here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom > > % read the DICOM files > mri = ft_read_mri('single_file_of_DICOM_series.IMA'); > > However, I have no single slices with extension *.ima but one dataset with > the extension *.dcm and the other dataset with no extension for the single > slice files. I am also not sure where to copy the DICOMDIR file. > > When I try to open a single file of the *.dcm series I get: > > mri = ft_read_mri('508652C3.dcm'); > > ??? Undefined function or variable "hdr". > > Error in ==> ft_read_mri at 216 > hdr = hdr(keep); > > Trying to read in a single file of the no extension series I get: > > mri = ft_read_mri('73850486'); > > ??? Error using ==> dicominfo at 41 > The specified file is not in DICOM format > > The Image Processing toolbox V 7.2 is installed and this is > fieldtrip-20111101. > > Any help appreciated! > > Markus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Wed Mar 13 14:22:03 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 13 Mar 2013 14:22:03 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Message-ID: <51407D7B.4070005@donders.ru.nl> Hi Markus, I kept on avoiding these errors by using MRIcron's dcm2nii functionality: http://www.mccauslandcenter.sc.edu/mricro/mricron/index.html But pay attention to the coordinate system when importing it into FieldTrip afterwards, it can be quite a hassle... Maybe Robert or JM know whether reading in .dcm files is possible, but I have to admit that I never tried ;) Best, Jörn On 3/13/2013 12:11 PM, Markus Butz wrote: > Dear list, > > I am experiencing problems reading in external MRI in DICOM format > from a CD (doing it the first time though). > I wanted to do it the new and easy way as described here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom > > % read the DICOM files > mri = ft_read_mri('single_file_of_DICOM_series.IMA'); > > However, I have no single slices with extension *.ima but one dataset > with the extension *.dcm and the other dataset with no extension for > the single slice files. I am also not sure where to copy the DICOMDIR > file. > > When I try to open a single file of the *.dcm series I get: > > mri = ft_read_mri('508652C3.dcm'); > > ??? Undefined function or variable "hdr". > > Error in ==> ft_read_mri at 216 > hdr = hdr(keep); > > Trying to read in a single file of the no extension series I get: > > mri = ft_read_mri('73850486'); > > ??? Error using ==> dicominfo at 41 > The specified file is not in DICOM format > > The Image Processing toolbox V 7.2 is installed and this is > fieldtrip-20111101. > > Any help appreciated! > > Markus > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingenieureniso at gmail.com Wed Mar 13 16:01:31 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Wed, 13 Mar 2013 16:01:31 +0100 Subject: [FieldTrip] Problems plotting TFR map Message-ID: I am using fieldtrip-20130101 and Matlab 7.10.I have a problem when I try to plot TFR map. The error message I receive is: ??? Error using ==> griddata at 53 X and Y must be same length as Z or the lengths of X and Y must match the size of Z. Error in ==> topoplot at 463 [Xi,Yi,Zi] = griddata(x', y, data, xi', yi, cfg.interpolation); % Interpolate the topographic data Error in ==> lecture at 65 [handle]=topoplot(cfg, meanfft) meanfft is a vector containing the average of the spectral power of each electrode. I have all the electrode locations loaded and the same command works on the same system using version fieldtrip-20130101. Thanks for your help, -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 13 16:33:31 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 13 Mar 2013 16:33:31 +0100 Subject: [FieldTrip] Problems plotting TFR map In-Reply-To: References: Message-ID: <51409C4B.7040408@donders.ru.nl> Dear Ingenieur Eniso, I'm sorry, but I don't follow. You wrote that you were "using fieldtrip-20130101 and Matlab 7.10" and got the error, but it worked "on the same system using version fieldtrip-20130101", so with what version did it crash and with what version did it work? In any case, could you please try whether the error persists with the latest version (20130312)? If the error persists, it would be of great for us to know how you preprocessed the data and how you are calling the topoplot function. I'm in particular even more confused, because the function you are calling should be named ft_topoplotER or ft_topoplotTFR and not just 'topoplot'. Could you try using one of these functions instead? Best, Jörn On 3/13/2013 4:01 PM, ingenieur eniso wrote: > I am using fieldtrip-20130101 and Matlab 7.10.I have a problem when I try to plot TFR map. > The error message I receive is: > ??? Error using ==> griddata at 53 > > > X and Y must be same length as Z or the lengths > of X and Y must match the size of Z. > > Error in ==> topoplot at 463 > [Xi,Yi,Zi] = griddata(x', y, data, xi', yi, cfg.interpolation); % Interpolate the topographic data > > > Error in ==> lecture at 65 > [handle]=topoplot(cfg, meanfft) > meanfft is a vector containing the average of thespectralpower of each electrode. > > > > I have all the electrode locations loaded and the same command works on the same system using versionfieldtrip-20130101. > > Thanks for your help, > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.maye at uke.de Wed Mar 13 17:07:06 2013 From: a.maye at uke.de (Alexander Maye) Date: Wed, 13 Mar 2013 17:07:06 +0100 Subject: [FieldTrip] Bug in ft_freqcomparison.m? Message-ID: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> Hi All, I just spotted something that could be a bug in ft_freqcomparison.m (fieldtrip-20130312 and previous versions). Don't now if this is the place for report, but if this really is an issue everyone using this function may be interested. The problem is in line 87 where freq = varargin{1}; is initialized to the *first* freq argument, that according to the doc is used as the norm. So the output (powspctrm) has the dimension of the norm, not the second freq argument, that one wants to become normalized. Strange, hmm? Then, in the following for-loops the index variable runs over the size of the *second* freq argument, updating trials in the powspctrm with the size of the *first* freq argument, which seems simply wrong. Maybe this is an ingenious programming trick, but initializing freq = varargin{2}; on line 87 would make more sense from my point of view. Best, ALEX. -------------- next part -------------- -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Mar 13 23:26:12 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 13 Mar 2013 23:26:12 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <51407D7B.4070005@donders.ru.nl> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> <51407D7B.4070005@donders.ru.nl> Message-ID: <985C7F60-4B5F-4E16-B504-437C9095CBEF@donders.ru.nl> Hi DICOM files come with different extensions. I guess it depends on the scanner (Siemens/Philips/...). But the file format should be the same as it is a standard format, so the extension should not matter. The fileio/ft_filetype.m function detects both dcm and ima files as dicom. if the files have no extension, the autodetection fails and you should explicitly specify the format as mri = ft_read_mri('single_file_of_DICOM_series', 'format', 'dicom'); I now realize that to be a hidden option. I'll get that fixed in the function documentation. I recommend that you specify a filename from somewhere in the middle of the stack of files. There are often a few localizer scans in the same directory, and these (due to the sorting of the file names) tend to end up at the beginning or end of the (alphabetical) directory listing. cheers Robert On 13 Mar 2013, at 14:22, Jörn M. Horschig wrote: > Hi Markus, > > I kept on avoiding these errors by using MRIcron's dcm2nii functionality: http://www.mccauslandcenter.sc.edu/mricro/mricron/index.html > But pay attention to the coordinate system when importing it into FieldTrip afterwards, it can be quite a hassle... > > Maybe Robert or JM know whether reading in .dcm files is possible, but I have to admit that I never tried ;) > > Best, > Jörn > > On 3/13/2013 12:11 PM, Markus Butz wrote: >> Dear list, >> >> I am experiencing problems reading in external MRI in DICOM format from a CD (doing it the first time though). >> I wanted to do it the new and easy way as described here: >> http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom >> >> % read the DICOM files >> mri = ft_read_mri('single_file_of_DICOM_series.IMA'); >> >> However, I have no single slices with extension *.ima but one dataset with the extension *.dcm and the other dataset with no extension for the single slice files. I am also not sure where to copy the DICOMDIR file. >> >> When I try to open a single file of the *.dcm series I get: >> >> mri = ft_read_mri('508652C3.dcm'); >> >> ??? Undefined function or variable "hdr". >> >> Error in ==> ft_read_mri at 216 >> hdr = hdr(keep); >> >> Trying to read in a single file of the no extension series I get: >> >> mri = ft_read_mri('73850486'); >> >> ??? Error using ==> dicominfo at 41 >> The specified file is not in DICOM format >> >> The Image Processing toolbox V 7.2 is installed and this is fieldtrip-20111101. >> >> Any help appreciated! >> >> Markus >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Thu Mar 14 00:09:05 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 13 Mar 2013 23:09:05 +0000 Subject: [FieldTrip] 64 channel ActiCap sensor locations Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, Do anyone of you have the sensor location file for a 64 channel ActiCap (Brain products GmbH)? If so can you please share it with me or give me a hint where I can get one from. Thank you. Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From mengtongxiao at gmail.com Thu Mar 14 03:36:20 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Thu, 14 Mar 2013 10:36:20 +0800 Subject: [FieldTrip] How do I select ROIs Message-ID: Dear all, I want do source level connectivity.I use the template,I want to konw where is the field that I want. For example, I want find Language area.How do I find the coordinates of the location of its corresponding template. Or there have some .mat file about listing the border of each region. How can I do? thanks, Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Mar 14 08:50:01 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Mar 2013 08:50:01 +0100 Subject: [FieldTrip] How do I select ROIs In-Reply-To: References: Message-ID: Dear Xiao, You might want to have a look at this FAQ: http://fieldtrip.fcdonders.nl/faq/how_can_i_determine_the_anatomical_label_of_a_source If it does not work, or if that does not help you, please feel free to ask again of course! Best, Eelke On 14 March 2013 03:36, 陈雪 wrote: > Dear all, > > I want do source level connectivity.I use the template,I want to > konw where is the field that I want. > For example, I want find Language area.How do I find the coordinates > of the location of its corresponding template. > Or there have some .mat file about listing the border of each > region. > How can I do? > > thanks, > Xiao > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From irina.simanova at mpi.nl Thu Mar 14 11:13:48 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Thu, 14 Mar 2013 11:13:48 +0100 Subject: [FieldTrip] 64 channel ActiCap sensor locations In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> References: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> Message-ID: <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> Dear Imali, Check out this page: http://fieldtrip.fcdonders.nl/template/layout There are two template layouts for a 64 channel ActiCap available in Fieldtrip. The electrode positions are the same, but the order of channels is different. If none of these channel orders matches the one you have in your ActiCap, you can create a layout yourself with ft_prepare_layout. See http://fieldtrip.fcdonders.nl/tutorial/layout best, Irina On Mar 14, 2013, at 12:09 AM 3/14/13, IMALI THANUJA HETTIARACHCHI wrote: > Dear Fieldtrippers, > > Do anyone of you have the sensor location file for a 64 channel > ActiCap (Brain products GmbH)? > > If so can you please share it with me or give me a hint where I can > get one from. > > Thank you. > Kind regards > Imali > > Imali Thanuja Hettiarachchi > PhD Candidate > Centre for Intelligent Systems research > Deakin University, Geelong 3217, Australia. > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Thu Mar 14 12:44:51 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 14 Mar 2013 11:44:51 +0000 Subject: [FieldTrip] Statistical Parametric Mapping for MEG/EEG 2013 course Message-ID: Dear colleagues, We are happy to advertise the 2013 Statistical Parametric Mapping for MEG/EEG course presented by the Wellcome Trust Centre for Neuroimaging. The course will take place on Monday 13th May –Wednesday 15th May 2013 at the Wellcome Trust Centre for Neuroimaging in London. This course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course will cover (1) data pre-processing, (2) statistical analysis of sensor-space maps using GLMs and Random Field theory, (3) source reconstruction and (4) Dynamic Causal Modelling for EEG/MEG. The course will be followed by the long-established three-day course on ‘SPM for fMRI’ so it is possible to attend both courses. The course is suitable for beginners and more advanced users. We advise students to gain at least minimal familiarity with the methodology, for example, from reading the paper available at http://www.hindawi.com/journals/cin/2011/852961/ and other introductory articles listed at the SPM website or by following data analysis examples in the SPM manual. Video lectures from the 2012 course are available at http://www.fil.ion.ucl.ac.uk/spm/course/video/#MEEG For the practical part of the course please bring a laptop that can run Matlab (7.4 or later, no toolboxes are required) and is powerful enough to analyse your data (64-bit OS is highly recommended). The detailed schedule and booking forms can be found at http://www.ion.ucl.ac.uk/articles/events/SPM . For further details and registration please contact Jean Reynolds (jean.reynolds at ucl.ac.uk). With best wishes, Vladimir Litvak Ph.D. Lecturer Wellcome Trust Centre for Neuroimaging -------------------------------------------------------------------------------------------------- SPM (http://www.fil.ion.ucl.ac.uk/spm/) is free and open source software written in MATLAB (The MathWorks, Inc.). In addition to standard M/EEG pre-processing, we presently offer three main analysis tools: (i) statistical analysis of scalp-maps, time-frequency images and volumetric 3D source reconstruction images based on the general linear model, with correction for multiple comparisons using random field theory; (ii) Bayesian M/EEG source reconstruction, including support for group studies, simultaneous EEG and MEG, and fMRI priors; (iii) Dynamic Causal Modelling (DCM), an approach combining neural modelling with data analysis for which there are several variants dealing with evoked responses, steady state responses (power spectra and cross-spectra), induced responses and phase coupling. SPM is integrated with the FieldTrip toolbox (http://fieldtrip.fcdonders.nl/), making it possible for users to combine a variety of standard analysis methods with new schemes implemented in SPM and build custom analysis tools using powerful graphical user interface (GUI) and batching tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Thu Mar 14 13:09:24 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 14 Mar 2013 13:09:24 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <1070910925.63690.1363262912932.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <34843150.63726.1363262964484.JavaMail.root@indus.zimbra.ru.nl> Hi guys and girls, I can't get my subscription to the list working. It probably has to do with the account that underlies my email-address stan.vanpelt at donders.ru.nl . I thought that was s.vanpelt at fcdonders.ru.nl , but if I subscribe using that email-address, it still doesn't work. Hope you can help me out! best, Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Thu Mar 14 14:10:56 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 14 Mar 2013 14:10:56 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <58508409.66135.1363265587310.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Second attempt, with the actual question :) Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. Best, Stan -- Stan van Pelt, PhD Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Phone: +49 (0)69 96769 517 Fax: +49 (0)69 96769 555 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Mar 14 14:20:54 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 14 Mar 2013 14:20:54 +0100 Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> References: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <0A626AF9-5C8A-4B18-A135-028509BCFDB6@gmail.com> Hi Stan, you have to specify the surface template. I think it's using cfg.surffile or something like that. There is a separate one for the left and the right hemisphere. Good Luck Julian Am 14.03.2013 um 14:10 schrieb Pelt, S. van (Stan): > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. > > Best, > Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Mar 14 14:48:52 2013 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 14 Mar 2013 14:48:52 +0100 Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> References: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <81A04E2A-2DF8-4B7B-91B1-A66D39D05597@uni-konstanz.de> Dear Stan, would you specify cfg.surffile = 'surface_14_left.mat'; and see if it works? cheers tzvetan > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. > > Best, > Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Thu Mar 14 20:41:27 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Thu, 14 Mar 2013 15:41:27 -0400 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI Message-ID: Hello fieldtrippers! I would like to calculate wPLI (weighted phase lag index) for two time-series (created by a beamformer). It's described here: http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli What do *repetitions *mean in input argument for the function? I have the data in a text or Excel format that I could import into Matlab directly: 1st column is time, 2nd column is 1st source intensities and 3rd column is 2nd source intensities. Assuming I get my input data in the correct format, is this a correct line to call the function (I need a debiased wPLI)? [wpi, v, n] = ft_connectivity_wpli(input, debias 1) Thanks, Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Mar 14 21:22:19 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 14 Mar 2013 21:22:19 +0100 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI In-Reply-To: References: Message-ID: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> Hi inna, never used this method, but repetitions means you need single trials (it's not an averaged time-series you are talking about, right?). here some suggestions: when importing your data from Excel (how did that happen? :-)) into matlab, make a data structure that looks like one following ft_preprocessing. then run ft_freqanalysis with output "powandcsd" and keeptrials "yes" as options (and other options of course). this is at least what i assume after looking ft_connectivityanalysis then enter the structure which results from your former step into ft_connectivityanalysis with method specified as "wpli_debiased" perhaps wpli-experts want to correct me if i got something wrong. good luck, n On 14.03.2013, at 20:41, McGowin, Inna wrote: > Hello fieldtrippers! > > I would like to calculate wPLI (weighted phase lag index) for two time-series (created by a beamformer). > It's described here: http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli > What do repetitions mean in input argument for the function? > > I have the data in a text or Excel format that I could import into Matlab directly: > 1st column is time, > 2nd column is 1st source intensities and > 3rd column is 2nd source intensities. > > Assuming I get my input data in the correct format, is this a correct line to call the function (I need a debiased wPLI)? > [wpi, v, n] = ft_connectivity_wpli(input, debias 1) > > > Thanks, > Inna > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Mar 15 00:17:54 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 14 Mar 2013 19:17:54 -0400 Subject: [FieldTrip] Inner matrix mismatch in source interpolate Message-ID: Hi Fieldtrippers, When running ft source interpolate on my CTF MEG data, I get an error where it reaches line 237; tmp = interpmat*tmp. The error is an inner matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 matrix of power at the leaderfield coordinates. If this is just matrix math, then I assume the problem is just that the matrix have to be mxn and nxp. Is there any reason I cannot just use tmp=tmp' to make the inner dimensions match? Cheers Russ ---------- Forwarded message ---------- From: Russell G Port Date: Sat, Mar 9, 2013 at 8:38 PM Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree To: FieldTrip discussion list Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: *People can skip the first part of code, I included it as possibly useful information for this plead * %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); *Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition* %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; *Heres where it falls apart, because I try to source interpolate* %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with the current problem * cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos *(position of the leadfield locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), 'sphereradius', cfg.sphereradius) (0.*05*); what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata*. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Fri Mar 15 00:41:49 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 14 Mar 2013 23:41:49 +0000 Subject: [FieldTrip] 64 channel ActiCap sensor locations In-Reply-To: <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> References: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCE991@mbox-f-3.du.deakin.edu.au> Dear Irina, Thank you very much for the reply. Actually I did use the layout files and used them already for plotting, but I need to do a source reconstruction from the data, so for that I need the 3D sensor positions, not the 2D layout. I do not think I can use a 2D layout with ft_read_sens. Could you please help me on how I can find the 3D locations? Thanks again. Kind regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Irina Simanova Sent: Thursday, 14 March 2013 9:14 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] 64 channel ActiCap sensor locations Dear Imali, Check out this page: http://fieldtrip.fcdonders.nl/template/layout There are two template layouts for a 64 channel ActiCap available in Fieldtrip. The electrode positions are the same, but the order of channels is different. If none of these channel orders matches the one you have in your ActiCap, you can create a layout yourself with ft_prepare_layout. See http://fieldtrip.fcdonders.nl/tutorial/layout best, Irina On Mar 14, 2013, at 12:09 AM 3/14/13, IMALI THANUJA HETTIARACHCHI wrote: Dear Fieldtrippers, Do anyone of you have the sensor location file for a 64 channel ActiCap (Brain products GmbH)? If so can you please share it with me or give me a hint where I can get one from. Thank you. Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Fri Mar 15 10:01:07 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Fri, 15 Mar 2013 10:01:07 +0100 (CET) Subject: [FieldTrip] Inner matrix mismatch in source interpolate In-Reply-To: References: Message-ID: <000801ce215b$9feddeb0$dfc99c10$@herring@fcdonders.ru.nl> Hi Russ, I ran into a similar error which was avoided by following the steps in the extended beamformer tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformingextended). The problem seems to rather be that ft_sourceinterpolate wrongly detects your functional data as being 2 dimensional (if I remember correctly) because a .dim field is not present. I did not have the time yet to find-out if it is a problem with the other beamformer tutorial or an actual bug. In any case, if I compare the steps in the extended beamformer tutorial with the steps you took I noticed that in the extended beamformer tutorial a sourcemodel (ft_prepare_sourcemodel) is calculated after calculating the headmodel, which is then used to calculate the leadfield (ft_prepare_leadfield), followed by using this leadfield in ft_sourceanalysis. Could you try and see if that works? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Russell G Port Sent: vrijdag 15 maart 2013 0:18 To: FieldTrip discussion list Subject: [FieldTrip] Inner matrix mismatch in source interpolate Hi Fieldtrippers, When running ft source interpolate on my CTF MEG data, I get an error where it reaches line 237; tmp = interpmat*tmp. The error is an inner matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 matrix of power at the leaderfield coordinates. If this is just matrix math, then I assume the problem is just that the matrix have to be mxn and nxp. Is there any reason I cannot just use tmp=tmp' to make the inner dimensions match? Cheers Russ ---------- Forwarded message ---------- From: Russell G Port Date: Sat, Mar 9, 2013 at 8:38 PM Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree To: FieldTrip discussion list Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: People can skip the first part of code, I included it as possibly useful information for this plead %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; Heres where it falls apart, because I try to source interpolate %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %% didnt appear to help with the current problem cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos (position of the leadfield locations), pos (mri voxels), 'projmethod', cfg.interpmethod (nearest), 'sphereradius', cfg.sphereradius) (0.05); what I get out of this is a 16777216(256x256x256 voxels) x642 (leadfield position) matrix. it then undergoes interpmat(~anatomical.inside(:), :) = 0. My anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Fri Mar 15 10:29:07 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 15 Mar 2013 10:29:07 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <81A04E2A-2DF8-4B7B-91B1-A66D39D05597@uni-konstanz.de> Message-ID: <265882854.85608.1363339747061.JavaMail.root@indus.zimbra.ru.nl> Thanks a lot for all your input, changing the surffile did the trick. ----- Oorspronkelijk bericht ----- > Van: "Tzvetan Popov" > Aan: "FieldTrip discussion list" > Verzonden: Donderdag 14 maart 2013 14:48:52 > Onderwerp: Re: [FieldTrip] Single hemisphere surfaceplot > Dear Stan, > would you specify cfg.surffile = 'surface_14_left.mat'; and see if it > works? > cheers > tzvetan > > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each > > hemisphere seperately? There doesn't seem to be an configuration > > option for that in ft_sourceplot, and I wonder if it is possible at > > all. > > Best, > > Stan > > -- > > Stan van Pelt, PhD > > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for > > Neuroscience > > in Cooperation with Max Planck Society > > Deutschordenstr. 46, D-60528 Frankfurt > > Phone: +49 (0)69 96769 517 > > Fax: +49 (0)69 96769 555 > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > ******************************************* > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Fri Mar 15 16:32:21 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Fri, 15 Mar 2013 11:32:21 -0400 Subject: [FieldTrip] Smoothing for Time Frequency plots Message-ID: <2586A1048152BE4D861E64A98700AD420D5FFE3B@nki-mail.NKI.rfmh.org> Hi, I've been using the ft_singleplotTFR function to plot some TFR data I imported from BESA, and the plots are accurate, but very pixelated. I was wondering if anyone had any experience smoothing or interpolating data to make nicer looking plots? Thanks, -Michael ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Fri Mar 15 23:07:37 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Fri, 15 Mar 2013 22:07:37 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model Message-ID: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 From hamid.mohseni at eng.ox.ac.uk Sat Mar 16 16:27:30 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 16 Mar 2013 15:27:30 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: Message-ID: Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran wrote: > Hello FieldTrip users, > > I am having trouble aligning volume conduction model with source model > > The link to the data is > https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi > > Here are the steps I followed > > % Read mri > mri = ft_read_mri('T1.mgz'); > > % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s > and origin as i. At the end mri.coordsys was equal to 'neuromag' > mri = ft_determine_coordsys(mri); > > % Align volume. Selected l, r, l and z in + z direction > cfg=[]; > cfg.coordsys='neuromag'; > mri = ft_volumerealign(cfg,mri); > > %Volume segment > cfg=[]; > cfg.coordsys='neuromag'; > cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; > seg = ft_volumesegment(cfg, mri); > > % Prepare head model. The model aligns well with sensors > cfg=[]; > cfg.coordsys='neuromag'; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > % compute sourcespace > bnd = > ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); > T = mri.transform*inv(mri.transformorig); > sourcespace = ft_transform_geometry(T, bnd); > > % Plot > figure;hold on; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > > > > These surfaces do not align. Any ideas? > > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Sat Mar 16 17:10:09 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Sat, 16 Mar 2013 16:10:09 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , Message-ID: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 16 17:46:39 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 16 Mar 2013 16:46:39 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: Message-ID: If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" wrote: > Hi Hamid, > Thanks for the reply. I see what you mean. > When I import the T1, there is a mri.transform already present in it. This > is generated by the freesurfer. mri.tranform gets changed when I do the > ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , > nas as n and z in the positive z direction. I have vitamin pills at the > fiducials ( some also at the forehead) that would help in marking the > points. > > I cannot figure out where am I messing up. Also I am using the src file > in MNE and I do not have this issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > *Sent:* Saturday, March 16, 2013 11:28 AM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Hi, > > I THINK there is a problem with your mri.transform matrix. Basically, > without any pre-processing, when you apply this transformation to the > headshape points 'bnd', it should match the original mri. I checked that > and apparently it dosen't happen. How did you obtain this transformation? > > Thanks > > > > On 15 March 2013 22:07, Doshi, Chiran wrote: > >> Hello FieldTrip users, >> >> I am having trouble aligning volume conduction model with source model >> >> The link to the data is >> https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi >> >> Here are the steps I followed >> >> % Read mri >> mri = ft_read_mri('T1.mgz'); >> >> % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as >> s and origin as i. At the end mri.coordsys was equal to 'neuromag' >> mri = ft_determine_coordsys(mri); >> >> % Align volume. Selected l, r, l and z in + z direction >> cfg=[]; >> cfg.coordsys='neuromag'; >> mri = ft_volumerealign(cfg,mri); >> >> %Volume segment >> cfg=[]; >> cfg.coordsys='neuromag'; >> cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; >> seg = ft_volumesegment(cfg, mri); >> >> % Prepare head model. The model aligns well with sensors >> cfg=[]; >> cfg.coordsys='neuromag'; >> cfg.method = 'singleshell'; >> vol = ft_prepare_headmodel(cfg, seg); >> >> % compute sourcespace >> bnd = >> ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); >> T = mri.transform*inv(mri.transformorig); >> sourcespace = ft_transform_geometry(T, bnd); >> >> % Plot >> figure;hold on; >> ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight >> ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; >> >> >> >> These surfaces do not align. Any ideas? >> >> >> >> Chiran Doshi, MS >> MEG system technologist >> Department of Neurology >> Boston Childrens Hospital >> Phone: 781-216-1136 >> Fax: 781-216-1172 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Mon Mar 18 14:41:19 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Mon, 18 Mar 2013 13:41:19 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , Message-ID: Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" > wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mcgoiv0 at wfu.edu Mon Mar 18 15:25:39 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 18 Mar 2013 10:25:39 -0400 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI In-Reply-To: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> References: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> Message-ID: Thanks Nathan! Sorry I am not a frequent FieldTrip user and not sure how a data stutructure should look like after ft_preprocessing. I have two time-series for two virtual electrodes; the time-series were calculated by CTF SAM (synthetic aperture magnetometry), and then extracted and converted into a text file (and Excel if needed). Now I want to use the weighted Phase Lag Index (wPLI) and compare these two time-series for any coupling. My understanding is that the input for this function should be a cross-spertal density matrix? I tried to follow the steps you suggested with the CTF dataset that includes both the original data and the two time-series but got stuck on ft-freqanalysis as it requires lots of inputs I am not knowledgeable about, plus it still works with the whole dataset instead of just two time-series that I am interested in. Is there a short-cut for CTF SAM output dataset? Thanks! Inna On Thu, Mar 14, 2013 at 4:22 PM, Nathan Weisz wrote: > Hi inna, > > never used this method, but repetitions means you need single trials (it's > not an averaged time-series you are talking about, right?). > > here some suggestions: > > - when importing your data from Excel (how did that happen? :-)) into > matlab, make a data structure that looks like one following > ft_preprocessing. > - then run ft_freqanalysis with output "powandcsd" and keeptrials > "yes" as options (and other options of course). this is at least what i > assume after looking ft_connectivityanalysis > - then enter the structure which results from your former step into > ft_connectivityanalysis with method specified as "wpli_debiased" > > perhaps wpli-experts want to correct me if i got something wrong. > > good luck, > n > > > > > On 14.03.2013, at 20:41, McGowin, Inna wrote: > > Hello fieldtrippers! > > I would like to calculate wPLI (weighted phase lag index) for two > time-series (created by a beamformer). > It's described here: > http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli > What do *repetitions *mean in input argument for the function? > > I have the data in a text or Excel format that I could import into Matlab > directly: > 1st column is time, > 2nd column is 1st source intensities and > 3rd column is 2nd source intensities. > > Assuming I get my input data in the correct format, is this a correct line > to call the function (I need a debiased wPLI)? > > [wpi, v, n] = ft_connectivity_wpli(input, debias 1) > > Thanks, > > Inna > _______________________________________________ > 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 > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Mon Mar 18 16:09:45 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Mon, 18 Mar 2013 11:09:45 -0400 Subject: [FieldTrip] fieldtrip2eeglab Message-ID: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Hello all, I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing list, but I can't actually find it. Does anyone have a copy or know where I should look? -Michael ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Mar 18 16:19:41 2013 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 18 Mar 2013 16:19:41 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> Hi Michael, I have a version, but it seems quite old and I have never actually used it. Maybe it's of any help to you. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 18.03.2013 um 16:09 schrieb Epstein, Michael: > Hello all, > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing list, but I can't actually find it. Does anyone have a copy or know where I should look? > > -Michael > > Conserve Resources. Print only when necessary. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip2eeglab.m Type: application/octet-stream Size: 1094 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Mon Mar 18 16:26:24 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Mon, 18 Mar 2013 11:26:24 -0400 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> Message-ID: <2586A1048152BE4D861E64A98700AD420D600042@nki-mail.NKI.rfmh.org> Doesn't work for me, but it gives me something to start with - thank you. -Michael From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Julian Keil Sent: Monday, March 18, 2013 11:20 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] fieldtrip2eeglab Hi Michael, I have a version, but it seems quite old and I have never actually used it. Maybe it's of any help to you. Best, Julian ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Mar 18 16:47:39 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 18 Mar 2013 16:47:39 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: Dear Michael, Perhaps you can find it within EEGlab code? FieldTrip usually includes the *2fieldtrip functions but not the fieldtrip2* functions. Best, Johanna 2013/3/18 Epstein, Michael : > Hello all, > > > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki > (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing > list, but I can't actually find it. Does anyone have a copy or know where I > should look? > > > > -Michael > > ________________________________ > Conserve Resources. Print only when necessary. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > recipient. It may contain confidential information which is legally > privilegedor otherwise protected by law. If you received this e-mail in > error or from someone who is not authorized to send it to you, you are > strictly prohibited from reviewing, using, disseminating, distributing or > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > cooperation. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > recipient. It may contain confidential information which is legally > privileged or otherwise protected by law. If you received this e-mail in > error or from someone who is not authorized to send it to you, you are > strictly prohibited from reviewing, using, disseminating, distributing or > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > cooperation. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From singhharsimrat at gmail.com Mon Mar 18 17:50:56 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 18 Mar 2013 16:50:56 +0000 Subject: [FieldTrip] mytrialfun & ft_read_event Message-ID: Hi All**** ** ** I am trying to read in my data in which the first channel contains the marker signal (spike) superimposed on the trigger channel.**** I would like to use mytrialfun before ft_definetrial. To do this I would like to check the value of the marker channel and compare it with mean value of the channel and record that value in the even field.**** But I guess I can’t do it as the fieldtrip doesn’t read the channel values before ft_definetrial. Can I use data channel values in mytrialfun? If not, is there a way around this?**** ** ** Here is my trialfun**** ** ** function [trl, event] = mytrialfun(cfg)**** ** ** % read the header information and the events from the data**** hdr = ft_read_header(cfg.datafile);**** event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, 'detectflank','up');**** ** ** % search for "trigger" events according to 'trigchannel' defined outside the function The problem lies here ** *value = [event(find(cfg.trialdef.trigchannel (it needs data of this channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); ** ** % creating your own trialdefinition based upon the events**** for j = 1:length(value);**** trlbegin = sample(j) + pretrig;**** trlend = sample(j) + posttrig;**** offset = pretrig;**** newtrl = [ trlbegin trlend offset];**** trl = [ trl; newtrl]; **** end**** ** ** ** ** Thanks in advance**** Best regards**** Harsimrat**** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.schubert at uni-hamburg.de Mon Mar 18 18:14:40 2013 From: jonathan.schubert at uni-hamburg.de (Jonathan Schubert) Date: Mon, 18 Mar 2013 18:14:40 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: Dear Micheal, Johanna seems to be right about the EEGLAB code. There is a function called fieldtripchan2eeglab in the eeglab toolbox. Never tried it before though. Hope that helps. Best, Jonathan 2013/3/18 Johanna Zumer > Dear Michael, > > Perhaps you can find it within EEGlab code? FieldTrip usually > includes the *2fieldtrip functions but not the fieldtrip2* functions. > > Best, > Johanna > > 2013/3/18 Epstein, Michael : > > Hello all, > > > > > > > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki > > (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the > mailing > > list, but I can't actually find it. Does anyone have a copy or know > where I > > should look? > > > > > > > > -Michael > > > > ________________________________ > > Conserve Resources. Print only when necessary. > > > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > > recipient. It may contain confidential information which is legally > > privilegedor otherwise protected by law. If you received this e-mail in > > error or from someone who is not authorized to send it to you, you are > > strictly prohibited from reviewing, using, disseminating, distributing or > > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > > cooperation. > > > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > > recipient. It may contain confidential information which is legally > > privileged or otherwise protected by law. If you received this e-mail in > > error or from someone who is not authorized to send it to you, you are > > strictly prohibited from reviewing, using, disseminating, distributing or > > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > > cooperation. > > > > _______________________________________________ > > 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 > -- Jonathan Schubert, Dipl.-Psych. University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11, Room 301 D-20146 Hamburg Germany - Phone: (49) 40 - 42838 7626 Fax: (49) 40 - 42838 6591 jonathan.schubert at uni-hamburg.de www.bpn.uni-hamburg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstolzbe at uwo.ca Mon Mar 18 19:18:11 2013 From: dstolzbe at uwo.ca (Daniel Stolzberg) Date: Mon, 18 Mar 2013 14:18:11 -0400 Subject: [FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints Message-ID: Hello, I have been working with continuous data trials which begin before the trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when using ft_singleplotER. The error occurs in the raw2timelock subfunction of ft_checkdata after calling ft_singleplotER with a time axis that includes pre-trigger (i.e. < 0) time points. This error may not be for ft_singleplotER, but it is the function I was trying to use. Here is the error: > Subscripted assignment dimension mismatch. > > Error in ft_checkdata>raw2timelock (line 1753) > tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i}; > > Error in ft_checkdata (line 302) > data = raw2timelock(data); > > Error in ft_singleplotER (line 186) > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', 'freq'}); After some debugging, I found that the number of samples used to (re)generate the time vector is always 1 sample too small if there are negative time values. I assume that this is because the time point 0 is not being considered (?). By adding the following line to raw2timelock in ft_checkdata of the most recent build, I was able to get around any errors in this subfunction and all is now copacetic: line 1740: nsmp = nsmp + any(time<0); % <--- acounting for timepoint at 0? I don't know if anyone else has run into this problem but I thought I would share this with the community. Regards, Dan -- Daniel Stolzberg, PhD Post-doctoral Fellow Cerebral Systems Laboratory Department of Physiology and Pharmacology Schulich School of Medicine & Dentistry University of Western Ontario http://www.cerebralsystems.ca/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 19 08:17:49 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 19 Mar 2013 08:17:49 +0100 Subject: [FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints In-Reply-To: References: Message-ID: <5148111D.2010902@donders.ru.nl> HI Daniel, thanks for reporting this. Strange error... but it should not be related to having timepoint before 0. The fix of the time-axis in raw2timelock was implemented because of numerical inaccuracies that can occur across trials. For example, some trials might start at -0.24999 others at -0.25 (this can happen during acquisition or during resampling, etc., also computers make errors, especially when dealing with decimals). When computing a common time-axis, Matlab would compare these two values and treat them as two samples before 0 rather than 1 (which strictly speaking is true). So a common time-axis needs to be build, which is invariant to small differences. Unfortunately, that was not very trivial to accomplish. I've build a test scripts which tests very many different cases for which this function works fine. So first, just to be sure, are you using the most recent version of FieldTrip? Most colleagues in our group including myself are interested in the prestimulus period, so if this was a trivial error, we probably would have found it long time ago ;) However, it might be that it indeed breaks with your data nonetheless due to some reason. Since this might be specific to some few datasets, it would be great if you could send me a snippet of your data (like one or two trials) together with some lines of code to reproduce this error. It is quite nasty to debug this stuff, so in order to not keep you from doing research, just go ahead with the fix you implemented for this one dataset, but be aware that I am pretty sure that it will break for other datasets ;) Best regards, Jörn On 3/18/2013 7:18 PM, Daniel Stolzberg wrote: > Hello, > > I have been working with continuous data trials which begin before the > trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when > using ft_singleplotER. The error occurs in the raw2timelock > subfunction of ft_checkdata after calling ft_singleplotER with a time > axis that includes pre-trigger (i.e. < 0) time points. This error may > not be for ft_singleplotER, but it is the function I was trying to use. > > Here is the error: > > Subscripted assignment dimension mismatch. > > > > Error in ft_checkdata>raw2timelock (line 1753) > > tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i}; > > > > Error in ft_checkdata (line 302) > > data = raw2timelock(data); > > > > Error in ft_singleplotER (line 186) > > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', > 'freq'}); > > After some debugging, I found that the number of samples used to > (re)generate the time vector is always 1 sample too small if there are > negative time values. I assume that this is because the time point 0 > is not being considered (?). By adding the following line to > raw2timelock in ft_checkdata of the most recent build, I was able to > get around any errors in this subfunction and all is now copacetic: > > line 1740: nsmp = nsmp + any(time<0); % <--- acounting for > timepoint at 0? > > I don't know if anyone else has run into this problem but I thought I > would share this with the community. > > Regards, > Dan > > -- > Daniel Stolzberg, PhD > Post-doctoral Fellow > Cerebral Systems Laboratory > Department of Physiology and Pharmacology > Schulich School of Medicine & Dentistry > University of Western Ontario > http://www.cerebralsystems.ca/ > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Tue Mar 19 08:48:51 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Tue, 19 Mar 2013 07:48:51 +0000 Subject: [FieldTrip] MNI template warping to fit the electrode locations Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCED8A@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I use a MNI template as the volume conduction model (vol) as I have no individual MRI files. However I have the electrode locations of the subject. I read my sensor locations with elec = ft_read_sens('sensor_file') and then use [vol_coreg, sens] = ft_prepare_vol_sens(vol, elec) For coregistration of electrodes. When I plot the outer boundary with my sensors it looks as in head.jpg attached image. Shown in blue are the electrode locations of the original file. It seems that the electrodes are shifted upwards , say FP1 for instance is way above the forehead. Is there anything I can do to warp the MNI template volume(vol) to the original electrode locations(shown in blue)? Or am I doing something conceptually wrong here? Can you please tell me what is the correct thing to do with fieldTrip when only electrode location file is available? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Mobile : +61430321972 Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: head.jpg Type: image/jpeg Size: 11740 bytes Desc: head.jpg URL: From r.vandermeij at donders.ru.nl Tue Mar 19 10:47:14 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Tue, 19 Mar 2013 10:47:14 +0100 Subject: [FieldTrip] mytrialfun & ft_read_event In-Reply-To: References: Message-ID: Hi Harsimrat, One way this could be achieved is by reading in the specific channel by calling ft_read_data, just like calling ft_read_event and ft_read_header. On how to specify the call to ft_read_data, please see the documentation/help of the function. Hope it helps, Roemer On Mon, Mar 18, 2013 at 5:50 PM, Harsimrat Singh wrote: > Hi All**** > > ** ** > > I am trying to read in my data in which the first channel contains the > marker signal (spike) superimposed on the trigger channel.**** > > I would like to use mytrialfun before ft_definetrial. To do this I would > like to check the value of the marker channel and compare it with mean > value of the channel and record that value in the even field.**** > > But I guess I can’t do it as the fieldtrip doesn’t read the channel values > before ft_definetrial. Can I use data channel values in mytrialfun? If > not, is there a way around this?**** > > ** ** > > Here is my trialfun**** > > ** ** > > function [trl, event] = mytrialfun(cfg)**** > > ** ** > > % read the header information and the events from the data**** > > hdr = ft_read_header(cfg.datafile);**** > > event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, > 'detectflank','up');**** > > ** ** > > % search for "trigger" events according to 'trigchannel' defined outside > the function > > The problem lies here > > ** > > *value = [event(find(cfg.trialdef.trigchannel (it needs data of this > channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); > > ** ** > > % creating your own trialdefinition based upon the events**** > > for j = 1:length(value);**** > > trlbegin = sample(j) + pretrig;**** > > trlend = sample(j) + posttrig;**** > > offset = pretrig;**** > > newtrl = [ trlbegin trlend offset];**** > > trl = [ trl; newtrl]; **** > > end**** > > ** ** > > ** ** > > Thanks in advance**** > > Best regards**** > > Harsimrat**** > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.vandermeij at donders.ru.nl Tue Mar 19 10:47:14 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Tue, 19 Mar 2013 10:47:14 +0100 Subject: [FieldTrip] mytrialfun & ft_read_event In-Reply-To: References: Message-ID: Hi Harsimrat, One way this could be achieved is by reading in the specific channel by calling ft_read_data, just like calling ft_read_event and ft_read_header. On how to specify the call to ft_read_data, please see the documentation/help of the function. Hope it helps, Roemer On Mon, Mar 18, 2013 at 5:50 PM, Harsimrat Singh wrote: > Hi All**** > > ** ** > > I am trying to read in my data in which the first channel contains the > marker signal (spike) superimposed on the trigger channel.**** > > I would like to use mytrialfun before ft_definetrial. To do this I would > like to check the value of the marker channel and compare it with mean > value of the channel and record that value in the even field.**** > > But I guess I can’t do it as the fieldtrip doesn’t read the channel values > before ft_definetrial. Can I use data channel values in mytrialfun? If > not, is there a way around this?**** > > ** ** > > Here is my trialfun**** > > ** ** > > function [trl, event] = mytrialfun(cfg)**** > > ** ** > > % read the header information and the events from the data**** > > hdr = ft_read_header(cfg.datafile);**** > > event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, > 'detectflank','up');**** > > ** ** > > % search for "trigger" events according to 'trigchannel' defined outside > the function > > The problem lies here > > ** > > *value = [event(find(cfg.trialdef.trigchannel (it needs data of this > channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); > > ** ** > > % creating your own trialdefinition based upon the events**** > > for j = 1:length(value);**** > > trlbegin = sample(j) + pretrig;**** > > trlend = sample(j) + posttrig;**** > > offset = pretrig;**** > > newtrl = [ trlbegin trlend offset];**** > > trl = [ trl; newtrl]; **** > > end**** > > ** ** > > ** ** > > Thanks in advance**** > > Best regards**** > > Harsimrat**** > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Tue Mar 19 15:49:41 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Tue, 19 Mar 2013 14:49:41 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , , Message-ID: Hi, So I tried form the beginning and it fixed the issue. Any ideas why this might be hapenning in the first place? The problem is I already have a freesurfer database with reconstructed surfaces. If there is any fix like a missing transformation that I can compute so I do not have to recon-all again for all subjects. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] Sent: Monday, March 18, 2013 9:49 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" > wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ 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 From hamid.mohseni at eng.ox.ac.uk Tue Mar 19 16:42:51 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Tue, 19 Mar 2013 15:42:51 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk> References: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk> Message-ID: Hi, I had this problem before, and I think it is something with freesurfer: If you plot the original MRI and its segmented volume in freesurfer, you may see that they are not in the same coordinate. I think the best way is to ask freesurfer people, we probably missing a small thing here. Thanks On 19 March 2013 14:49, Doshi, Chiran wrote: > Hi, > So I tried form the beginning and it fixed the issue. Any ideas why this > might be hapenning in the first place? > The problem is I already have a freesurfer database with reconstructed > surfaces. If there is any fix like a missing transformation that I can > compute so I do not have to recon-all again for all subjects. > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] > Sent: Monday, March 18, 2013 9:49 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Thanks for the help, > I will try again from the beginning. I will let know if I am able to get > the fix the issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > Sent: Saturday, March 16, 2013 12:47 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > If you want to do beam former source localization, there is no need to > freesurfer and you can extract the brain shape points from the segmented > MRI using FieldTrip itself and you will not have this problem. > > However, if you want to do minimum norm source localisation, you may do a > realignment before applying free surfer, please see this > > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate > > On Mar 16, 2013 4:23 PM, "Doshi, Chiran" < > Chiran.Doshi at childrens.harvard.edu Chiran.Doshi at childrens.harvard.edu>> wrote: > Hi Hamid, > Thanks for the reply. I see what you mean. > When I import the T1, there is a mri.transform already present in it. This > is generated by the freesurfer. mri.tranform gets changed when I do the > ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , > nas as n and z in the positive z direction. I have vitamin pills at the > fiducials ( some also at the forehead) that would help in marking the > points. > > I cannot figure out where am I messing up. Also I am using the src file in > MNE and I do not have this issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > ________________________________ > From: fieldtrip-bounces at science.ru.nl fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl fieldtrip-bounces at science.ru.nl>] on behalf of Hamid Mohseni [ > hamid.mohseni at eng.ox.ac.uk] > Sent: Saturday, March 16, 2013 11:28 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Hi, > > I THINK there is a problem with your mri.transform matrix. Basically, > without any pre-processing, when you apply this transformation to the > headshape points 'bnd', it should match the original mri. I checked that > and apparently it dosen't happen. How did you obtain this transformation? > > Thanks > > > > On 15 March 2013 22:07, Doshi, Chiran > wrote: > Hello FieldTrip users, > > I am having trouble aligning volume conduction model with source model > > The link to the data is > https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi > > Here are the steps I followed > > % Read mri > mri = ft_read_mri('T1.mgz'); > > % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s > and origin as i. At the end mri.coordsys was equal to 'neuromag' > mri = ft_determine_coordsys(mri); > > % Align volume. Selected l, r, l and z in + z direction > cfg=[]; > cfg.coordsys='neuromag'; > mri = ft_volumerealign(cfg,mri); > > %Volume segment > cfg=[]; > cfg.coordsys='neuromag'; > cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; > seg = ft_volumesegment(cfg, mri); > > % Prepare head model. The model aligns well with sensors > cfg=[]; > cfg.coordsys='neuromag'; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > % compute sourcespace > bnd = > ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); > T = mri.transform*inv(mri.transformorig); > sourcespace = ft_transform_geometry(T, bnd); > > % Plot > figure;hold on; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > > > > These surfaces do not align. Any ideas? > > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > 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 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Tue Mar 19 16:56:04 2013 From: russgport at gmail.com (Russell G Port) Date: Tue, 19 Mar 2013 10:56:04 -0500 Subject: [FieldTrip] Inner matrix mismatch in source interpolate In-Reply-To: <5142e35f.c46f0e0a.2db7.fffff846SMTPIN_ADDED_BROKEN@mx.google.com> References: <5142e35f.c46f0e0a.2db7.fffff846SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Thanks Jim, That was exactly what was wrong. Sorry for the delayed response. I mistakenly thought that the leadfield function would create a grid (which it can, but I forgot to put in a cfg.resolution). On Fri, Mar 15, 2013 at 4:01 AM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Hi Russ,**** > > ** ** > > I ran into a similar error which was avoided by following the steps in the > *extended* beamformer tutorial ( > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended). The problem > seems to rather be that ft_sourceinterpolate wrongly detects your > functional data as being 2 dimensional (if I remember correctly) because a > .dim field is not present. I did not have the time yet to find-out if it is > a problem with the other beamformer tutorial or an actual bug.**** > > ** ** > > In any case, if I compare the steps in the extended beamformer tutorial > with the steps you took I noticed that in the extended beamformer tutorial > a sourcemodel (ft_prepare_sourcemodel) is calculated after calculating the > headmodel, which is then used to calculate the leadfield > (ft_prepare_leadfield), followed by using this leadfield in > ft_sourceanalysis. Could you try and see if that works? **** > > ** ** > > Best,**** > > ** ** > > Jim**** > > ** ** > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Russell G Port > *Sent:* vrijdag 15 maart 2013 0:18 > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Inner matrix mismatch in source interpolate**** > > ** ** > > Hi Fieldtrippers,**** > > ** ** > > When running ft source interpolate on my CTF MEG data, I get an error > where it reaches line 237; tmp = interpmat*tmp. The error is an inner > matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 > matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 > matrix of power at the leaderfield coordinates. If this is just matrix > math, then I assume the problem is just that the matrix have to be mxn and > nxp. Is there any reason I cannot just use tmp=tmp' to make the inner > dimensions match?**** > > ** ** > > Cheers Russ**** > > ** ** > > ---------- Forwarded message ---------- > From: *Russell G Port* > Date: Sat, Mar 9, 2013 at 8:38 PM > Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree > To: FieldTrip discussion list > > > Hi Fieldtrippers, > > I have a slight issue that I was hoping someone can help with. I have some > CTF data, that I was trying to perform DICS beamforming and then source > interpolation on. I am trying to beamform to the source of gamma frequency > in the right hemisphere, comparing pre and post stimuli. Heres the basic > script: > > *People can skip the first part of code, I included it as possibly useful > information for this plead > * > %%%%% Data has already been preprocessed and timelocked%%%%%% > > load('processed_data_500Hz.mat') > load('timelock_data_500Hz.mat') > > %%%% following the beamforming tutorial %%%%%%% > > %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% > > cfg = []; > cfg.toilim = baseline; > cfg.channel=channel > total_bsl = ft_redefinetrial(cfg, data); > > > cfg = []; > cfg.toilim = interest; > cfg.channel=channel > total_interest = ft_redefinetrial(cfg, data); > > cfg = []; > total_cmb = ft_appenddata(cfg, total_bsl, total_interest); > > total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); > ones(length(total_interest.trial), 1)]; > > > %%%%%%%%%%%%%cross spectrial density for dics and tf for common > filter%%%%%%%%%%%%%% > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqPre_total = ft_freqanalysis(cfg, total_bsl); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqPost_total = ft_freqanalysis(cfg, total_interest); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqALL_total = ft_freqanalysis(cfg, total_cmb); > > > %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% > > % > T=ft_read_mri('R128_V2.mri') > > cfg.fiducial.nas = T.hdr.fiducial.mri.nas > cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa > cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa > cfg.method = 'fiducial' > cfg.coordsys = 'ctf' > > [mri] = ft_volumerealign(cfg, T) > > cfg = []; > cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, > see below > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > vol = ft_convert_units(hdm, 'cm'); > > %%%%%%%%%%%%%%% > > > cfg = []; > cfg.grad = freqPost_total.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = 'MR' > [grid] = ft_prepare_leadfield(cfg); > > > > *Upto this point everything works. My volume conduction model, grads, and > grid looks good when verified visually... > > I then compute the common filter and apply it to the beamforming of each > condition* > > > %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% > > cfg = []; > cfg.method = 'dics'; > cfg.grad = freqALL_total.grad; > cfg.keeptrials = 'yes'; > cfg.frequency = freqALL_total.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.realfilter = 'yes'; > cfg.channel = 'MR' > sourceAll = ft_sourceanalysis(cfg, freqALL_total); > > %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% > > cfg.grid.filter = sourceAll.avg.filter; > cfg.grid = grid; > sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); > sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); > > > %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% > > sourceDiff = sourcePost_con; > sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ > sourcePre_con.avg.pow; > > > > *Heres where it falls apart, because I try to source interpolate* > > > %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% > > % slicemri = ft_volumereslice([], mri); > % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with > the current problem > * > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > cfg.coordsys = 'ctf'; > cfg.channel = 'MR' > source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also > tried segmentedmri, but no difference > > It works until it reachs line 237; tmp = interpmat*tmp; where there is > the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 > matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp > is sourceDiff.avg.pow (the power difference for each leadfield point). > interpmat is the interpolation matrix return by > > interpmat = interp_ungridded(functional.pos *(position of the leadfield > locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), > 'sphereradius', cfg.sphereradius) (0.*05*); > > what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield > position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), > :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 > matrix= 1), as a result of the defaults in ft_checkdata*. > > When I try to find the minimum value in this matrix I get (via > min(interpmat) = All zero sparse: 1-by-642 > > I think what is supposed to happen is that the interpmat is a matrix that > relates meg to mri space, and as such then mutlipling with a vector that > represents the power in meg space, I can see how that would get points of > power in mri space. Though this must be wrong since the math is not > allowed.... I cannot see where I went off the beaten track. It seems as if > other people have not had this problem. > > Sorry for the bother, > > Russ Port > > Graduate Student @ Upenn > > > P.S. thanks to anyone who tries to help in advance... > > > > > > > > **** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.C.Schouten at tudelft.nl Wed Mar 20 09:03:35 2013 From: A.C.Schouten at tudelft.nl (Alfred Schouten - 3ME) Date: Wed, 20 Mar 2013 08:03:35 +0000 Subject: [FieldTrip] Postdoc position - TU Delft, the Netherlands Message-ID: The Department of Biomechanical Engineering is seeking a full-time post-doc for the advanced ERC Research Project ³4D-EEG: A new tool to investigate the spatial and temporal activity patterns in the brain². 4D-EEG is a highly prestigious project to develop a novel method for investigating brain activity in humans. The first goal of the project is to develop a new tool to determine brain activity at a high temporal and spatial resolution, with the focus on motor control. The method combines high density EEG and EEG source localization with advanced robot manipulators to impose precise perturbations to the joints. Using system identification, the dynamic response of brain areas to the perturbation will be assessed, leading to a functional interpretation of the EEG with time. 4D-EEG will provide a direct measure of the neural activity in the brain related to motor control tasks. The second goal is to generate and validate new hypotheses about the longitudinal relationship between motor learning and neuroplasticity in patients suffering from a stroke. The non-invasive 4D-EEG technique combined with haptic robots will open a window into what and how patients (re)learn when showing motor recovery after stroke, in order to develop more effective patient-tailored therapies in neuro-rehabilitation. A further aim is to link these functional results with structural measurements, like DTI. You will bring in your expertise in EEG recording and EEG source localization, and will work in a multidisciplinary team consisting of six PhD students and one other postdoc, divided over TU Delft and the VU medical center in Amsterdam. Your main objective will be to incorporate EEG source localization with our system identification techniques. You will provide guidance to three PhD students working on EEG source localization and system identification. We are looking for an independent mind, who takes initiative in a team, is able to translate high-level goals into small packages, and can provide guidance to PhD and MSc students. Requirements The project consists of five subprojects, each requiring specific expertise. At this moment we are looking for a post-doc with extensive expertise in EEG and source localization methods. You should have an affinity for experiments involving human subjects, have extensive programming skills (e.g. Matlab or C++), and preferably experience in one or more of the following fields: data acquisition and processing of electrophysiological and biomechanical signals, system identification and control engineering, or neuroimaging. You should have a PhD in a relevant field, like Biomedical, Mechanical or Electrical Engineering or in (applied) Mathematics, Physics, or Neuroscience. Excellent knowledge of English is a prerequisite. Conditions of employment We offer a challenging postdoc position within the 4D-EEG project. The position is initially for two-years, with the possibility to extend the contract for one or two years after a midterm evaluation. TU Delft offers an attractive benefits package, including a flexible workweek, free high-speed Internet access from home (with contracts of two years or longer), and the option of assembling a customized compensation and benefits package (the 'IKA'). Salary and benefits are in accordance with the Collective Labour Agreement for Dutch Universities. Information and application For more information about this position, please contact Dr. A. C. Schouten, e-mail: a.c.schouten at tudelft.nl. To apply, please e-mail a detailed CV along with a letter of application by May 1, 2013 to M.J.B. Kole, application-3mE at tudelft.nl. When applying for this position, please refer to vacancy number 3ME13-11. From eelke.spaak at donders.ru.nl Wed Mar 20 10:01:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Mar 2013 10:01:54 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics Message-ID: Dear FieldTrip community, Short version: if you did ft_freqstatistics across subjects with a different channel ordering across data sets (which is the case if you use ft_channelrepair), your results might have been erroneous. Read the following carefully. Yesterday, we discovered a possibly severe bug in a utility function (ft_selectdata_old) which was used by ft_freqstatistics. The bug entails that ft_selectdata_old assumes that the channels in all data input arguments are ordered identically, and does not take into account the order of the data.label field. This means that when several data input arguments with different channel orderings are passed to ft_selectdata_old, the resulting output structure (with a newly added 'rpt' dimension) will contain wrong data (i.e. data for channel X might end up in another channel Y). Importantly, the same thus holds for ft_freqstatistics: when doing statistics across subjects, if the different subjects' data sets have different channel orderings, the resulting statistics will be wrong. We expect that in many cases, the channel ordering across different data sets will be identical, and in those cases this bug will not have had any effect. However, one important case in which channel ordering *will* be different is when one does ft_channelrepair on a data set, since this function appends the repaired channels to the end of the data. So, if you have done ft_channelrepair on only a subset of your subjects' data, and/or used ft_channelrepair to repair different channels in different subjects, and subsequently passed the repaired data sets to ft_freqstatistics, there is a good chance the results you got were wrong. Most likely, this bug was introduced with revision 4101, in september 2011, so it has been in the code for quite a while. Note that ft_channelrepair only supports repairing missing channels since revision 5216 (february 2012), and that this was advised against until revision 6100 (june 2012), when the algorithm for doing so sensibly was implemented. The fix has been implemented and is now available from the FTP server as of fieldtrip-20130319 (Donders users: the fix is automatically available on the /home/common/ version of FieldTrip). Note that ft_selectdata_old still does not work correctly, this is something we will fix in the near future (ft_selectdata_old is deprecated). We fixed the behaviour of ft_appendfreq (the preferred replacement function for ft_selectdata_old when appending freq structures) and changed ft_freqstatistics to use this function instead. The other statistics functions, ft_timelockstatistics and ft_sourcestatistics, were not affected by this bug. We strongly advise you to upgrade to the latest version of FieldTrip. If the situation described above applies to you, you will need to redo your channel-level (time-)frequency statistics analyses. Details on the bug (and a test script) can be found here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any problems related to the bug, please post them there. We sincerely apologise for this bug and any trouble it might have caused. Best, On behalf of the FT core development team, Eelke From eelke.spaak at donders.ru.nl Wed Mar 20 14:49:15 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Mar 2013 14:49:15 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: Message-ID: Dear all, A short PS: Unfortunately, we found a remaining piece of bug in ft_freqstatistics, related to the same issue (and relevant under the same circumstances). This has now also been fixed, and should be available as of *tonight*'s FTP release, so fieldtrip-20130320. Apologies again, best, Eelke On 20 March 2013 10:01, Eelke Spaak wrote: > Dear FieldTrip community, > > Short version: if you did ft_freqstatistics across subjects with a > different channel ordering across data sets (which is the case if you > use ft_channelrepair), your results might have been erroneous. Read > the following carefully. > > Yesterday, we discovered a possibly severe bug in a utility function > (ft_selectdata_old) which was used by ft_freqstatistics. The bug > entails that ft_selectdata_old assumes that the channels in all data > input arguments are ordered identically, and does not take into > account the order of the data.label field. This means that when > several data input arguments with different channel orderings are > passed to ft_selectdata_old, the resulting output structure (with a > newly added 'rpt' dimension) will contain wrong data (i.e. data for > channel X might end up in another channel Y). Importantly, the same > thus holds for ft_freqstatistics: when doing statistics across > subjects, if the different subjects' data sets have different channel > orderings, the resulting statistics will be wrong. > > We expect that in many cases, the channel ordering across different > data sets will be identical, and in those cases this bug will not have > had any effect. However, one important case in which channel ordering > *will* be different is when one does ft_channelrepair on a data set, > since this function appends the repaired channels to the end of the > data. So, if you have done ft_channelrepair on only a subset of your > subjects' data, and/or used ft_channelrepair to repair different > channels in different subjects, and subsequently passed the repaired > data sets to ft_freqstatistics, there is a good chance the results you > got were wrong. > > Most likely, this bug was introduced with revision 4101, in september > 2011, so it has been in the code for quite a while. Note that > ft_channelrepair only supports repairing missing channels since > revision 5216 (february 2012), and that this was advised against until > revision 6100 (june 2012), when the algorithm for doing so sensibly > was implemented. > > The fix has been implemented and is now available from the FTP server > as of fieldtrip-20130319 (Donders users: the fix is automatically > available on the /home/common/ version of FieldTrip). Note that > ft_selectdata_old still does not work correctly, this is something we > will fix in the near future (ft_selectdata_old is deprecated). We > fixed the behaviour of ft_appendfreq (the preferred replacement > function for ft_selectdata_old when appending freq structures) and > changed ft_freqstatistics to use this function instead. > > The other statistics functions, ft_timelockstatistics and > ft_sourcestatistics, were not affected by this bug. We strongly advise > you to upgrade to the latest version of FieldTrip. If the situation > described above applies to you, you will need to redo your > channel-level (time-)frequency statistics analyses. > > Details on the bug (and a test script) can be found here: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > problems related to the bug, please post them there. > > We sincerely apologise for this bug and any trouble it might have caused. > > Best, > On behalf of the FT core development team, > > Eelke From Chiran.Doshi at childrens.harvard.edu Wed Mar 20 16:00:34 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Wed, 20 Mar 2013 15:00:34 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk>, Message-ID: Will do, Thanks!! Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Tuesday, March 19, 2013 11:51 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I had this problem before, and I think it is something with freesurfer: If you plot the original MRI and its segmented volume in freesurfer, you may see that they are not in the same coordinate. I think the best way is to ask freesurfer people, we probably missing a small thing here. Thanks On 19 March 2013 14:49, Doshi, Chiran > wrote: Hi, So I tried form the beginning and it fixed the issue. Any ideas why this might be hapenning in the first place? The problem is I already have a freesurfer database with reconstructed surfaces. If there is any fix like a missing transformation that I can compute so I do not have to recon-all again for all subjects. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] Sent: Monday, March 18, 2013 9:49 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" >> wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl>] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk>] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran >> wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ 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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 From inieuwenhuis at berkeley.edu Wed Mar 20 20:55:49 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 20 Mar 2013 12:55:49 -0700 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: Message-ID: <514A1445.50007@berkeley.edu> Hi Eelke, Thanks for reporting. I did do ft_channelrepair on my EEG data for some subjects and subsequently used ft_freqstatistics. However, the channel order is indentical in all my subjects in the freq. I repaired bad channels using the default setting (method='nearest'). The bad channels were included in the input data to ft_channelrepair (so they were not missing). I just checked, and in data_out after ft_channelrepair, the order of the labels of the data is identical to the data_in, thus the repaired channels were NOT appended to the end of the data. So apparently ft_channelrepair not always appends the repaired channels at the end. I suppose this is good news for me, meaning that the bug did not affect me, since the channels were ordered identically when calling ft_freqstatistics. Do you agree, or am I missing something? And for others that used ft_channelrepair, might be worth checking if the ordering is indeed changed after calling it, because it appears not always to be the case. Thanks, Ingrid On 3/20/2013 2:01 AM, Eelke Spaak wrote: > Dear FieldTrip community, > > Short version: if you did ft_freqstatistics across subjects with a > different channel ordering across data sets (which is the case if you > use ft_channelrepair), your results might have been erroneous. Read > the following carefully. > > Yesterday, we discovered a possibly severe bug in a utility function > (ft_selectdata_old) which was used by ft_freqstatistics. The bug > entails that ft_selectdata_old assumes that the channels in all data > input arguments are ordered identically, and does not take into > account the order of the data.label field. This means that when > several data input arguments with different channel orderings are > passed to ft_selectdata_old, the resulting output structure (with a > newly added 'rpt' dimension) will contain wrong data (i.e. data for > channel X might end up in another channel Y). Importantly, the same > thus holds for ft_freqstatistics: when doing statistics across > subjects, if the different subjects' data sets have different channel > orderings, the resulting statistics will be wrong. > > We expect that in many cases, the channel ordering across different > data sets will be identical, and in those cases this bug will not have > had any effect. However, one important case in which channel ordering > *will* be different is when one does ft_channelrepair on a data set, > since this function appends the repaired channels to the end of the > data. So, if you have done ft_channelrepair on only a subset of your > subjects' data, and/or used ft_channelrepair to repair different > channels in different subjects, and subsequently passed the repaired > data sets to ft_freqstatistics, there is a good chance the results you > got were wrong. > > Most likely, this bug was introduced with revision 4101, in september > 2011, so it has been in the code for quite a while. Note that > ft_channelrepair only supports repairing missing channels since > revision 5216 (february 2012), and that this was advised against until > revision 6100 (june 2012), when the algorithm for doing so sensibly > was implemented. > > The fix has been implemented and is now available from the FTP server > as of fieldtrip-20130319 (Donders users: the fix is automatically > available on the /home/common/ version of FieldTrip). Note that > ft_selectdata_old still does not work correctly, this is something we > will fix in the near future (ft_selectdata_old is deprecated). We > fixed the behaviour of ft_appendfreq (the preferred replacement > function for ft_selectdata_old when appending freq structures) and > changed ft_freqstatistics to use this function instead. > > The other statistics functions, ft_timelockstatistics and > ft_sourcestatistics, were not affected by this bug. We strongly advise > you to upgrade to the latest version of FieldTrip. If the situation > described above applies to you, you will need to redo your > channel-level (time-)frequency statistics analyses. > > Details on the bug (and a test script) can be found here: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > problems related to the bug, please post them there. > > We sincerely apologise for this bug and any trouble it might have caused. > > Best, > On behalf of the FT core development team, > > Eelke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From ricardoojm at gmail.com Thu Mar 21 01:42:34 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Wed, 20 Mar 2013 21:42:34 -0300 Subject: [FieldTrip] finding gradiometer Message-ID: Dear all, I am trying to run a source localization analysis of eeg oscillatory activity. My data was recorded by a BrainAmp, and I exported using the brainvision analyzer. Since I am very new to fieldtrip, I have a (probably very basic) doubt, and would be really glad if someone could help me. First, when creating the leadfield, it asks for the gradiometer (cfg.grad), but I didnt figure out where I can find it. I checked the "localizing oscillatory sources using beamformer techniques" tutorial, and it seems that it can be recovered as an output of the "ft_freqanalysis" (since there is a "cfg.grad = freqPost.grad" definition), but I didnt manage to have it, even running the same parameters as in the tutorial. Here is how I am doing the oscillatory analysis. cfg = []; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 2:2:20; cfg.toi = -0.5:0.05:1; TFR = ft_freqanalysis(cfg, dataEEGmax); Thanks a lot in advance, Best regards, Ricardo -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Mar 21 08:22:26 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 21 Mar 2013 08:22:26 +0100 Subject: [FieldTrip] finding gradiometer In-Reply-To: References: Message-ID: Hi Ricardo, try cfg.elec rather than cfg.grad. also ft_freqanalysis does not "recover" electrode positions, at least that would be a feature of wavelets new to me :-) you need to give fieldtrip the electrode positions: with MEG data they are usually automatically read when doing ft_preprocessing. otherwise you need to read the info (e.g. from a polhemus file) using ft_read_sens. if you don not have digitized positions, i guess that for most standard caps there are standard electrode positions in fieldtrip. good luck, n On 21.03.2013, at 01:42, Ricardo Moura wrote: > Dear all, > I am trying to run a source localization analysis of eeg oscillatory activity. My data was recorded by a BrainAmp, and I exported using the brainvision analyzer. > > Since I am very new to fieldtrip, I have a (probably very basic) doubt, and would be really glad if someone could help me. > > First, when creating the leadfield, it asks for the gradiometer (cfg.grad), but I didnt figure out where I can find it. I checked the "localizing oscillatory sources using beamformer techniques" tutorial, and it seems that it can be recovered as an output of the "ft_freqanalysis" (since there is a "cfg.grad = freqPost.grad" definition), but I didnt manage to have it, even running the same parameters as in the tutorial. > > Here is how I am doing the oscillatory analysis. > cfg = []; > cfg.method = 'wavelet'; > cfg.width = 2; > cfg.output = 'pow'; > cfg.foi = 2:2:20; > cfg.toi = -0.5:0.05:1; > TFR = ft_freqanalysis(cfg, dataEEGmax); > > Thanks a lot in advance, > Best regards, > Ricardo > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Thu Mar 21 09:34:29 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 21 Mar 2013 09:34:29 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: <514A1445.50007@berkeley.edu> References: <514A1445.50007@berkeley.edu> Message-ID: Hi Ingrid, Thanks for your question; it made me realize that my e-mail was not clear enough. In your case, when you repaired channels that were still present in the data, the output channel order of ft_channelrepair will be the same as the input channel order. The problem only occurs if you use ft_channelrepair to repair *missing* channels, so e.g. channels switched off during acquisition or that were discarded during preprocessing. Groeten, Eelke On 20 March 2013 20:55, Ingrid Nieuwenhuis wrote: > Hi Eelke, > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > subjects and subsequently used ft_freqstatistics. However, the channel order > is indentical in all my subjects in the freq. > > I repaired bad channels using the default setting (method='nearest'). The > bad channels were included in the input data to ft_channelrepair (so they > were not missing). I just checked, and in data_out after ft_channelrepair, > the order of the labels of the data is identical to the data_in, thus the > repaired channels were NOT appended to the end of the data. So apparently > ft_channelrepair not always appends the repaired channels at the end. I > suppose this is good news for me, meaning that the bug did not affect me, > since the channels were ordered identically when calling ft_freqstatistics. > Do you agree, or am I missing something? And for others that used > ft_channelrepair, might be worth checking if the ordering is indeed changed > after calling it, because it appears not always to be the case. > > Thanks, > Ingrid > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> Dear FieldTrip community, >> >> Short version: if you did ft_freqstatistics across subjects with a >> different channel ordering across data sets (which is the case if you >> use ft_channelrepair), your results might have been erroneous. Read >> the following carefully. >> >> Yesterday, we discovered a possibly severe bug in a utility function >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> entails that ft_selectdata_old assumes that the channels in all data >> input arguments are ordered identically, and does not take into >> account the order of the data.label field. This means that when >> several data input arguments with different channel orderings are >> passed to ft_selectdata_old, the resulting output structure (with a >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> channel X might end up in another channel Y). Importantly, the same >> thus holds for ft_freqstatistics: when doing statistics across >> subjects, if the different subjects' data sets have different channel >> orderings, the resulting statistics will be wrong. >> >> We expect that in many cases, the channel ordering across different >> data sets will be identical, and in those cases this bug will not have >> had any effect. However, one important case in which channel ordering >> *will* be different is when one does ft_channelrepair on a data set, >> since this function appends the repaired channels to the end of the >> data. So, if you have done ft_channelrepair on only a subset of your >> subjects' data, and/or used ft_channelrepair to repair different >> channels in different subjects, and subsequently passed the repaired >> data sets to ft_freqstatistics, there is a good chance the results you >> got were wrong. >> >> Most likely, this bug was introduced with revision 4101, in september >> 2011, so it has been in the code for quite a while. Note that >> ft_channelrepair only supports repairing missing channels since >> revision 5216 (february 2012), and that this was advised against until >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> was implemented. >> >> The fix has been implemented and is now available from the FTP server >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> available on the /home/common/ version of FieldTrip). Note that >> ft_selectdata_old still does not work correctly, this is something we >> will fix in the near future (ft_selectdata_old is deprecated). We >> fixed the behaviour of ft_appendfreq (the preferred replacement >> function for ft_selectdata_old when appending freq structures) and >> changed ft_freqstatistics to use this function instead. >> >> The other statistics functions, ft_timelockstatistics and >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> you to upgrade to the latest version of FieldTrip. If the situation >> described above applies to you, you will need to redo your >> channel-level (time-)frequency statistics analyses. >> >> Details on the bug (and a test script) can be found here: >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> problems related to the bug, please post them there. >> >> We sincerely apologise for this bug and any trouble it might have caused. >> >> Best, >> On behalf of the FT core development team, >> >> Eelke >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From t.w.kononowicz at rug.nl Thu Mar 21 19:23:38 2013 From: t.w.kononowicz at rug.nl (T.W. Kononowicz) Date: Thu, 21 Mar 2013 19:23:38 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate Message-ID: Dear FieldTrip users, I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. cfg = []; cfg.method = 'mne'; cfg.grid = grid; cfg.vol = template_vol; cfg.grad = grad; cfg.projectnoise = 'yes'; cfg.reducerank = 'no'; cfg.mne.lambda = 1e8; repr2_mne = ft_sourceanalysis(cfg, repr2_cov); The repr2_mne structure looks as follows: >> repr2_mne repr2_mne = dim: [15 15 14] time: [1x1751 double] pos: [3150x3 double] inside: [1x1613 double] outside: [1x1537 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] >> repr2_mne.avg ans = mom: {1x3150 cell} pow: [3150x1751 double] noisecov: {1x3150 cell} As the next step I call the ft_sourceinterpolate: cfg=[]; cfg.interpmethod='linear'; cfg.parameter='avg.pow'; cfg.downsample = 2; cfg.feedback='yes'; repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); Then I get the following display message. the input is source data with 3150 positions on a [15 15 14] grid the input is volume data with dimensions [91 109 91] updating homogenous coordinate transformation matrix downsampling anatomy downsampling inside the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB selecting subvolume of 34.7% reslicing and interpolating avg.pow After that the code crashes and I get the error: ??? Error using ==> interpn at 155 Wrong number of input arguments or some dimension of V is less than 2. Error in ==> ft_sourceinterpolate>my_interpn at 494 av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); Error in ==> ft_sourceinterpolate at 397 av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); Just before crush in line 397 of ft_sourceinterpolate: av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are: size(fv) ans = 3150 1751 ax, ay, az, are: size(ay) ans = 46 55 46 size(sel) ans = 116380 1 I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here? Thank you in advance for you help, Tadeusz W. Kononowicz -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhharsimrat at gmail.com Thu Mar 21 20:08:16 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Thu, 21 Mar 2013 19:08:16 +0000 Subject: [FieldTrip] K-fold classification Multivariate Analysis Message-ID: Hello All A question @ the k-fold classification . Does cfg.method = 'crossvalidate'; randomize the trials when it builds the folds? And does each fold contains representative of each class? OR Do I need to do this manually before I feed the data to ft_freqstatistics? Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.simanova at mpi.nl Fri Mar 22 08:11:20 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Fri, 22 Mar 2013 08:11:20 +0100 Subject: [FieldTrip] K-fold classification Multivariate Analysis In-Reply-To: References: Message-ID: <706F1C72-F1BD-473B-B2B0-79AC534B374A@mpi.nl> Dear Harsimrat, yes, the method does randomize trials. and each fold has trials of each class. You can check the 'trainfolds' field in the statistic's output. The indexes of trials assigned to each fold are stored there. best, Irina On Mar 21, 2013, at 8:08 PM 3/21/13, Harsimrat Singh wrote: > Hello All > > A question @ the k-fold classification > . > Does cfg.method = 'crossvalidate'; randomize the trials when it > builds the folds? And does each fold contains representative of each > class? > > OR > > Do I need to do this manually before I feed the data to > ft_freqstatistics? > > Best regards > Harsimrat > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Fri Mar 22 13:58:22 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Fri, 22 Mar 2013 12:58:22 +0000 Subject: [FieldTrip] Fwd: [SPM] UK MEG PhD studentships In-Reply-To: <4D3B09BC4D279A438B88696310A1B97D1FA7697A@AMSPRD0111MB483.eurprd01.prod.exchangelabs.com> References: <4D3B09BC4D279A438B88696310A1B97D1FA7697A@AMSPRD0111MB483.eurprd01.prod.exchangelabs.com> Message-ID: ---------- Forwarded message ---------- From: Barnes, Gareth Date: Fri, Mar 22, 2013 at 12:13 PM Subject: [SPM] UK MEG PhD studentships To: SPM at jiscmail.ac.uk Dear All The UK is recruiting a cohort of MEG PhD students. Could you pass this on to any potential candidates please. Best Gareth -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: UKMRCstudentships.pdf Type: application/pdf Size: 90537 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Fri Mar 22 16:00:39 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 22 Mar 2013 16:00:39 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate In-Reply-To: References: Message-ID: <514C7217.6050609@donders.ru.nl> Dear Tadeusz, does it work when you leave out cfg.downsample or with another interpolation method? Best, Jörn On 3/21/2013 7:23 PM, T.W. Kononowicz wrote: > Dear FieldTrip users, > > I am trying to do some source reconstruction on ERF data (version: > fieldtrip-20130320). Everything seems to work quite well up to > ft_sourceinterpolate. > > > cfg = []; > > cfg.method = 'mne'; > > cfg.grid = grid; > > cfg.vol = template_vol; > > cfg.grad = grad; > > cfg.projectnoise = 'yes'; > > cfg.reducerank = 'no'; > > cfg.mne.lambda = 1e8; > > repr2_mne = ft_sourceanalysis(cfg, repr2_cov); > > > The repr2_mne structure looks as follows: > >> repr2_mne > repr2_mne = > dim: [15 15 14] > time: [1x1751 double] > pos: [3150x3 double] > inside: [1x1613 double] > outside: [1x1537 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > >> repr2_mne.avg > ans = > mom: {1x3150 cell} > pow: [3150x1751 double] > noisecov: {1x3150 cell} > > > As the next step I call the ft_sourceinterpolate: > > cfg=[]; > > cfg.interpmethod='linear'; > > cfg.parameter='avg.pow'; > > cfg.downsample = 2; > > cfg.feedback='yes'; > > repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); > > > Then I get the following display message. > > the input is source data with 3150 positions on a [15 15 14] grid > > the input is volume data with dimensions [91 109 91] > > updating homogenous coordinate transformation matrix > > downsampling anatomy > > downsampling inside > > the call to "ft_volumedownsample" took 0 seconds and required the > additional allocation of an estimated 0 MB > > selecting subvolume of 34.7% > > reslicing and interpolating avg.pow > > > After that the code crashes and I get the error: > > > ??? Error using ==> interpn at 155 > > Wrong number of input arguments or some dimension of V is less than 2. > > > Error in ==> ft_sourceinterpolate>my_interpn at 494 > > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > > Error in ==> ft_sourceinterpolate at 397 > > av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), > cfg.interpmethod, > > cfg.feedback); > > > Just before crush in line 397 of ft_sourceinterpolate: av( sel) = > my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, > cfg.feedback); argument's size are: > > size(fv) > ans = > 3150 1751 > > ax, ay, az, are: > > size(ay) > > ans = > > 46 55 46 > > > size(sel) > > ans = > > 116380 1 > > > I found one similar post on the list, however its not helpful in that > case. Does anyone can spot what I'm missing here? > > > Thank you in advance for you help, > > > Tadeusz W. Kononowicz > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.w.kononowicz at rug.nl Sat Mar 23 12:16:40 2013 From: t.w.kononowicz at rug.nl (T.W. Kononowicz) Date: Sat, 23 Mar 2013 12:16:40 +0100 Subject: [FieldTrip] fieldtrip Digest, Vol 28, Issue 46 In-Reply-To: Message-ID: Dear Jorn, After leaving out cfg.downsample all interpolation methods result in the same error. Tadeusz From: Reply-To: Date: Saturday, March 23, 2013 12:00 PM To: Subject: fieldtrip Digest, Vol 28, Issue 46 > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: Problem with interpn function in ft_sourceinterpolate > (J?rn M. Horschig) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 22 Mar 2013 16:00:39 +0100 > From: "J?rn M. Horschig" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with interpn function in > ft_sourceinterpolate > Message-ID: <514C7217.6050609 at donders.ru.nl> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Dear Tadeusz, > > does it work when you leave out cfg.downsample or with another > interpolation method? > > Best, > J?rn > > > On 3/21/2013 7:23 PM, T.W. Kononowicz wrote: >> Dear FieldTrip users, >> >> I am trying to do some source reconstruction on ERF data (version: >> fieldtrip-20130320). Everything seems to work quite well up to >> ft_sourceinterpolate. >> >> >> cfg = []; >> >> cfg.method = 'mne'; >> >> cfg.grid = grid; >> >> cfg.vol = template_vol; >> >> cfg.grad = grad; >> >> cfg.projectnoise = 'yes'; >> >> cfg.reducerank = 'no'; >> >> cfg.mne.lambda = 1e8; >> >> repr2_mne = ft_sourceanalysis(cfg, repr2_cov); >> >> >> The repr2_mne structure looks as follows: >>>> >> repr2_mne >> repr2_mne = >> dim: [15 15 14] >> time: [1x1751 double] >> pos: [3150x3 double] >> inside: [1x1613 double] >> outside: [1x1537 double] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >>>> >> repr2_mne.avg >> ans = >> mom: {1x3150 cell} >> pow: [3150x1751 double] >> noisecov: {1x3150 cell} >> >> >> As the next step I call the ft_sourceinterpolate: >> >> cfg=[]; >> >> cfg.interpmethod='linear'; >> >> cfg.parameter='avg.pow'; >> >> cfg.downsample = 2; >> >> cfg.feedback='yes'; >> >> repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); >> >> >> Then I get the following display message. >> >> the input is source data with 3150 positions on a [15 15 14] grid >> >> the input is volume data with dimensions [91 109 91] >> >> updating homogenous coordinate transformation matrix >> >> downsampling anatomy >> >> downsampling inside >> >> the call to "ft_volumedownsample" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> >> selecting subvolume of 34.7% >> >> reslicing and interpolating avg.pow >> >> >> After that the code crashes and I get the error: >> >> >> ??? Error using ==> interpn at 155 >> >> Wrong number of input arguments or some dimension of V is less than 2. >> >> >> Error in ==> ft_sourceinterpolate>my_interpn at 494 >> >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >> >> >> Error in ==> ft_sourceinterpolate at 397 >> >> av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), >> cfg.interpmethod, >> >> cfg.feedback); >> >> >> Just before crush in line 397 of ft_sourceinterpolate: av( sel) = >> my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, >> cfg.feedback); argument's size are: >> >> size(fv) >> ans = >> 3150 1751 >> >> ax, ay, az, are: >> >> size(ay) >> >> ans = >> >> 46 55 46 >> >> >> size(sel) >> >> ans = >> >> 116380 1 >> >> >> I found one similar post on the list, however its not helpful in that >> case. Does anyone can spot what I'm missing here? >> >> >> Thank you in advance for you help, >> >> >> Tadeusz W. Kononowicz >> >> >> >> _______________________________________________ >> 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 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > a/attachment-0001.html> > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 28, Issue 46 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Mar 23 14:33:44 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 23 Mar 2013 14:33:44 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate In-Reply-To: References: Message-ID: hi tadeusz, I believe that interpolation from a 3D grid onto another 3D grid is not supported when the input contains multiple time points. Best Jan-Mathijs On Mar 21, 2013, at 7:23 PM, T.W. Kononowicz wrote: > Dear FieldTrip users, > > I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. > > > cfg = []; > cfg.method = 'mne'; > cfg.grid = grid; > cfg.vol = template_vol; > cfg.grad = grad; > cfg.projectnoise = 'yes'; > cfg.reducerank = 'no'; > cfg.mne.lambda = 1e8; > repr2_mne = ft_sourceanalysis(cfg, repr2_cov); > > The repr2_mne structure looks as follows: > >> repr2_mne > repr2_mne = > dim: [15 15 14] > time: [1x1751 double] > pos: [3150x3 double] > inside: [1x1613 double] > outside: [1x1537 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > >> repr2_mne.avg > ans = > mom: {1x3150 cell} > pow: [3150x1751 double] > noisecov: {1x3150 cell} > > > As the next step I call the ft_sourceinterpolate: > cfg=[]; > cfg.interpmethod='linear'; > cfg.parameter='avg.pow'; > cfg.downsample = 2; > cfg.feedback='yes'; > repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); > > Then I get the following display message. > the input is source data with 3150 positions on a [15 15 14] grid > the input is volume data with dimensions [91 109 91] > updating homogenous coordinate transformation matrix > downsampling anatomy > downsampling inside > the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB > selecting subvolume of 34.7% > reslicing and interpolating avg.pow > > After that the code crashes and I get the error: > > ??? Error using ==> interpn at 155 > Wrong number of input arguments or some dimension of V is less than 2. > > Error in ==> ft_sourceinterpolate>my_interpn at 494 > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > Error in ==> ft_sourceinterpolate at 397 > av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, > cfg.feedback); > > > Just before crush in line 397 of ft_sourceinterpolate: av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are: > size(fv) > ans = > 3150 1751 > ax, ay, az, are: > size(ay) > ans = > 46 55 46 > > size(sel) > ans = > 116380 1 > > > > I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here? > > Thank you in advance for you help, > > Tadeusz W. Kononowicz > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.koulouri84 at googlemail.com Sun Mar 24 22:49:11 2013 From: a.koulouri84 at googlemail.com (alexandra koulouri) Date: Sun, 24 Mar 2013 21:49:11 +0000 Subject: [FieldTrip] problem use OpenMEEG Message-ID: Hi, I would like to run the test example for the OpenMEEG. I followed the instructions and I installed the OpenMEEG.exe (Windows 8) However, when I wrote: system ('om_assemble' ) I receive this: 'om_assemble' is not recognized as an internal or external command, operable program or batch file. During the installation, I selected the option add path to windows for all users and there was the following warning: Warning! PATH too long installer unable to modify PATH! I am guessing that's the reason why it doesn't work and probably I need to change the path manually. But I don't know what I need to do. Any suggestions? many thanks, Alexandra -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhharsimrat at gmail.com Mon Mar 25 17:47:45 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 25 Mar 2013 16:47:45 +0000 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: <514A1445.50007@berkeley.edu> Message-ID: Hi All I think I am missing something with ft_selectdata. I investigated a bit more while redoing the analysis with new version of fieldtrip. I have 4 class data but i am just doing classification (multivariate analysis) between the first two classes with 13 and 20 trials each. After the ft_freqanalysis - all the trials are contained in tf - and tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have one channel as I removed others. When I use tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); to get trials for only the first class I get label: {32x1 cell} dimord: 'rpt_chan_freq_time' freq: [10.5000 12.5000 14.5000] time: [0.3000 0.4000 0.5000 0.6000] powspctrm: [4-D double] cumtapcnt: [13x3 double] cfg: [1x1 struct] Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as tf.powspctrm Similarly, for trials of class 2 tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); Again, the size of tf2 is same as tf1 which is same as tf The only difference in the structure is tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. The first question is- How does ft_freqstatistics handle tf1.cumtapcnt, when I use stat = ft_freqstatistics(cfg,tf1,tf2) Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? This only works if I design the label as cfg. design = [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' its size is 73*2 =146 But my total relevant trials are just 13 (class 1) + 20(class2) = 33 for both classes I suspect I making a mistake somewhere as in ideal case I should be designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); 2*ones(size(tf2.cumtapcnt,1),1)]' size(cg.design) should be 33 and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 3 4] So ft_freqstatistics should be handling 33 trials - with 13 from first class, 20 from other class. But now it has full 146 trials even after doing ft_selectdata. I will be very grateful for any help. Best regards Harsimrat On 21 March 2013 08:34, Eelke Spaak wrote: > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > > subjects and subsequently used ft_freqstatistics. However, the channel > order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, thus the > > repaired channels were NOT appended to the end of the data. So apparently > > ft_channelrepair not always appends the repaired channels at the end. I > > suppose this is good news for me, meaning that the bug did not affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is indeed > changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will not have > >> had any effect. However, one important case in which channel ordering > >> *will* be different is when one does ft_channelrepair on a data set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the repaired > >> data sets to ft_freqstatistics, there is a good chance the results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might have > caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Mar 25 18:07:33 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 25 Mar 2013 18:07:33 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: <514A1445.50007@berkeley.edu> Message-ID: Hi Harsimrat, Do you believe this is related to the bug I described? (If not, it's better to send an e-mail with a different subject line, to avoid confusion.) Cheers, Eelke On 25 March 2013 17:47, Harsimrat Singh wrote: > Hi All > > I think I am missing something with ft_selectdata. I investigated a bit more > while redoing the analysis with new version of fieldtrip. > > I have 4 class data but i am just doing classification (multivariate > analysis) between the first two classes with 13 and 20 trials each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have > one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > But my total relevant trials are just 13 (class 1) + 20(class2) = 33 for > both classes > I suspect I making a mistake somewhere as in ideal case I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 > 3 4] > > So ft_freqstatistics should be handling 33 trials - with 13 from first > class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > > > On 21 March 2013 08:34, Eelke Spaak wrote: >> >> Hi Ingrid, >> >> Thanks for your question; it made me realize that my e-mail was not >> clear enough. In your case, when you repaired channels that were still >> present in the data, the output channel order of ft_channelrepair will >> be the same as the input channel order. >> >> The problem only occurs if you use ft_channelrepair to repair >> *missing* channels, so e.g. channels switched off during acquisition >> or that were discarded during preprocessing. >> >> Groeten, >> Eelke >> >> On 20 March 2013 20:55, Ingrid Nieuwenhuis >> wrote: >> > Hi Eelke, >> > >> > Thanks for reporting. I did do ft_channelrepair on my EEG data for some >> > subjects and subsequently used ft_freqstatistics. However, the channel >> > order >> > is indentical in all my subjects in the freq. >> > >> > I repaired bad channels using the default setting (method='nearest'). >> > The >> > bad channels were included in the input data to ft_channelrepair (so >> > they >> > were not missing). I just checked, and in data_out after >> > ft_channelrepair, >> > the order of the labels of the data is identical to the data_in, thus >> > the >> > repaired channels were NOT appended to the end of the data. So >> > apparently >> > ft_channelrepair not always appends the repaired channels at the end. I >> > suppose this is good news for me, meaning that the bug did not affect >> > me, >> > since the channels were ordered identically when calling >> > ft_freqstatistics. >> > Do you agree, or am I missing something? And for others that used >> > ft_channelrepair, might be worth checking if the ordering is indeed >> > changed >> > after calling it, because it appears not always to be the case. >> > >> > Thanks, >> > Ingrid >> > >> > >> > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> >> >> Dear FieldTrip community, >> >> >> >> Short version: if you did ft_freqstatistics across subjects with a >> >> different channel ordering across data sets (which is the case if you >> >> use ft_channelrepair), your results might have been erroneous. Read >> >> the following carefully. >> >> >> >> Yesterday, we discovered a possibly severe bug in a utility function >> >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> >> entails that ft_selectdata_old assumes that the channels in all data >> >> input arguments are ordered identically, and does not take into >> >> account the order of the data.label field. This means that when >> >> several data input arguments with different channel orderings are >> >> passed to ft_selectdata_old, the resulting output structure (with a >> >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> >> channel X might end up in another channel Y). Importantly, the same >> >> thus holds for ft_freqstatistics: when doing statistics across >> >> subjects, if the different subjects' data sets have different channel >> >> orderings, the resulting statistics will be wrong. >> >> >> >> We expect that in many cases, the channel ordering across different >> >> data sets will be identical, and in those cases this bug will not have >> >> had any effect. However, one important case in which channel ordering >> >> *will* be different is when one does ft_channelrepair on a data set, >> >> since this function appends the repaired channels to the end of the >> >> data. So, if you have done ft_channelrepair on only a subset of your >> >> subjects' data, and/or used ft_channelrepair to repair different >> >> channels in different subjects, and subsequently passed the repaired >> >> data sets to ft_freqstatistics, there is a good chance the results you >> >> got were wrong. >> >> >> >> Most likely, this bug was introduced with revision 4101, in september >> >> 2011, so it has been in the code for quite a while. Note that >> >> ft_channelrepair only supports repairing missing channels since >> >> revision 5216 (february 2012), and that this was advised against until >> >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> >> was implemented. >> >> >> >> The fix has been implemented and is now available from the FTP server >> >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> >> available on the /home/common/ version of FieldTrip). Note that >> >> ft_selectdata_old still does not work correctly, this is something we >> >> will fix in the near future (ft_selectdata_old is deprecated). We >> >> fixed the behaviour of ft_appendfreq (the preferred replacement >> >> function for ft_selectdata_old when appending freq structures) and >> >> changed ft_freqstatistics to use this function instead. >> >> >> >> The other statistics functions, ft_timelockstatistics and >> >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> >> you to upgrade to the latest version of FieldTrip. If the situation >> >> described above applies to you, you will need to redo your >> >> channel-level (time-)frequency statistics analyses. >> >> >> >> Details on the bug (and a test script) can be found here: >> >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> >> problems related to the bug, please post them there. >> >> >> >> We sincerely apologise for this bug and any trouble it might have >> >> caused. >> >> >> >> Best, >> >> On behalf of the FT core development team, >> >> >> >> Eelke >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > -- >> > Ingrid Nieuwenhuis PhD >> > Postdoctoral Fellow >> > Sleep and Neuroimaging Laboratory >> > Department of Psychology >> > University of California, Berkeley >> > California 94720-1650 >> > Tolman Hall, room 5305 >> > >> > >> > _______________________________________________ >> > 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 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From singhharsimrat at gmail.com Mon Mar 25 18:35:42 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 25 Mar 2013 17:35:42 +0000 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems Message-ID: Hi All I think I have a problem with ft_selectdata. Data Background: I have 4 class data but i am just doing classification (multivariate analysis) between the first two classes with 13 and 20 trials each. After the ft_freqanalysis - all the trials are contained in tf - and tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have one channel as I removed others. When I use tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); to get trials for only the first class I get label: {32x1 cell} dimord: 'rpt_chan_freq_time' freq: [10.5000 12.5000 14.5000] time: [0.3000 0.4000 0.5000 0.6000] powspctrm: [4-D double] cumtapcnt: [13x3 double] cfg: [1x1 struct] Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as tf.powspctrm Similarly, for trials of class 2 tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); Again, the size of tf2 is same as tf1 which is same as tf The only difference in the structure is tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. The first question is- How does ft_freqstatistics handle tf1.cumtapcnt, when I use stat = ft_freqstatistics(cfg,tf1,tf2) Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? This only works if I design the label as cfg. design = [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' its size is 73*2 =146 Problem: My total relevant trials are just 13 (class 1) + 20(class2) = 33 for both classes and not 146. I suspect I making a mistake somewhere as in ideal case, I should be designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); 2*ones(size(tf2.cumtapcnt,1),1)]' size(cg.design) should be 33 and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 3 4] So after doing ft_selectdata, ft_freqstatistics should be handling 33 trials - with 13 from first class, 20 from other class. But now it has full 146 trials even after doing ft_selectdata. I will be very grateful for any help. Best regards Harsimrat On 21 March 2013 08:34, Eelke Spaak wrote: > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > > subjects and subsequently used ft_freqstatistics. However, the channel > order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, thus the > > repaired channels were NOT appended to the end of the data. So apparently > > ft_channelrepair not always appends the repaired channels at the end. I > > suppose this is good news for me, meaning that the bug did not affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is indeed > changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will not have > >> had any effect. However, one important case in which channel ordering > >> *will* be different is when one does ft_channelrepair on a data set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the repaired > >> data sets to ft_freqstatistics, there is a good chance the results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might have > caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 26 08:50:47 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 26 Mar 2013 08:50:47 +0100 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems In-Reply-To: References: Message-ID: <51515357.8090908@donders.ru.nl> Dear Harsimrat, Actually, both cumtapcnt and powspctrm should be subselected. The problem most likely comes from the fact that your data has 32 labels but in powspctrm only one channel left (dimord is rpt_chan_freq_time, dimension of powspctrm is 73 x 1 x 2 x 3, but you have 32 labels). Whatever you did to your data, you made it inconsistent. A way to solve this is to make the label fields have the sime size as powspctrm. A better way would be to find out what made them inconsistent. Not sure about freq and time here, because you mention that these dimension are alright for your tf matrix. That should solve it. ft_selectdata works with all our test data. If not, let us know or send me a snippet of your data together with some code to reproduce this error and I can have a more thorough look. Best, Jörn On 3/25/2013 6:35 PM, Harsimrat Singh wrote: > Hi All > > I think I have a problem with ft_selectdata. > > Data Background: I have 4 class data but i am just doing > classification (multivariate analysis) between the first two classes > with 13 and 20 trials each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I > have one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of > tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > Problem: > My total relevant trials are just 13 (class 1) + 20(class2) = 33 for > both classes and not 146. > I suspect I making a mistake somewhere as in ideal case, I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size > [20 1 3 4] > > So after doing ft_selectdata, ft_freqstatistics should be handling 33 > trials - with 13 from first class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > On 21 March 2013 08:34, Eelke Spaak > wrote: > > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data > for some > > subjects and subsequently used ft_freqstatistics. However, the > channel order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting > (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair > (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, > thus the > > repaired channels were NOT appended to the end of the data. So > apparently > > ft_channelrepair not always appends the repaired channels at the > end. I > > suppose this is good news for me, meaning that the bug did not > affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is > indeed changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case > if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility > function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all > data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different > channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will > not have > >> had any effect. However, one important case in which channel > ordering > >> *will* be different is when one does ft_channelrepair on a data > set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of > your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the > repaired > >> data sets to ft_freqstatistics, there is a good chance the > results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in > september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised > against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP > server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is > something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly > advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might > have caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Tue Mar 26 19:24:51 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Tue, 26 Mar 2013 19:24:51 +0100 Subject: [FieldTrip] problem use OpenMEEG In-Reply-To: References: Message-ID: hi Alexandra, can you try to run system ('om_assemble' ) from the folder where you installed OpenMEEG. FYI that's the trick Brainstorm uses to run OpenMEEG, it changes the current directory when calling the commands. hope this helps, Alex On Sun, Mar 24, 2013 at 10:49 PM, alexandra koulouri wrote: > Hi, > > I would like to run the test example for the OpenMEEG. > I followed the instructions and I installed the OpenMEEG.exe (Windows 8) > > However, when I wrote: > system ('om_assemble' ) > I receive this: > 'om_assemble' is not recognized as an internal or external command, > operable program or batch file. > > During the installation, I selected the option add path to windows for all > users > and there was the following warning: > Warning! PATH too long installer unable to modify PATH! > > I am guessing that's the reason why it doesn't work and probably I need to > change the path manually. > But I don't know what I need to do. > Any suggestions? > > many thanks, > Alexandra > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From candoosy at telus.net Wed Mar 27 00:24:40 2013 From: candoosy at telus.net (Jim McKay) Date: Tue, 26 Mar 2013 16:24:40 -0700 Subject: [FieldTrip] Calculating goodness of fit Message-ID: <51522E38.8040309@telus.net> Hello Fieldtrippers, I am trying to figure out how to calculate the goodness of fit (gof) after a dipole fit on MEG data. The equation for gof has two input variables, the measured data vector and the model data vector from the EC dipole fit. The measured data vector is easy, but I am confused which vector to use for the model data, which is a vector of length (1:Num_sensors). If dip1 is the output from the ft_dipolefitting function, candidates are: dip1.Vdata - perhaps this is the measured data? dip1.Vmodel - sounds promising? dip1.dip.pot - or maybe this? Can someone please clarify what vector to use? Cheers, Jim -- Jim McKay Candoo Systems Inc. - Magnetic field & vibration sensors, systems, and site surveys Tel. 778-840-0361 jim.mckay at candoosys.com www.candoosys.com From singhharsimrat at gmail.com Wed Mar 27 13:54:44 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 27 Mar 2013 12:54:44 +0000 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems In-Reply-To: <51515357.8090908@donders.ru.nl> References: <51515357.8090908@donders.ru.nl> Message-ID: Thanks for your help Jorn It now works ok. Best regards Harsimrat On 26 March 2013 07:50, "Jörn M. Horschig" wrote: > Dear Harsimrat, > > Actually, both cumtapcnt and powspctrm should be subselected. The problem > most likely comes from the fact that your data has 32 labels but in > powspctrm only one channel left (dimord is rpt_chan_freq_time, dimension of > powspctrm is 73 x 1 x 2 x 3, but you have 32 labels). Whatever you did to > your data, you made it inconsistent. A way to solve this is to make the > label fields have the sime size as powspctrm. A better way would be to find > out what made them inconsistent. Not sure about freq and time here, because > you mention that these dimension are alright for your tf matrix. > That should solve it. ft_selectdata works with all our test data. If not, > let us know or send me a snippet of your data together with some code to > reproduce this error and I can have a more thorough look. > > Best, > Jörn > > > > On 3/25/2013 6:35 PM, Harsimrat Singh wrote: > > Hi All > > I think I have a problem with ft_selectdata. > > Data Background: I have 4 class data but i am just doing classification > (multivariate analysis) between the first two classes with 13 and 20 trials > each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have > one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of > tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > Problem: > My total relevant trials are just 13 (class 1) + 20(class2) = 33 for both > classes and not 146. > I suspect I making a mistake somewhere as in ideal case, I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size > [20 1 3 4] > > So after doing ft_selectdata, ft_freqstatistics should be handling 33 > trials - with 13 from first class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > On 21 March 2013 08:34, Eelke Spaak wrote: > >> Hi Ingrid, >> >> Thanks for your question; it made me realize that my e-mail was not >> clear enough. In your case, when you repaired channels that were still >> present in the data, the output channel order of ft_channelrepair will >> be the same as the input channel order. >> >> The problem only occurs if you use ft_channelrepair to repair >> *missing* channels, so e.g. channels switched off during acquisition >> or that were discarded during preprocessing. >> >> Groeten, >> Eelke >> >> On 20 March 2013 20:55, Ingrid Nieuwenhuis >> wrote: >> > Hi Eelke, >> > >> > Thanks for reporting. I did do ft_channelrepair on my EEG data for some >> > subjects and subsequently used ft_freqstatistics. However, the channel >> order >> > is indentical in all my subjects in the freq. >> > >> > I repaired bad channels using the default setting (method='nearest'). >> The >> > bad channels were included in the input data to ft_channelrepair (so >> they >> > were not missing). I just checked, and in data_out after >> ft_channelrepair, >> > the order of the labels of the data is identical to the data_in, thus >> the >> > repaired channels were NOT appended to the end of the data. So >> apparently >> > ft_channelrepair not always appends the repaired channels at the end. I >> > suppose this is good news for me, meaning that the bug did not affect >> me, >> > since the channels were ordered identically when calling >> ft_freqstatistics. >> > Do you agree, or am I missing something? And for others that used >> > ft_channelrepair, might be worth checking if the ordering is indeed >> changed >> > after calling it, because it appears not always to be the case. >> > >> > Thanks, >> > Ingrid >> > >> > >> > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> >> >> Dear FieldTrip community, >> >> >> >> Short version: if you did ft_freqstatistics across subjects with a >> >> different channel ordering across data sets (which is the case if you >> >> use ft_channelrepair), your results might have been erroneous. Read >> >> the following carefully. >> >> >> >> Yesterday, we discovered a possibly severe bug in a utility function >> >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> >> entails that ft_selectdata_old assumes that the channels in all data >> >> input arguments are ordered identically, and does not take into >> >> account the order of the data.label field. This means that when >> >> several data input arguments with different channel orderings are >> >> passed to ft_selectdata_old, the resulting output structure (with a >> >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> >> channel X might end up in another channel Y). Importantly, the same >> >> thus holds for ft_freqstatistics: when doing statistics across >> >> subjects, if the different subjects' data sets have different channel >> >> orderings, the resulting statistics will be wrong. >> >> >> >> We expect that in many cases, the channel ordering across different >> >> data sets will be identical, and in those cases this bug will not have >> >> had any effect. However, one important case in which channel ordering >> >> *will* be different is when one does ft_channelrepair on a data set, >> >> since this function appends the repaired channels to the end of the >> >> data. So, if you have done ft_channelrepair on only a subset of your >> >> subjects' data, and/or used ft_channelrepair to repair different >> >> channels in different subjects, and subsequently passed the repaired >> >> data sets to ft_freqstatistics, there is a good chance the results you >> >> got were wrong. >> >> >> >> Most likely, this bug was introduced with revision 4101, in september >> >> 2011, so it has been in the code for quite a while. Note that >> >> ft_channelrepair only supports repairing missing channels since >> >> revision 5216 (february 2012), and that this was advised against until >> >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> >> was implemented. >> >> >> >> The fix has been implemented and is now available from the FTP server >> >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> >> available on the /home/common/ version of FieldTrip). Note that >> >> ft_selectdata_old still does not work correctly, this is something we >> >> will fix in the near future (ft_selectdata_old is deprecated). We >> >> fixed the behaviour of ft_appendfreq (the preferred replacement >> >> function for ft_selectdata_old when appending freq structures) and >> >> changed ft_freqstatistics to use this function instead. >> >> >> >> The other statistics functions, ft_timelockstatistics and >> >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> >> you to upgrade to the latest version of FieldTrip. If the situation >> >> described above applies to you, you will need to redo your >> >> channel-level (time-)frequency statistics analyses. >> >> >> >> Details on the bug (and a test script) can be found here: >> >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> >> problems related to the bug, please post them there. >> >> >> >> We sincerely apologise for this bug and any trouble it might have >> caused. >> >> >> >> Best, >> >> On behalf of the FT core development team, >> >> >> >> Eelke >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > -- >> > Ingrid Nieuwenhuis PhD >> > Postdoctoral Fellow >> > Sleep and Neuroimaging Laboratory >> > Department of Psychology >> > University of California, Berkeley >> > California 94720-1650 >> > Tolman Hall, room 5305 >> > >> > >> > _______________________________________________ >> > 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 >> > > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricardoojm at gmail.com Wed Mar 27 17:10:05 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Wed, 27 Mar 2013 13:10:05 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel Message-ID: Dear all I am creating a BEM model for eeg, following the appropriate tutorial, but I have a problem when preparing the headmodel. The output I have from the ft_prepare_headmodel command does not contain the "mat", and so, when I try to generate the leadfield, it returns an error message due to non existent "mat". I saw that other users had similar problem, but I haven't found a solution though. So, what is wrong with my script? Thanks a lot in advance! Best, Ricardo load standard_mri.mat mri_orig=mri; disp(mri) % Segmenting the data cfg = []; cfg.output= {'scalp','skull','brain'}; segmentedmri = ft_volumesegment(cfg, mri_orig); disp(segmentedmri) save segmentedmri segmentedmri % MESH cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 1000]; bnd=ft_prepare_mesh(cfg,segmentedmri); disp(bnd(1)) % Head Model = variavel vol cfg = []; cfg.method ='bem_dipoli'; %dipoli singlesphere vol = ft_prepare_headmodel(cfg, segmentedmri); >> disp(vol) bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] skin_surface: 1 source: 3 type: 'dipoli' unit: 'mm' cfg: [1x1 struct] -------------- next part -------------- An HTML attachment was scrubbed... URL: From cas243 at georgetown.edu Wed Mar 27 20:30:15 2013 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Wed, 27 Mar 2013 15:30:15 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab Message-ID: Dear FieldTrip Community, I'd like to better understand the requirement that the calculation of coherence be averaged over > 1 trials, a topic previously discussed on the FieldTrip discussion site (e.g. http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). I worked through the calculation of coherence for n=1 trials at two distinct channels manually (dividing the cross-spectrum by the mean of the power spectra), and indeed the value resolves to 1 as others have previously said it would (where the power spectra and cross spectrum were estimated with the multitaper method). However, I'm still confused because the Matlab function mscohere returns coherence values between 0 and 1 (less than 1) at each calculated frequency for an input of two single time series X and Y, e.g. two single time courses (from the same trial) at two distinct channels. I suspect this may be related to the method for estimating the power/cross spectral density in mscohere (Welch's averaged modified periodogram method) because if I estimate the cross-spectrum and power spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated option), then the coherence estimates are between 0 and 1 (not 1). Can someone please help me to understand this -- why would coherence be 1 using the multitaper method but not using Welch's method? I'd like to understand if coherence is fundamentally required to be estimated over multiple trials (at two distinct channels), or if the requirement for multiple trials is related to the method of calculating the spectra, and if so why that is the case. Thanks immensely, Clara From ith at deakin.edu.au Thu Mar 28 01:04:34 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 28 Mar 2013 00:04:34 +0000 Subject: [FieldTrip] Beamformer for ERP data Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I am trying to do a LCMV beamformer analysis using the ft_sourceanalysis for a ERP data set. Finally I intend to extract the source waveforms using virtual electrodes. But as we can only do meaningful source localisation for a small time interval say (50ms), how can I construct the source time course for a longer post stimulus period (say 500ms)after doing beamforming for shorter (50ms) time intervals? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Mobile : +61430321972 Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From am236 at georgetown.edu Thu Mar 28 02:36:09 2013 From: am236 at georgetown.edu (Andrei Medvedev) Date: Wed, 27 Mar 2013 21:36:09 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab In-Reply-To: References: Message-ID: <51539E89.2040001@georgetown.edu> Dear Clara, As previously discussed, coherence, indeed, FUNDAMENTALLY requires to be calculated over several trials, and this maxim does not depend on the way you calculate it. Because, conceptually, coherence is a measure of phase STABILITY in time i.e., how much it changes from trial to trial. If you have just one trial, you cannot say how stable the phase relationship between two signals is: one trial gives you just one measurement of phase difference (at least, if you use a window-based spectral analysis such as FFT, wavelet, tapers etc; the alternative methods based on instantaneous phase such as Hilbert transform are beyond this discussion at this point). And this is why your manual estimate of coherence on a single trial gives you 1: it should be this way because the cross-spectrum over one trial normalized by the auto-spectra of two signals IDENTICALLY equals 1 (you can simply check it with the formula). Why then does the Matlab mscohere give you values less than 1 even for one trial? It is just because all Matlab spectral functions split your one trial into several sub-segments BY DEFAULT. To check this, you need to take a full control of mscohere (not to use the default values) and explicitly say what windows to use. As an example, you can take two random variables x and y 1000 points long assuming fsample=1000 (1 sec trial). Then calculate coh by two different calls of mscohere: 1) Coh = mscohere(x,y,1000,0,1000,1000); - forcefully take the whole trial without splitting it into smaller parts by default; 2) Coh = mscohere(x,y,500,0,500,1000); - splitting this one trial into two sub-trials 500 points each without overlap. And see what happens. Best, Andrei. On 3/27/2013 3:30 PM, Clara A. Scholl wrote: > Dear FieldTrip Community, > > I'd like to better understand the requirement that the calculation of > coherence be averaged over> 1 trials, a topic previously discussed on > the FieldTrip discussion site (e.g. > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). > > I worked through the calculation of coherence for n=1 trials at two > distinct channels manually (dividing the cross-spectrum by the mean of > the power spectra), and indeed the value resolves to 1 as others have > previously said it would (where the power spectra and cross spectrum > were estimated with the multitaper method). However, I'm still > confused because the Matlab function mscohere returns coherence values > between 0 and 1 (less than 1) at each calculated frequency for an > input of two single time series X and Y, e.g. two single time courses > (from the same trial) at two distinct channels. > > I suspect this may be related to the method for estimating the > power/cross spectral density in mscohere (Welch's averaged modified > periodogram method) because if I estimate the cross-spectrum and power > spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated > option), then the coherence estimates are between 0 and 1 (not 1). > Can someone please help me to understand this -- why would coherence > be 1 using the multitaper method but not using Welch's method? > > I'd like to understand if coherence is fundamentally required to be > estimated over multiple trials (at two distinct channels), or if the > requirement for multiple trials is related to the method of > calculating the spectra, and if so why that is the case. > > Thanks immensely, > Clara > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stan.vanpelt at fcdonders.ru.nl Thu Mar 28 08:57:23 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 28 Mar 2013 08:57:23 +0100 (CET) Subject: [FieldTrip] Beamformer for ERP data In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> Message-ID: <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> Dear Imali, What you could do is the following: 1. determine the source of your activation by beamforming your 50ms time-interval data, or by doing a dipole fit on your ERP. 2. compute spatial filters at that location based on the covariance matrix of the data of the entire epoch you're interested in (e.g., 500ms pre until 500ms post stimulus onset). You could consider first bandpassing this data for the part of the spectrum that you are interested in (e.g. 13-28Hz for beta) . 3. create the virtual waveforms by multiplying the spatial filters with the band-passed data Hope that helps. Best, Stan -- Stan van Pelt, PhD Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Phone: +49 (0)69 96769 517 Fax: +49 (0)69 96769 555 www.esi-frankfurt.de ----- Oorspronkelijk bericht ----- > Van: "IMALI THANUJA HETTIARACHCHI" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 28 maart 2013 01:04:34 > Onderwerp: [FieldTrip] Beamformer for ERP data > Dear Fieldtrippers, > I am trying to do a LCMV beamformer analysis using the > ft_sourceanalysis for a ERP data set. Finally I intend to extract the > source waveforms using virtual electrodes. > But as we can only do meaningful source localisation for a small time > interval say (50ms), how can I construct the source time course for a > longer post stimulus period (say 500ms)after doing beamforming for > shorter (50ms) time intervals? > Many thanks in advance > Kind regards > Imali > Imali Thanuja Hettiarachchi > PhD Candidate > Centre for Intelligent Systems research > Deakin University, Geelong 3217, Australia. > Mobile : +61430321972 > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > Description: Description: Description: > cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From johanna.zumer at gmail.com Thu Mar 28 09:05:59 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 28 Mar 2013 09:05:59 +0100 Subject: [FieldTrip] Beamformer for ERP data In-Reply-To: <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> References: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Imali, In addition to Stan's good advice, you might also find better results by computing the covariance matrix from the unaveraged timelocked data, rather than the averaged ERP data. Cheers, Johanna 2013/3/28 Pelt, S. van (Stan) > Dear Imali, > > What you could do is the following: > 1. determine the source of your activation by beamforming your 50ms > time-interval data, or by doing a dipole fit on your ERP. > 2. compute spatial filters at that location based on the covariance matrix > of the data of the entire epoch you're interested in (e.g., 500ms pre until > 500ms post stimulus onset). You could consider first bandpassing this data > for the part of the spectrum that you are interested in (e.g. 13-28Hz for > beta). > 3. create the virtual waveforms by multiplying the spatial filters with > the band-passed data > > Hope that helps. > > Best, Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > www.esi-frankfurt.de > > ------------------------------ > > *Van: *"IMALI THANUJA HETTIARACHCHI" > *Aan: *fieldtrip at science.ru.nl > *Verzonden: *Donderdag 28 maart 2013 01:04:34 > *Onderwerp: *[FieldTrip] Beamformer for ERP data > > > Dear Fieldtrippers, > > > > I am trying to do a LCMV beamformer analysis using the ft_sourceanalysis > for a ERP data set. Finally I intend to extract the source waveforms using > virtual electrodes. > > > > But as we can only do meaningful source localisation for a small time > interval say (50ms), how can I construct the source time course for a > longer post stimulus period (say 500ms)after doing beamforming for shorter > (50ms) time intervals? > > > > Many thanks in advance > > > > Kind regards > > Imali > > > > *Imali Thanuja Hettiarachchi* > > PhD Candidate > > Centre for Intelligent Systems research > > Deakin University, Geelong 3217, Australia. > > > > Mobile : +61430321972 > > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > > > > [image: Description: Description: Description: > cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] > > > > > > > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Mar 28 09:43:29 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 28 Mar 2013 09:43:29 +0100 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <515402B1.3070700@donders.ru.nl> Hi Ricardo, I assume that you are using the dipoli method? I recently discovered that when the method fails, the error is caught and printed as a normal fprintf message to the command window. Most likely it complained about your segmentation or that something is wrong with the triangulation. I am not sure about the other BEM methods, but you can check the code whether a similar thing is done there. In my limited experience, independent of what BEM method you are using, this is solved by checking the segmentation again and making sure that all boundaries (skull, scalp, brain) are close, i.e. that there are no holes in the brain. Let me know if this is it for you. Best, Jörn On 3/27/2013 5:10 PM, Ricardo Moura wrote: > Dear all > I am creating a BEM model for eeg, following the appropriate tutorial, > but I have a problem when preparing the headmodel. The output I have > from the ft_prepare_headmodel command does not contain the "mat", and > so, when I try to generate the leadfield, it returns an error message > due to non existent "mat". I saw that other users had similar problem, > but I haven't found a solution though. So, what is wrong with my script? > > Thanks a lot in advance! > Best, > Ricardo > > > > > load standard_mri.mat > mri_orig=mri; > disp(mri) > > % Segmenting the data > cfg = []; > cfg.output= {'scalp','skull','brain'}; > segmentedmri = ft_volumesegment(cfg, mri_orig); > disp(segmentedmri) > save segmentedmri segmentedmri > > % MESH > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd=ft_prepare_mesh(cfg,segmentedmri); > disp(bnd(1)) > > % Head Model = variavel vol > cfg = []; > cfg.method ='bem_dipoli'; %dipoli singlesphere > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > >> disp(vol) > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > skin_surface: 1 > source: 3 > type: 'dipoli' > unit: 'mm' > cfg: [1x1 struct] > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From clara.scholl at gmail.com Thu Mar 28 14:12:39 2013 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Thu, 28 Mar 2013 09:12:39 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab In-Reply-To: <51539E89.2040001@georgetown.edu> References: <51539E89.2040001@georgetown.edu> Message-ID: Dear Andrei, Thank you for guiding me through my point of confusion, I really appreciate your detailed consideration! Your response finally clarifies the situation for me. Thanks, Clara On Wed, Mar 27, 2013 at 9:36 PM, Andrei Medvedev wrote: > Dear Clara, > > As previously discussed, coherence, indeed, FUNDAMENTALLY requires to be > calculated over several trials, and this maxim does not depend on the way > you calculate it. Because, conceptually, coherence is a measure of phase > STABILITY in time i.e., how much it changes from trial to trial. If you have > just one trial, you cannot say how stable the phase relationship between > two signals is: one trial gives you just one measurement of phase difference > (at least, if you use a window-based spectral analysis such as FFT, wavelet, > tapers etc; the alternative methods based on instantaneous phase such as > Hilbert transform are beyond this discussion at this point). And this is why > your manual estimate of coherence on a single trial gives you 1: it should > be this way because the cross-spectrum over one trial normalized by the > auto-spectra of two signals IDENTICALLY equals 1 (you can simply check it > with the formula). > > Why then does the Matlab mscohere give you values less than 1 even for one > trial? It is just because all Matlab spectral functions split your one trial > into several sub-segments BY DEFAULT. To check this, you need to take a full > control of mscohere (not to use the default values) and explicitly say what > windows to use. > > As an example, you can take two random variables x and y 1000 points long > assuming fsample=1000 (1 sec trial). Then calculate coh by two different > calls of mscohere: > > 1) Coh = mscohere(x,y,1000,0,1000,1000); - forcefully take the whole trial > without splitting it into smaller parts by default; > > 2) Coh = mscohere(x,y,500,0,500,1000); - splitting this one trial into two > sub-trials 500 points each without overlap. > > And see what happens. > > Best, > Andrei. > > > > On 3/27/2013 3:30 PM, Clara A. Scholl wrote: >> >> Dear FieldTrip Community, >> >> I'd like to better understand the requirement that the calculation of >> coherence be averaged over> 1 trials, a topic previously discussed on >> the FieldTrip discussion site (e.g. >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). >> >> I worked through the calculation of coherence for n=1 trials at two >> distinct channels manually (dividing the cross-spectrum by the mean of >> the power spectra), and indeed the value resolves to 1 as others have >> previously said it would (where the power spectra and cross spectrum >> were estimated with the multitaper method). However, I'm still >> confused because the Matlab function mscohere returns coherence values >> between 0 and 1 (less than 1) at each calculated frequency for an >> input of two single time series X and Y, e.g. two single time courses >> (from the same trial) at two distinct channels. >> >> I suspect this may be related to the method for estimating the >> power/cross spectral density in mscohere (Welch's averaged modified >> periodogram method) because if I estimate the cross-spectrum and power >> spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated >> option), then the coherence estimates are between 0 and 1 (not 1). >> Can someone please help me to understand this -- why would coherence >> be 1 using the multitaper method but not using Welch's method? >> >> I'd like to understand if coherence is fundamentally required to be >> estimated over multiple trials (at two distinct channels), or if the >> requirement for multiple trials is related to the method of >> calculating the spectra, and if so why that is the case. >> >> Thanks immensely, >> Clara >> _______________________________________________ >> 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 From ricardoojm at gmail.com Thu Mar 28 18:39:37 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Thu, 28 Mar 2013 14:39:37 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Jörn, thank you very much for your response! I checked the segmentation and everything seems to be ok (as far as I can say... No error messages were shown during the processing and I checked the generated objects and plots). But I had a strange error while preparing the head model. Somehow the command cannot find the dipoli files, even thought they are really where they should be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue of what it means. And I am running this command on a ubuntu 12.04 32-bit. Do you have any idea of how I can solve it? Thanks once again,Best, Ricardo using the executable "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not found Warning: an error ocurred while running dipoli > In ft_headmodel_dipoli at 201 In ft_prepare_headmodel at 226 Error using fread Invalid file identifier. Use fopen to generate a valid file identifier. Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > In ft_headmodel_dipoli at 209 In ft_prepare_headmodel at 226 On 27 March 2013 13:10, Ricardo Moura wrote: > Dear all > I am creating a BEM model for eeg, following the appropriate tutorial, but > I have a problem when preparing the headmodel. The output I have from the > ft_prepare_headmodel command does not contain the "mat", and so, when I try > to generate the leadfield, it returns an error message due to non existent > "mat". I saw that other users had similar problem, but I haven't found a > solution though. So, what is wrong with my script? > > Thanks a lot in advance! > Best, > Ricardo > > > > > load standard_mri.mat > mri_orig=mri; > disp(mri) > > % Segmenting the data > cfg = []; > cfg.output= {'scalp','skull','brain'}; > segmentedmri = ft_volumesegment(cfg, mri_orig); > disp(segmentedmri) > save segmentedmri segmentedmri > > % MESH > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd=ft_prepare_mesh(cfg,segmentedmri); > disp(bnd(1)) > > % Head Model = variavel vol > cfg = []; > cfg.method ='bem_dipoli'; %dipoli singlesphere > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > >> disp(vol) > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > skin_surface: 1 > source: 3 > type: 'dipoli' > unit: 'mm' > cfg: [1x1 struct] > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Fri Mar 29 07:35:16 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Fri, 29 Mar 2013 07:35:16 +0100 Subject: [FieldTrip] Antw: Re: non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <515544340200005700012398@gwsmtp1.uni-regensburg.de> Hi Ricardo, I have two hints that might help. Firstly, the segmentations and the corresponding meshes can not only intersect each other, but it can also happen that the generated meshes are self-intersecting. This can not be seen from the plots of the segmented brain. The probability for intersections is higher, in my experience, with finer mesh resolutions. You could try something like [800 800 600] instead of [3000 2000 1000]. I usually do some trial and error and then check the volumes with om_check_vol(vol), which will report any intersections and self-intersections in the meshes. The openmeeg plugin needs to be installed for that. Secondly, for to the '\tmp\xyz...': Some of the methods for generating headmodels (at least I know for dipoli and openmeeg) write large temporary files to the hard disk. They have a long random name in order to avoid that some other data is overwritten. These files might get very large, some GB, and they are written per default to \tmp. A while ago I had the problem the temporary files got larger than the space that our system administrator allowed for \tmp. The script ran without errors, but the mat in the resulting structure was empty. The solution was to change the file destination folder to something other than \tmp, which needs to be done directly within the code of the called function (there is no cfg-option or so for that). Hope that helps, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> Ricardo Moura 28.03.2013 18:39 >>> Hi Jörn, thank you very much for your response! I checked the segmentation and everything seems to be ok (as far as I can say... No error messages were shown during the processing and I checked the generated objects and plots). But I had a strange error while preparing the head model. Somehow the command cannot find the dipoli files, even thought they are really where they should be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue of what it means. And I am running this command on a ubuntu 12.04 32-bit. Do you have any idea of how I can solve it? Thanks once again,Best, Ricardo using the executable "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not found Warning: an error ocurred while running dipoli > In ft_headmodel_dipoli at 201 In ft_prepare_headmodel at 226 Error using fread Invalid file identifier. Use fopen to generate a valid file identifier. Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > In ft_headmodel_dipoli at 209 In ft_prepare_headmodel at 226 On 27 March 2013 13:10, Ricardo Moura wrote: Dear all I am creating a BEM model for eeg, following the appropriate tutorial, but I have a problem when preparing the headmodel. The output I have from the ft_prepare_headmodel command does not contain the "mat", and so, when I try to generate the leadfield, it returns an error message due to non existent "mat". I saw that other users had similar problem, but I haven't found a solution though. So, what is wrong with my script? Thanks a lot in advance! Best, Ricardo load standard_mri.mat mri_orig=mri; disp(mri) % Segmenting the data cfg = []; cfg.output= {'scalp','skull','brain'}; segmentedmri = ft_volumesegment(cfg, mri_orig); disp(segmentedmri) save segmentedmri segmentedmri % MESH cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 ( tel:%5B3000%202000 ) 1000]; bnd=ft_prepare_mesh(cfg,segmentedmri); disp(bnd(1)) % Head Model = variavel vol cfg = []; cfg.method ='bem_dipoli'; %dipoli singlesphere vol = ft_prepare_headmodel(cfg, segmentedmri); >> disp(vol) bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] skin_surface: 1 source: 3 type: 'dipoli' unit: 'mm' cfg: [1x1 struct] -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sat Mar 30 15:07:44 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sat, 30 Mar 2013 22:07:44 +0800 Subject: [FieldTrip] can do i use this tool do power envelope correlation Message-ID: Dear all, I see the ft_connectivityanalys could do 'powcorr',I would like to confirm whether is power envelope correlation. thanks, best xiao. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Sat Mar 30 15:28:59 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 30 Mar 2013 15:28:59 +0100 Subject: [FieldTrip] can do i use this tool do power envelope correlation In-Reply-To: References: Message-ID: Dear Xiao, Indeed, ft_connectivityanalysis with cfg.method='powcorr' computes power envelope (i.e. amplitude envelope squared) correlation. Best, Eelke On 30 March 2013 15:07, 陈雪 wrote: > Dear all, > > I see the ft_connectivityanalys could do 'powcorr',I would like to confirm > whether is power envelope correlation. > > thanks, > best > > xiao. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nuria.donamayor at neuro.uni-luebeck.de Fri Mar 1 11:02:55 2013 From: nuria.donamayor at neuro.uni-luebeck.de (=?iso-8859-1?Q?Nuria_Do=F1amayor_Alonso?=) Date: Fri, 1 Mar 2013 11:02:55 +0100 Subject: [FieldTrip] units Message-ID: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> Hey guys, just two very simple questions regarding units. I am calculating dipoles using planar gradiometer data from a 306 Neuromag system (input units T/cm), what are the units of the dipole moment? Also, what are the units of the LCMV beamformer? Thanks! Nuria From konklone at gmail.com Sat Mar 2 03:12:18 2013 From: konklone at gmail.com (Eric Mill) Date: Fri, 1 Mar 2013 20:12:18 -0600 Subject: [FieldTrip] Getting started with realtime EEG data Message-ID: Hi all, My apologies if this is off-topic here, since you all seem like very busy experts! I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. I see that FieldTrip has a realtime acquisition modulefor NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Sun Mar 3 10:58:36 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 3 Mar 2013 10:58:36 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: Message-ID: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Hi Eric, I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. best regards, Robert On 2 Mar 2013, at 3:12, Eric Mill wrote: > Hi all, > > My apologies if this is off-topic here, since you all seem like very busy experts! > > I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. > > I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? > > Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? > > My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. > > Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. > > -- Eric > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Sun Mar 3 11:35:37 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 3 Mar 2013 11:35:37 +0100 Subject: [FieldTrip] units In-Reply-To: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> References: <810A8E06C75EB447A8CEB73DBFD7BB0E5ECC1EF75A@solaris.neuro.uni-luebeck.de> Message-ID: <6A809326-5C8C-49E8-B826-0B39600409F0@donders.ru.nl> On 1 Mar 2013, at 11:02, Nuria Doñamayor Alonso wrote: > Hey guys, > just two very simple questions regarding units. I am calculating dipoles using planar gradiometer data from a 306 Neuromag system (input units T/cm), what are the units of the dipole moment? Also, what are the units of the LCMV beamformer? The beamformer spatial filter boils down to this equation w = inv(h' * inv(c) * h) * h' * inv(c) where the data covariance c c = d*d'/(n-1) and d is the data expressed in units of signal strength. Furthermore, h is the lead field expressed in "fieldstrength / dipole strength". If you combine all, you see that w is expressed in dipole strength / signal strength. So multiplying w with d you get dipole strength. Or with (w' * c * w) you get squared dipole strength (i.e. dipole power). Sofar the theory, Regretfully the practice aint so nice. Have a look at http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 or more in general http://bugzilla.fcdonders.nl/buglist.cgi?quicksearch=units There are a number of issues due to inconsistent dealing with units, which is largely due to the code not knowing about the units. One is that the neuromag data is in fieldstrentgh/distance for the planar channels, but fieldstrength for the magnetometers. The leadfield has always been computed as fieldstrength (i.e. the difference between the two coils, not divided by the distance). So the leadfield (which is in "fieldstrength" for all 306 channels) is inconsistent with the data (which is in "fieldstrength" for 102 and "fieldstrength/distance" for 204 channels). This results (as others have reported in the past) in the situation that magnetometers and planar gradiometers don't combine well in a single source reconstruction. If you consider converting units from m to cm or mm, i.e. expressing data in different geometrical units, you have to consider that not onlt the coil poisitions change, but also the signal strength (1 T/mm = 10 T/cm). That has never been considered in the code, so there are also bugs related to this. Finally, the units of conductivity in the volume conduction model is not properly scaled with units (although I think that that does not affect MEG, but it does EEG). So there are issues due to inconsistencies in units of signal strength, units of distance and units of conductivity. There are a number of action points defined in our bugzilla and I am working on getting them resolved together with Vladimir (also for SPM). At the moment I suggest you just to be careful with interpreting absolute units. Relative units (changes between conditions) and statistics are not affected. best Robert > Thanks! > Nuria > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stefan.debener at uni-oldenburg.de Sun Mar 3 13:26:35 2013 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Sun, 03 Mar 2013 13:26:35 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: <5133417B.8020901@uni-oldenburg.de> Hi Eric, We recently modified the Emotiv Epoc system and are very happy with the resulting data quality. The modifications & a truly mobile, outdoor walking, single-trial EEG evaluation study are published here: http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/abstract We have also performed more evaluation studies (unpublished) with this system and it performs very competitive for online P3 speller tasks (e.g. via BCI2000) and online motor imagery (e.g. via openvibe). Moreover, it is possible to read the data on Android smartphones/tablets, which is very promising: http://milab.imm.dtu.dk/eeg All necessary spare parts (electrodes, cap, box, connector, wiring information) can be purchased from www.easycap.de, and assembly is pretty straightforward and done in a few hours if you know how to use a soldering iron. Best, Stefan Am 3/3/13 10:58 AM, schrieb Robert Oostenveld: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. > > I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. > > I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each transl > ate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > >> Hi all, >> >> My apologies if this is off-topic here, since you all seem like very busy experts! >> >> I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. >> >> I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? >> >> Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? >> >> My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. >> >> Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. >> >> -- Eric >> _______________________________________________ >> 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 -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de From stefan.debener at uni-oldenburg.de Sun Mar 3 13:30:39 2013 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Sun, 03 Mar 2013 13:30:39 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: <5133426F.7060700@uni-oldenburg.de> Hoops, forgot to include this link, if you want to know how the modified Emotiv system looks like: http://www.youtube.com/watch?v=TLTko4AGmdk Best, Stefan Am 3/3/13 10:58 AM, schrieb Robert Oostenveld: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products since we made the initial implementation of the ThinkCap. I am still able to find documentation here http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell whether the complete sets now sold by NeuroSky still use the same software interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The Epoc has more channels and a head mount for the electrodes. For the Epoc you have to look into teh different SDK options, the cheapest version only gives access to processed data, not to the raw data. For both the Epoc and openeeg a implementation of a stand-allone executable is available in http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for the ThinkCap, this copies the data to a "fieldtrip buffer", where another (c/c++/java/python/matlab) application can easily read it from and do the signal processing, not having to worry about the buffering and data representation any more. > > I know it falls outside your budget, but have a look at http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The rationale for the fieldtrip buffer is that it allows us to develop analysis pipelines using EEG data files on disk (using ft_read_data). Once the offline analysis pipeline performs as desired, we just switch from reading to disk to reading from the buffer (also ft_read_data). We happen to do this using MATLAB for the rapid application development, but the same strategy (develop for file, run in real-time) can be used with another programming environment. > > I think that for signal processing you'll better off if you develop the code using some good quality data from a file on disk. You can always enact a real-time data stream by replaying data from that EEG file, or using the sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, constantly having to wear the headset. That is fine for artefact detection (you can blink while you code), but not if the tasks get more complicated, e.g. relaxing to increase your occipital alpha/10Hz won't work well if you also have in realtime have to monitor whether your applications picks up the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the possibilities of a web-standards implementation. Web Sockets would be needed in Javascript if we want to have the browser connect to a "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it working on all platforms. A server-side implementation offers more choice, python/java/php reading the data from a FT buffer or from the device, and then pass it on in html format to the connected web ) but would not scale as easily with multiple client connections if data processing needs to be done on the server. We then considered the best option to be to implement a RESTless server implementation. The server would one the one hand contains the FT buffer (where it receives the data over low-level TCP) and on the other hand have a web server with the RESTless interface. I.e. the requests that are represented here http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would each transl > ate to a http call like "http://ftbuffer.donders.nl/get/hdr" and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > >> Hi all, >> >> My apologies if this is off-topic here, since you all seem like very busy experts! >> >> I'm trying to figure out what I need to get started with capturing real-time EEG data using consumer-priced headsets (<$200). I don't actually have any interest in using MATLAB, though - I just want to capture the raw data, in real time. >> >> I see that FieldTrip has a realtime acquisition module for NeuroSky's "ThinkCap", though I can't find a current product by NeuroSky called that. Is there something else of theirs I could buy that would work with FieldTrip? >> >> Or, should I be looking elsewhere entirely? What should someone who wants real-time EEG data do? >> >> My plan is to stream this data and visualize it on the web in real time. My background is in web development, not cognitive science, but I'm willing to learn what I have to make something interesting. I'd also love to have the project result in libraries useful for other people in the field. >> >> Thanks for any advice you can give on what EEG to buy, and/or where to learn the core concepts I'll need to use the data. >> >> -- Eric >> _______________________________________________ >> 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 -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de From konklone at gmail.com Sun Mar 3 23:26:15 2013 From: konklone at gmail.com (Eric Mill) Date: Sun, 3 Mar 2013 17:26:15 -0500 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: This is extremely helpful, and just what I was looking for, thank you (both Robert and Stefan). I have a few followup questions you've inspired. How "swappable" is the hardware? Do all EEG's fundamentally produce the same data from the same brain activity? And/or, does FieldTrip always expose data in its buffer in the same format? For example, I would be fine investing the $750 for an Emotiv 14-channel EEG, or even the $1200 for a KT88-1016, but not until after I've done some development with a cheaper device first. However, I would not want to have to rewrite all my code, or much of it, if I switch devices. I do have a requirement that I can have the same code work with either live or replayed data. From how you describe its buffer approach, it sounds like that's a core value of FieldTrip, and will make that requirement much easier to satisfy. Also, I do have one peculiar requirement, which is that the hardware be suitable for wearing during ordinary sleeping at home. This is more a requirement for the final (potentially more expensive) device, than the development device. The promotional photo for the Emotiv EEG, for example, looks like it might not be so great for that. I think I will be using WebSockets, but there will be an intermediate server. So, I will have a computer (perhaps a Raspberry Pi) receive data from the EEG, and then immediately stream it up an open TCP connection to a web server. This server will then stream it down to the individual browsers of visiting users, and JavaScript will do the visualization, in something like Three.js or Processing.js. So I don't think I'd be making a JavaScript implementation of FieldTrip, but I believe the server software could be made to be general purpose, and reusable in the work of others like yourselves. That would be a satisfying byproduct. The idea here is that the resulting website will show fully live and real time EEG data, specifically while I am sleeping. Since I only sleep for ~1/3 of any given day, the ability to replay things will be helpful in giving the site utility during the other 2/3. I've never done any signal processing before, not even so much as a fast Fourier transform. But I'm willing to learn! I'll be consulting the tutorial you've kindly written, but if you have any suggestions of learning material I should look at when figuring out how to (for example) detect when a subject has entered levels of sleep given streams of EEG data, it would be a lot of help to me. Unfortunately, the paper you linked to ( http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) is behind a paywall and is $35, but if you recommend it highly enough, I'll check it out. Again, thank you for being so welcome to a newbie, and for the recommendations and links. -- Eric On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Eric, > > I think that NeuroSky renamed and discontinued some of their products > since we made the initial implementation of the ThinkCap. I am still able > to find documentation here > http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdfand > http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell > whether the complete sets now sold by NeuroSky still use the same software > interface, but NeuroSky is rather open with their development tools. > > Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The > Epoc has more channels and a head mount for the electrodes. For the Epoc > you have to look into teh different SDK options, the cheapest version only > gives access to processed data, not to the raw data. For both the Epoc and > openeeg a implementation of a stand-allone executable is available in > http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke > for the ThinkCap, this copies the data to a "fieldtrip buffer", where > another (c/c++/java/python/matlab) application can easily read it from and > do the signal processing, not having to worry about the buffering and data > representation any more. > > I know it falls outside your budget, but have a look at > http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. > These KT88-1016 systems are available from ebay. > > Let me add a bit from the developers perspective and software design. The > rationale for the fieldtrip buffer is that it allows us to develop analysis > pipelines using EEG data files on disk (using ft_read_data). Once the > offline analysis pipeline performs as desired, we just switch from reading > to disk to reading from the buffer (also ft_read_data). We happen to do > this using MATLAB for the rapid application development, but the same > strategy (develop for file, run in real-time) can be used with another > programming environment. > > I think that for signal processing you'll better off if you develop the > code using some good quality data from a file on disk. You can always enact > a real-time data stream by replaying data from that EEG file, or using the > sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, > constantly having to wear the headset. That is fine for artefact detection > (you can blink while you code), but not if the tasks get more complicated, > e.g. relaxing to increase your occipital alpha/10Hz won't work well if you > also have in realtime have to monitor whether your applications picks up > the alpha. > > Some time ago we (i.e. Boris Reuderink and me) looked into the > possibilities of a web-standards implementation. Web Sockets would be > needed in Javascript if we want to have the browser connect to a > "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky > w.r.t. it working on all platforms. A server-side implementation offers > more choice, python/java/php reading the data from a FT buffer or from the > device, and then pass it on in html format to the connected web ) but would > not scale as easily with multiple client connections if data processing > needs to be done on the server. We then considered the best option to be > to implement a RESTless server implementation. The server would one the one > hand contains the FT buffer (where it receives the data over low-level TCP) > and on the other hand have a web server with the RESTless interface. I.e. > the requests that are represented here > http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would > each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" > and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You > can ask Boris (CC) offline whether he has given it further thought. > > best regards, > Robert > > > > On 2 Mar 2013, at 3:12, Eric Mill wrote: > > > Hi all, > > > > My apologies if this is off-topic here, since you all seem like very > busy experts! > > > > I'm trying to figure out what I need to get started with capturing > real-time EEG data using consumer-priced headsets (<$200). I don't actually > have any interest in using MATLAB, though - I just want to capture the raw > data, in real time. > > > > I see that FieldTrip has a realtime acquisition module for NeuroSky's > "ThinkCap", though I can't find a current product by NeuroSky called that. > Is there something else of theirs I could buy that would work with > FieldTrip? > > > > Or, should I be looking elsewhere entirely? What should someone who > wants real-time EEG data do? > > > > My plan is to stream this data and visualize it on the web in real time. > My background is in web development, not cognitive science, but I'm willing > to learn what I have to make something interesting. I'd also love to have > the project result in libraries useful for other people in the field. > > > > Thanks for any advice you can give on what EEG to buy, and/or where to > learn the core concepts I'll need to use the data. > > > > -- Eric > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 4 07:16:04 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 4 Mar 2013 07:16:04 +0100 Subject: [FieldTrip] troubles while reading 4D MEG files in getting the MEG channels In-Reply-To: References: <1538559706.484002.1361969272444.JavaMail.root@bureau-frontal1> Message-ID: Hi Sophie, That's strange. I assume that the same problem occurs when you try it with the xxx.COH dataset? Could you create yourself an account on our bugzilla.fcdonders.nl website, and file a bug about this? If you then upload one of the xxx.COH datasets (along with the config-file), as well as the MEG_LABEL variable we can have a look at it. Best wishes, Jan-Mathijs On Feb 27, 2013, at 1:51 PM, sophie chen wrote: > Dear all, > > I am trying to read MEG 4D files with Fieldtrip version 20130226 using ft_preprocessing file with a preselection of MEG channels ( 'MEG' or a cell array of channel names, here is MEG_LABEL) but the output > data contains only 152 channels while I have 248 channels... I tried the same code with Fieldtrip version 20121015, and I get everything properly (i.e. 248 channels) > Following the script I am running and the corresponding results in matlab. > > > cfg = []; > cfg.dataset = 'c,rfDC'; > cfg.trialdef.eventtype = 'TRIGGER'; > cfg.trialdef.eventvalue = 2; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim = 2; > [cfg] = ft_definetrial(cfg); > > % cfg.channel = 'MEG'; > cfg.channel = MEG_LABEL; > cfg.continous = 'yes'; > data_2 = ft_preprocessing (cfg) > > I get this >> > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 123 > evaluating trialfunction 'ft_trialfun_general' > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_trialfun_general at 71 > In ft_definetrial at 162 > undoing the Supine balancing > reading the events from 'c,rfDC' > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_read_event at 174 > In ft_trialfun_general at 80 > In ft_definetrial at 162 > found 677 events > created 249 trials > the call to "ft_definetrial" took 5 seconds > applying digital weights in the gradiometer balancing matrix > Warning: all channels must have unique labels, creating unique labels > > In ft_read_header at 1681 > In ft_preprocessing at 394 > processing channel { 'A2' 'A104' 'A241' 'A138' 'A71' 'A125' 'A20' 'A65' 'A9' 'A114' 'A175' 'A228' 'A35' 'A191' 'A37' 'A170' 'A207' 'A224' 'A82' 'A238' 'A28' 'A239' 'A13' 'A165' 'A204' 'A25' 'A70' 'A11' 'A47' 'A64' 'A177' 'A127' 'A247' 'A194' 'A5' 'A242' 'A168' 'A31' 'A245' 'A219' 'A105' 'A222' 'A76' 'A188' 'A215' 'A235' 'A181' 'A38' 'A230' 'A91' 'A212' 'A24' 'A96' 'A57' 'A86' 'A116' 'A141' 'A120' 'A80' 'A210' 'A113' 'A27' 'A135' 'A167' 'A206' 'A100' 'A43' 'A200' 'A102' 'A132' 'A122' 'A62' 'A21' 'A229' 'A55' 'A32' 'A85' 'A58' 'A60' 'A88' 'A79' 'A203' 'A145' 'A139' 'A156' 'A68' 'A159' 'A236' 'A161' 'A6' 'A126' 'A94' 'A15' 'A193' 'A150' 'A36' 'A225' 'A195' 'A172' 'A108' 'A81' 'A171' 'A218' 'A173' 'A201' 'A74' 'A29' 'A164' 'A232' 'A69' 'A157' 'A97' 'A124' 'A40' 'A178' 'A179' 'A33' 'A147' 'A148' 'A89' 'A119' 'A52' 'A190' 'A73' 'A136' 'A184' 'A51' 'A77' 'A129' 'A197' 'A182' 'A46' 'A92' 'A41' 'A90' 'A23' 'A154' 'A18' 'A248' 'A149' 'A118' 'A152' 'A140' 'A110' 'A185' 'A162' 'A106' 'A187' 'A221' 'A133' 'A158' 'A216' } > reading and preprocessing > reading and preprocessing trial 249 from 249 > > the call to "ft_preprocessing" took 20 seconds > > data_2 = > > hdr: [1x1 struct] > label: {152x1 cell} > time: {1x249 cell} > trial: {1x249 cell} > fsample: 2.0345e+03 > sampleinfo: [249x2 double] > trialinfo: [249x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > This is what I get with Fieldtrip 20121015: > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 123 > evaluating trialfunction 'ft_trialfun_general' > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > reading the events from 'c,rfDC' > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > found 677 events > created 249 trials > the call to "ft_definetrial" took 7 seconds > applying digital weights in the gradiometer balancing matrix > undoing the Supine balancing > processing channel { 'A22' 'A2' 'A104' 'A241' 'A138' 'A214' 'A71' 'A26' 'A93' 'A39' 'A125' 'A20' 'A65' 'A9' 'A8' 'A95' 'A114' 'A175' 'A16' 'A228' 'A35' 'A191' 'A37' 'A170' 'A207' 'A112' 'A224' 'A82' 'A238' 'A202' 'A220' 'A28' 'A239' 'A13' 'A165' 'A204' 'A233' 'A98' 'A25' 'A70' 'A72' 'A11' 'A47' 'A160' 'A64' 'A3' 'A177' 'A63' 'A155' 'A10' 'A127' 'A67' 'A115' 'A247' 'A174' 'A194' 'A5' 'A242' 'A176' 'A78' 'A168' 'A31' 'A223' 'A245' 'A219' 'A12' 'A186' 'A105' 'A222' 'A76' 'A50' 'A188' 'A231' 'A45' 'A180' 'A99' 'A234' 'A215' 'A235' 'A181' 'A38' 'A230' 'A91' 'A212' 'A24' 'A66' 'A42' 'A96' 'A57' 'A86' 'A56' 'A116' 'A151' 'A141' 'A120' 'A189' 'A80' 'A210' 'A143' 'A113' 'A27' 'A137' 'A135' 'A167' 'A75' 'A240' 'A206' 'A107' 'A130' 'A100' 'A43' 'A200' 'A102' 'A132' 'A183' 'A199' 'A122' 'A19' 'A62' 'A21' 'A229' 'A84' 'A213' 'A55' 'A32' 'A85' 'A146' 'A58' 'A60' 'A88' 'A79' 'A169' 'A54' 'A203' 'A145' 'A103' 'A163' 'A139' 'A49' 'A166' 'A156' 'A128' 'A68' 'A159' 'A236' 'A161' 'A121' 'A4' 'A61' 'A6' 'A126' 'A14' 'A94' 'A15' 'A193' 'A150' 'A227' 'A59' 'A36' 'A225' 'A195' 'A30' 'A109' 'A172' 'A108' 'A81' 'A171' 'A218' 'A173' 'A201' 'A74' 'A29' 'A164' 'A205' 'A232' 'A69' 'A157' 'A97' 'A217' 'A101' 'A124' 'A40' 'A123' 'A153' 'A178' 'A1' 'A179' 'A33' 'A147' 'A117' 'A148' 'A87' 'A89' 'A243' 'A119' 'A52' 'A142' 'A211' 'A190' 'A53' 'A192' 'A73' 'A226' 'A136' 'A184' 'A51' 'A237' 'A77' 'A129' 'A131' 'A198' 'A197' 'A182' 'A46' 'A92' 'A41' 'A90' 'A7' 'A23' 'A83' 'A154' 'A34' 'A17' 'A18' 'A248' 'A149' 'A118' 'A208' 'A152' 'A140' 'A144' 'A209' 'A110' 'A111' 'A244' 'A185' 'A246' 'A162' 'A106' 'A187' 'A48' 'A221' 'A196' 'A133' 'A158' 'A44' 'A134' 'A216' } > reading and preprocessing > reading and preprocessing trial 249 from 249 > > the call to "ft_preprocessing" took 24 seconds > > data_2 = > > hdr: [1x1 struct] > label: {248x1 cell} > time: {1x249 cell} > trial: {1x249 cell} > fsample: 2.0345e+03 > sampleinfo: [249x2 double] > trialinfo: [249x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > I hope this helps to find out where the problem is coming from... > Thanks in advance for your help > > Cheers, > > Sophie Chen > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 4 11:11:24 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 4 Mar 2013 11:11:24 +0100 (CET) Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well In-Reply-To: <512FD5B5.8080700@gmail.com> References: <512FD5B5.8080700@gmail.com> Message-ID: <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> hi Ye, here is a FAQ about the function of the ft_volumereslice function: http://fieldtrip.fcdonders.nl/faq/how_change_mri_orientation_size_fov One of the reasons why it is suggested to use the ft_volumereslice function before segmentation is that some of the segmentation-processes require isotropic voxels (this means that a voxel must have the same size into each direction). The ft_volumereslice function is reslicing the image and returns it with isotropic voxel-size. But if your mri images are isotropic, you do not need to bother with this. But you have to be careful when you use the ft_volumereslice function and you do not specify the resolution or the dimensions of its output. In this case, it will return the image resliced to a default resolution and a default dimension (it is 256X256X256 with 1 mm resolution if I remember well), and it is possible that your image will loose some information. I suspect that this happened when you resliced your mri. Can you see the whole brain when you plot the resliced mri with the ft_sourcplot function? The solution for this problem is that you define the resolution and the dimensions yourself for ft_volumereslice. I hope this helps. Best, Lilla > Hello All, > > I found the problem I mentioned in the previous email was caused by > using "mri_sliced = ft_volumereslice([], mri);" before using > ft_volumesegment. > After erasing the line "mri_sliced = ft_volumereslice([], mri);", the > segmented brain seems to be normal and fits the sensor helmet well now, > as show in the attached figure(notvolumnsliced.jpg). > For another of my subject, if the "ft_volumereslice" is included, the > brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" > it looks normal(subject2.jpg). > > I notice in the fieldtrip headmodel tutorial > (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), > "ft_volumereslice" is not used. but in the field trip beamformer > tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. > > I am wondering if I should include "ft_volumereslice" in my source > localization code. Can anyone give me some suggestions? > > > > thanks ahead, > Ye > > > > > On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. segmented brain seems not fitting the sensor helmet well (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 11:38:21 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512F87FD.80500 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >> segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: brain.png >> Type: image/png >> Size: 15197 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: head.jpg >> Type: image/jpeg >> Size: 50294 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 31 >> ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Joachim.Gross at glasgow.ac.uk Mon Mar 4 15:37:49 2013 From: Joachim.Gross at glasgow.ac.uk (Joachim Gross) Date: Mon, 4 Mar 2013 14:37:49 +0000 Subject: [FieldTrip] 5-year Post-Doc Position in Glasgow Message-ID: <9967549B-AA9A-40DC-A640-E01C60730107@glasgow.ac.uk> Research Associate Ref: M00513 Salary: Grade 6/7 £26,264 - £29,541 / £32,267 - £36,298 per annum You will contribute to a 5-year Wellcome Trust funded research project entitled “Natural and modulated neural communication: State-dependent decoding and driving of human Brain Oscillations” (Joint Investigators: Gregor Thut, Joachim Gross). The job requires working in an interdisciplinary team of researchers on longstanding questions of how brain oscillations orchestrate brain functions, or relate to brain dysfunction. This will involve the development and/or application of new analysis methods to eavesdrop on brain communication and decode some of the information coded in brain oscillations (MEG/EEG). The successful applicant will be part of a larger team of researchers where information decoding (MEG/EEG) is complemented with controlled intervention into brain oscillations by transcranial stimulation to modulate brain function (combined TMS/tACS-EEG). For more information on the position and environment please write to Joachim.Gross at glasgow.ac.uk, orGregor.Thut at glasgow.ac.uk Apply online at www.glasgow.ac.uk/jobs Closing date: 1 April 2013 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Mon Mar 4 18:45:22 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Mon, 04 Mar 2013 18:45:22 +0100 Subject: [FieldTrip] MNE surface data: normalising and averaging? In-Reply-To: <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> Message-ID: <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Dear Fieldtrippers, I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! Best regards, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 4 22:01:51 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 04 Mar 2013 22:01:51 +0100 Subject: [FieldTrip] MNE surface data: normalising and averaging? In-Reply-To: <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Message-ID: <51350BBF.4040807@donders.ru.nl> Hi Gregor, would there be any reason why the following approach might not work? http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp The specific steps are in more detail explained in this (new) tutorial: http://fieldtrip.fcdonders.nl/development/beamformingextended Best, Jörn On 3/4/2013 6:45 PM, Gregor Volberg wrote: > Dear Fieldtrippers, > I need to ask for a helpful hint on MNE source reconstructions. > Following this tutorial > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained > nice individual cortical meshes and source points; the MNE forward and > inverse solution for the individuals all work well. I would now like > to normalize the individual grids to a template brain in order to do > statistics and averaging for plotting. I figured out that I could use > ft_sourceinterpolate to tranform the grid into a volumetric > representation, and then use ft_volumenormalise to normalise to a > standard brain. But this did not work too well for source structures > containing time series (like 'mne'-stcutures) where the computational > load gets very high. I also tried to use a grid of one subject as a > template for the other subject's grids with ft_sourceinterpolate and > cfg.interpmethod = 'smudge', but this seems to require two grids with > the same number of source points as input(?). > Is there a way to do a normalisation directly on brain triangulations > / source grids ? Thanks for any help! > Best regards, > Gregor > -- > Dr. rer. nat. Gregor Volberg > > ( > mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanbelluzo at gmail.com Tue Mar 5 00:27:29 2013 From: sanbelluzo at gmail.com (Santiago Belluzo) Date: Mon, 4 Mar 2013 20:27:29 -0300 Subject: [FieldTrip] Emotiv + FieldTrip + Matlab Message-ID: *Hi, I'm new to FieldTrip and I'm interested in using it to capture **realtime data from the Emotiv headset using the function emotiv2ft.I`ve tried some examples like signalviewer andpowerviewer with random signal from signalproxy to check that the FieldTripBuffer works fine. Then i`ve tried to use emotiv2ft and have problems. * *I'm not sure about how to call to this interface from within **Matlab.* *I`ve read some messages from the mailinglist with similar problem but in there is not clear for me how they solve it. * *I´ll be waiting for any help!.* *Thanks.* -- Santiago -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Tue Mar 5 09:03:24 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Tue, 05 Mar 2013 09:03:24 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <51350BBF.4040807@donders.ru.nl> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> Message-ID: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Hi Jörn, thank you for your fast response! I wasn't aware that this approach also works with irregularly spaced surface grids as input. I will try it this way. Thanks again, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> Hi Gregor, would there be any reason why the following approach might not work? http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp The specific steps are in more detail explained in this (new) tutorial: http://fieldtrip.fcdonders.nl/development/beamformingextended Best, Jörn On 3/4/2013 6:45 PM, Gregor Volberg wrote: Dear Fieldtrippers, I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! Best regards, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Mar 5 10:24:51 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 5 Mar 2013 10:24:51 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Message-ID: <348B78CB-0BFC-4446-800E-E4CF6BD838F6@donders.ru.nl> Hi Gregor, To follow up on this: I guess what Jörn meant is that you could use the irregular 3D grids, as the target grids onto which the surface data will be interpolated. This makes the interpolated 3D-grid data directly averageable. JM On Mar 5, 2013, at 9:03 AM, Gregor Volberg wrote: > Hi Jörn, > > thank you for your fast response! I wasn't aware that this approach also works with irregularly spaced surface grids as input. I will try it this way. > > Thanks again, > Gregor > > > > > -- > Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> > Hi Gregor, > > would there be any reason why the following approach might not work? > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp > > The specific steps are in more detail explained in this (new) tutorial: > http://fieldtrip.fcdonders.nl/development/beamformingextended > > Best, > Jörn > > On 3/4/2013 6:45 PM, Gregor Volberg wrote: >> Dear Fieldtrippers, >> >> I need to ask for a helpful hint on MNE source reconstructions. Following this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained nice individual cortical meshes and source points; the MNE forward and inverse solution for the individuals all work well. I would now like to normalize the individual grids to a template brain in order to do statistics and averaging for plotting. I figured out that I could use ft_sourceinterpolate to tranform the grid into a volumetric representation, and then use ft_volumenormalise to normalise to a standard brain. But this did not work too well for source structures containing time series (like 'mne'-stcutures) where the computational load gets very high. I also tried to use a grid of one subject as a template for the other subject's grids with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to require two grids with the same number of source points as input(?). >> Is there a way to do a normalisation directly on brain triangulations / source grids ? Thanks for any help! >> Best regards, >> Gregor >> >> -- >> Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) >> University of Regensburg >> Institute for Experimental Psychology >> 93040 Regensburg, Germany >> Tel: +49 941 943 3862 >> Fax: +49 941 943 3233 >> http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >> >> >> >> >> _______________________________________________ >> >> 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 Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eschulz at lrz.tu-muenchen.de Tue Mar 5 10:30:03 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Tue, 5 Mar 2013 10:30:03 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: Dear Fieldtrip experts, I would like to create a leadfield based on the standard brain provided by the fieldtrip package and standard electrode positions. Unfortunately, whatever I'm trying it ends up in a number of error messages. Is anybody out there who could provide some support? Thank you very much in advance, Best, Enrico -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 5 10:33:37 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Mar 2013 10:33:37 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> <51350BBF.4040807@donders.ru.nl> <5135B4DC0200005700011EF2@gwsmtp1.uni-regensburg.de> Message-ID: <5135BBF1.5090005@donders.ru.nl> Hi again, as a second link I meant to paste this one: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended The procedure, however, is in more detail explained in the first link I pasted, in this tutorial an example of how to use that is illustrated. Hope it works out! Best, Jörn On 3/5/2013 9:03 AM, Gregor Volberg wrote: > > Hi Jörn, > > > thank you for your fast response! I wasn't aware that this approach > also works with irregularly spaced surface grids as input. I will try > it this way. > > > Thanks again, > > Gregor > > > > > > -- > Dr. rer. nat. Gregor Volberg > ( > mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > > > >>> "Jörn M. Horschig" 3/4/2013 10:01 PM >>> > > Hi Gregor, > > would there be any reason why the following approach might not work? > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=warp > > The specific steps are in more detail explained in this (new) tutorial: > http://fieldtrip.fcdonders.nl/development/beamformingextended > > Best, > Jörn > > On 3/4/2013 6:45 PM, Gregor Volberg wrote: > >> Dear Fieldtrippers, >> >> I need to ask for a helpful hint on MNE source reconstructions. >> Following this tutorial >> http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I obtained >> nice individual cortical meshes and source points; the MNE forward >> and inverse solution for the individuals all work well. I would now >> like to normalize the individual grids to a template brain in order >> to do statistics and averaging for plotting. I figured out that I >> could use ft_sourceinterpolate to tranform the grid into a volumetric >> representation, and then use ft_volumenormalise to normalise to a >> standard brain. But this did not work too well for source structures >> containing time series (like 'mne'-stcutures) where the computational >> load gets very high. I also tried to use a grid of one subject as a >> template for the other subject's grids with ft_sourceinterpolate and >> cfg.interpmethod = 'smudge', but this seems to require two grids with >> the same number of source points as input(?). >> >> Is there a way to do a normalisation directly on brain triangulations >> / source grids ? Thanks for any help! >> >> Best regards, >> >> Gregor >> >> -- >> Dr. rer. nat. Gregor Volberg >> > > ( >> mailto:gregor.volberg at psychologie.uni-regensburg.de ) >> University of Regensburg >> Institute for Experimental Psychology >> 93040 Regensburg, Germany >> Tel: +49 941 943 3862 >> Fax: +49 941 943 3233 >> http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >> >> >> >> _______________________________________________ >> >> >> >> >> 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 -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 5 11:33:05 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Mar 2013 11:33:05 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <5135C9E1.3030906@donders.ru.nl> Dear Enrico, we are always very happy to provide support and help. If you just copy and paste your cfg settings, the function-call itself and the error you got, then we can try to find what is going wrong. Feel free to write this to the general discussion list rather than to any specific person - that way others running intro similar issues might find the here proposed solution easier. Best, Jörn On 3/5/2013 10:30 AM, Enrico Schulz wrote: > Dear Fieldtrip experts, > > I would like to create a leadfield based on the standard brain > provided by the fieldtrip package and standard electrode positions. > Unfortunately, whatever I'm trying it ends up in a number of error > messages. > > Is anybody out there who could provide some support? > > Thank you very much in advance, > Best, > Enrico > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Tue Mar 5 12:08:08 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Tue, 5 Mar 2013 12:08:08 +0100 (CET) Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Dear Enrico, I think more information is needed about the error messages and about how you try to compute leadfield in order to help. If you have not encountered the FT tutorial sites, example scripts and FAQs yet, maybe you can check out those as well because they provide information on source-reconstruction, leadfields... etc.. (For example, a tutorial for EEG headmodels: http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example script for leadfield computation: http://fieldtrip.fcdonders.nl/example/compute_leadfield). Best, Lilla > Dear Fieldtrip experts, > > I would like to create a leadfield based on the standard brain provided by > the fieldtrip package and standard electrode positions. > Unfortunately, whatever I'm trying it ends up in a number of error > messages. > > Is anybody out there who could provide some support? > > Thank you very much in advance, > Best, > Enrico > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hamid.mohseni at eng.ox.ac.uk Tue Mar 5 19:03:23 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Tue, 5 Mar 2013 18:03:23 +0000 Subject: [FieldTrip] Downloading tutorial data Message-ID: Hi, I cannot download tutorial files e.g.: ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip I tried both chrome and firefox, is there any reason? -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Wed Mar 6 05:24:28 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 5 Mar 2013 23:24:28 -0500 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: Sorry, that was a very long response on my part - but the one actual question I have in there is, how easy is it to switch from one EEG device to another? Should I expect to have to rework my code entirely, or will the core data format and signal processing work be the same? Is standardizing the data stream one of the things using an intermediary like Field Trip does? -- Eric On Sun, Mar 3, 2013 at 5:26 PM, Eric Mill wrote: > This is extremely helpful, and just what I was looking for, thank you > (both Robert and Stefan). I have a few followup questions you've inspired. > > How "swappable" is the hardware? Do all EEG's fundamentally produce the > same data from the same brain activity? And/or, does FieldTrip always > expose data in its buffer in the same format? > > For example, I would be fine investing the $750 for an Emotiv 14-channel > EEG, or even the $1200 for a KT88-1016, but not until after I've done some > development with a cheaper device first. However, I would not want to have > to rewrite all my code, or much of it, if I switch devices. > > I do have a requirement that I can have the same code work with either > live or replayed data. From how you describe its buffer approach, it sounds > like that's a core value of FieldTrip, and will make that requirement much > easier to satisfy. > > Also, I do have one peculiar requirement, which is that the hardware be > suitable for wearing during ordinary sleeping at home. This is more a > requirement for the final (potentially more expensive) device, than the > development device. The promotional photo for the Emotiv EEG, > for example, looks like it might not be so great for that. > > I think I will be using WebSockets, but there will be an intermediate > server. So, I will have a computer (perhaps a Raspberry Pi) receive data > from the EEG, and then immediately stream it up an open TCP connection to a > web server. This server will then stream it down to the individual browsers > of visiting users, and JavaScript will do the visualization, in something > like Three.js or Processing.js. > > So I don't think I'd be making a JavaScript implementation of FieldTrip, > but I believe the server software could be made to be general purpose, and > reusable in the work of others like yourselves. That would be a satisfying > byproduct. > > The idea here is that the resulting website will show fully live and real > time EEG data, specifically while I am sleeping. Since I only sleep for > ~1/3 of any given day, the ability to replay things will be helpful in > giving the site utility during the other 2/3. > > I've never done any signal processing before, not even so much as a fast > Fourier transform. But I'm willing to learn! I'll be consulting the > tutorial you've kindly written, > but if you have any suggestions of learning material I should look at when > figuring out how to (for example) detect when a subject has entered levels > of sleep given streams of EEG data, it would be a lot of help to me. > > Unfortunately, the paper you linked to ( > http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) is > behind a paywall and is $35, but if you recommend it highly enough, I'll > check it out. > > Again, thank you for being so welcome to a newbie, and for the > recommendations and links. > > -- Eric > > > On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld < > r.oostenveld at donders.ru.nl> wrote: > >> Hi Eric, >> >> I think that NeuroSky renamed and discontinued some of their products >> since we made the initial implementation of the ThinkCap. I am still able >> to find documentation here >> http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdfand >> http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell >> whether the complete sets now sold by NeuroSky still use the same software >> interface, but NeuroSky is rather open with their development tools. >> >> Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The >> Epoc has more channels and a head mount for the electrodes. For the Epoc >> you have to look into teh different SDK options, the cheapest version only >> gives access to processed data, not to the raw data. For both the Epoc and >> openeeg a implementation of a stand-allone executable is available in >> http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke >> for the ThinkCap, this copies the data to a "fieldtrip buffer", where >> another (c/c++/java/python/matlab) application can easily read it from and >> do the signal processing, not having to worry about the buffering and data >> representation any more. >> >> I know it falls outside your budget, but have a look at >> http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. >> These KT88-1016 systems are available from ebay. >> >> Let me add a bit from the developers perspective and software design. The >> rationale for the fieldtrip buffer is that it allows us to develop analysis >> pipelines using EEG data files on disk (using ft_read_data). Once the >> offline analysis pipeline performs as desired, we just switch from reading >> to disk to reading from the buffer (also ft_read_data). We happen to do >> this using MATLAB for the rapid application development, but the same >> strategy (develop for file, run in real-time) can be used with another >> programming environment. >> >> I think that for signal processing you'll better off if you develop the >> code using some good quality data from a file on disk. You can always enact >> a real-time data stream by replaying data from that EEG file, or using the >> sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, >> constantly having to wear the headset. That is fine for artefact detection >> (you can blink while you code), but not if the tasks get more complicated, >> e.g. relaxing to increase your occipital alpha/10Hz won't work well if you >> also have in realtime have to monitor whether your applications picks up >> the alpha. >> >> Some time ago we (i.e. Boris Reuderink and me) looked into the >> possibilities of a web-standards implementation. Web Sockets would be >> needed in Javascript if we want to have the browser connect to a >> "fieldtrip buffer" TCP server. The Web Sockets still seemed a bit risky >> w.r.t. it working on all platforms. A server-side implementation offers >> more choice, python/java/php reading the data from a FT buffer or from the >> device, and then pass it on in html format to the connected web ) but would >> not scale as easily with multiple client connections if data processing >> needs to be done on the server. We then considered the best option to be >> to implement a RESTless server implementation. The server would one the one >> hand contains the FT buffer (where it receives the data over low-level TCP) >> and on the other hand have a web server with the RESTless interface. I.e. >> the requests that are represented here >> http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would >> each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" >> and "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You >> can ask Boris (CC) offline whether he has given it further thought. >> >> best regards, >> Robert >> >> >> >> On 2 Mar 2013, at 3:12, Eric Mill wrote: >> >> > Hi all, >> > >> > My apologies if this is off-topic here, since you all seem like very >> busy experts! >> > >> > I'm trying to figure out what I need to get started with capturing >> real-time EEG data using consumer-priced headsets (<$200). I don't actually >> have any interest in using MATLAB, though - I just want to capture the raw >> data, in real time. >> > >> > I see that FieldTrip has a realtime acquisition module for NeuroSky's >> "ThinkCap", though I can't find a current product by NeuroSky called that. >> Is there something else of theirs I could buy that would work with >> FieldTrip? >> > >> > Or, should I be looking elsewhere entirely? What should someone who >> wants real-time EEG data do? >> > >> > My plan is to stream this data and visualize it on the web in real >> time. My background is in web development, not cognitive science, but I'm >> willing to learn what I have to make something interesting. I'd also love >> to have the project result in libraries useful for other people in the >> field. >> > >> > Thanks for any advice you can give on what EEG to buy, and/or where to >> learn the core concepts I'll need to use the data. >> > >> > -- Eric >> > _______________________________________________ >> > 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 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 6 07:37:00 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 06 Mar 2013 07:37:00 +0100 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: <5136E40C.3000509@donders.ru.nl> Hi Hamid, Your link works for me, and also other links on the tutorial page work for me. Not sure what might go wrong for you. Have you tried copy&pasting the link rather than clicking? I doubt the following, but maybe there is some firewall setting restricting access to the ftp-port for you? Best, Jörn On 3/5/2013 7:03 PM, Hamid Mohseni wrote: > Hi, > > I cannot download tutorial files e.g.: > > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip > > I tried both chrome and firefox, is there any reason? > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Mar 6 09:08:04 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 6 Mar 2013 09:08:04 +0100 Subject: [FieldTrip] Getting started with realtime EEG data In-Reply-To: References: <9EDC29E4-D79B-4777-A3C6-0C5E5E2C9E0F@donders.ru.nl> Message-ID: Hi Eric, Yes, FieldTrip's raw data format is the same regardless of acquisition device, so I expect no problems switching from one device to another. Note, though, that I have not worked with the realtime buffer, but I think it ought to work the same as with offline data processing. Certain analysis pipelines (e.g. source reconstruction) require accurate information about the electrode positions. The ease at which you could obtain these might differ between different devices. However, based on the info you've given so far I guess this will not be a problem for you. Best, Eelke On 6 March 2013 05:24, Eric Mill wrote: > Sorry, that was a very long response on my part - but the one actual > question I have in there is, how easy is it to switch from one EEG device to > another? Should I expect to have to rework my code entirely, or will the > core data format and signal processing work be the same? Is standardizing > the data stream one of the things using an intermediary like Field Trip > does? > > -- Eric > > > On Sun, Mar 3, 2013 at 5:26 PM, Eric Mill wrote: >> >> This is extremely helpful, and just what I was looking for, thank you >> (both Robert and Stefan). I have a few followup questions you've inspired. >> >> How "swappable" is the hardware? Do all EEG's fundamentally produce the >> same data from the same brain activity? And/or, does FieldTrip always expose >> data in its buffer in the same format? >> >> For example, I would be fine investing the $750 for an Emotiv 14-channel >> EEG, or even the $1200 for a KT88-1016, but not until after I've done some >> development with a cheaper device first. However, I would not want to have >> to rewrite all my code, or much of it, if I switch devices. >> >> I do have a requirement that I can have the same code work with either >> live or replayed data. From how you describe its buffer approach, it sounds >> like that's a core value of FieldTrip, and will make that requirement much >> easier to satisfy. >> >> Also, I do have one peculiar requirement, which is that the hardware be >> suitable for wearing during ordinary sleeping at home. This is more a >> requirement for the final (potentially more expensive) device, than the >> development device. The promotional photo for the Emotiv EEG, for example, >> looks like it might not be so great for that. >> >> I think I will be using WebSockets, but there will be an intermediate >> server. So, I will have a computer (perhaps a Raspberry Pi) receive data >> from the EEG, and then immediately stream it up an open TCP connection to a >> web server. This server will then stream it down to the individual browsers >> of visiting users, and JavaScript will do the visualization, in something >> like Three.js or Processing.js. >> >> So I don't think I'd be making a JavaScript implementation of FieldTrip, >> but I believe the server software could be made to be general purpose, and >> reusable in the work of others like yourselves. That would be a satisfying >> byproduct. >> >> The idea here is that the resulting website will show fully live and real >> time EEG data, specifically while I am sleeping. Since I only sleep for ~1/3 >> of any given day, the ability to replay things will be helpful in giving the >> site utility during the other 2/3. >> >> I've never done any signal processing before, not even so much as a fast >> Fourier transform. But I'm willing to learn! I'll be consulting the tutorial >> you've kindly written, but if you have any suggestions of learning material >> I should look at when figuring out how to (for example) detect when a >> subject has entered levels of sleep given streams of EEG data, it would be a >> lot of help to me. >> >> Unfortunately, the paper you linked to >> (http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2012.01471.x/full) >> is behind a paywall and is $35, but if you recommend it highly enough, I'll >> check it out. >> >> Again, thank you for being so welcome to a newbie, and for the >> recommendations and links. >> >> -- Eric >> >> >> On Sun, Mar 3, 2013 at 4:58 AM, Robert Oostenveld >> wrote: >>> >>> Hi Eric, >>> >>> I think that NeuroSky renamed and discontinued some of their products >>> since we made the initial implementation of the ThinkCap. I am still able >>> to find documentation here >>> http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkcap:thinkcap_headset_user_manual.pdf >>> and http://developer.neurosky.com/docs/doku.php?id=thinkcap. I cannot tell >>> whether the complete sets now sold by NeuroSky still use the same software >>> interface, but NeuroSky is rather open with their development tools. >>> >>> Alternatives you may consider are the Emotiv Epoc or the DIY OpenEEG. The >>> Epoc has more channels and a head mount for the electrodes. For the Epoc you >>> have to look into teh different SDK options, the cheapest version only gives >>> access to processed data, not to the raw data. For both the Epoc and openeeg >>> a implementation of a stand-allone executable is available in >>> http://fieldtrip.fcdonders.nl/development/realtime/implementation. LIke for >>> the ThinkCap, this copies the data to a "fieldtrip buffer", where another >>> (c/c++/java/python/matlab) application can easily read it from and do the >>> signal processing, not having to worry about the buffering and data >>> representation any more. >>> >>> I know it falls outside your budget, but have a look at >>> http://engineuring.wordpress.com/2009/06/15/writing-your-own-soft-for-a-really-cheap-eeg-hardware-for-brain-computer-interfacing. >>> These KT88-1016 systems are available from ebay. >>> >>> Let me add a bit from the developers perspective and software design. The >>> rationale for the fieldtrip buffer is that it allows us to develop analysis >>> pipelines using EEG data files on disk (using ft_read_data). Once the >>> offline analysis pipeline performs as desired, we just switch from reading >>> to disk to reading from the buffer (also ft_read_data). We happen to do this >>> using MATLAB for the rapid application development, but the same strategy >>> (develop for file, run in real-time) can be used with another programming >>> environment. >>> >>> I think that for signal processing you'll better off if you develop the >>> code using some good quality data from a file on disk. You can always enact >>> a real-time data stream by replaying data from that EEG file, or using the >>> sine2ft GUIs (see realtime/bin). Otherwise you'll be doing all development, >>> constantly having to wear the headset. That is fine for artefact detection >>> (you can blink while you code), but not if the tasks get more complicated, >>> e.g. relaxing to increase your occipital alpha/10Hz won't work well if you >>> also have in realtime have to monitor whether your applications picks up the >>> alpha. >>> >>> Some time ago we (i.e. Boris Reuderink and me) looked into the >>> possibilities of a web-standards implementation. Web Sockets would be >>> needed in Javascript if we want to have the browser connect to a "fieldtrip >>> buffer" TCP server. The Web Sockets still seemed a bit risky w.r.t. it >>> working on all platforms. A server-side implementation offers more choice, >>> python/java/php reading the data from a FT buffer or from the device, and >>> then pass it on in html format to the connected web ) but would not scale as >>> easily with multiple client connections if data processing needs to be done >>> on the server. We then considered the best option to be to implement a >>> RESTless server implementation. The server would one the one hand contains >>> the FT buffer (where it receives the data over low-level TCP) and on the >>> other hand have a web server with the RESTless interface. I.e. the requests >>> that are represented here >>> http://fieldtrip.fcdonders.nl/development/realtime/buffer_protocol would >>> each translate to a http call like "http://ftbuffer.donders.nl/get/hdr" and >>> "http://ftbuffer.donders.nl/get/dat?begsample=xx&endsample=xx". You can ask >>> Boris (CC) offline whether he has given it further thought. >>> >>> best regards, >>> Robert >>> >>> >>> >>> On 2 Mar 2013, at 3:12, Eric Mill wrote: >>> >>> > Hi all, >>> > >>> > My apologies if this is off-topic here, since you all seem like very >>> > busy experts! >>> > >>> > I'm trying to figure out what I need to get started with capturing >>> > real-time EEG data using consumer-priced headsets (<$200). I don't actually >>> > have any interest in using MATLAB, though - I just want to capture the raw >>> > data, in real time. >>> > >>> > I see that FieldTrip has a realtime acquisition module for NeuroSky's >>> > "ThinkCap", though I can't find a current product by NeuroSky called that. >>> > Is there something else of theirs I could buy that would work with >>> > FieldTrip? >>> > >>> > Or, should I be looking elsewhere entirely? What should someone who >>> > wants real-time EEG data do? >>> > >>> > My plan is to stream this data and visualize it on the web in real >>> > time. My background is in web development, not cognitive science, but I'm >>> > willing to learn what I have to make something interesting. I'd also love to >>> > have the project result in libraries useful for other people in the field. >>> > >>> > Thanks for any advice you can give on what EEG to buy, and/or where to >>> > learn the core concepts I'll need to use the data. >>> > >>> > -- Eric >>> > _______________________________________________ >>> > 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 >> >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Gregor.Volberg at psychologie.uni-regensburg.de Wed Mar 6 09:50:55 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Wed, 06 Mar 2013 09:50:55 +0100 Subject: [FieldTrip] Antw: Re: MNE surface data: normalising and averaging? In-Reply-To: References: <512FD5B5.8080700@gmail.com> <50250.131.174.45.70.1362391884.squirrel@131.174.45.70> <5134EBC20200005700011EEC@gwsmtp1.uni-regensburg.de> Message-ID: <5137117F0200005700011F41@gwsmtp1.uni-regensburg.de> Hi Gio, Jan-Mathijs and Jörn, thank you all for your helpful replies. Gio, a special 'thank you' for your very detailled response. These are very interesting points, though somewhat beyond of what I try to do. I will be working through the suggested literature and the new tutorial and might come back later if there are further questions. Best regard, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> Gio Piantoni 05.03.2013 09:20 >>> Hi Gregor, I also like the surface approach a lot, but things get really complicated when you have to average across subjects. I don't know if you are familiar with statistics in freesurfer, but what they do is to convert the source points of the single subject to a subject-specific sphere. Then the sphere is averaged across subjects. The coregistration between these spheres takes advantage of landmarks. See my attempt at: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-September/005585.html If I understand you correctly, you are at step 3). You can use smudge to get to the high-resolution smoothwm (or pial). Then the number of vertices in smoothwm corresponds to the number of vertices in the sphere. Here you have two options: use fieldtrip code or MNE code. I tried using fieldtrip code, but where I got stuck was to do statistics on the averaged sphere (taken from fsaverage). I used this code: https://github.com/gpiantoni/eventbased/blob/77c3f85ef94baf9d4ab629d48a31e8046c924518/powsource_grand.m#L136-L158 where data{i1,i2,p,h} is already projected onto the subject-specific sphere. However, after projecting to the averaged sphere, you need to do statistics on a 2-d cortical sheet and, from my understanding, the subfunctions to create clusters do not work all that well. I think it'd be very powerful to do statistics on a 2d sheet. See http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004749.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2012-February/004766.html for discussion. I did not get far because the clustering methods needed updated to work on cortical sheets in an efficient manner. Another route you can try is to use the MNE/freesurfer software to do that. See for example: http://martinos.org/mne/manual/morph.html You'd just write the surface to disk and use MNE/freesurfer. I personally don't like the method to correct for multiple comparisons in freesurfer (which I think might give false positive) and I think that the fieldtrip stats is better, but I had some problems getting to work on 2-d cortical sheets. For the moment, I decided to go with the volume-based approach, although I have the feeling that it's less accurate and less sensitive. See also: Tucholka, A., Fritsch, V., Poline, J.-B., and Thirion, B. (2012). An empirical comparison of surface-based and volume-based group studies in neuroimaging. Neuroimage 63, 1443–1453. Maybe I confused you more than helped, but if you manage to do statistics on surfaces, please let me know because I'd be interested in using it. Hope this helps. Gio -- Giovanni Piantoni, MSc Dept. Sleep & Cognition Netherlands Institute for Neuroscience Meibergdreef 47 1105 BA Amsterdam (NL) +31 20 5665492 gio at gpiantoni.com www.gpiantoni.com On Mon, Mar 4, 2013 at 6:45 PM, Gregor Volberg wrote: > Dear Fieldtrippers, > > I need to ask for a helpful hint on MNE source reconstructions. Following > this tutorial http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate I > obtained nice individual cortical meshes and source points; the MNE forward > and inverse solution for the individuals all work well. I would now like to > normalize the individual grids to a template brain in order to do statistics > and averaging for plotting. I figured out that I could use > ft_sourceinterpolate to tranform the grid into a volumetric representation, > and then use ft_volumenormalise to normalise to a standard brain. But this > did not work too well for source structures containing time series (like > 'mne'-stcutures) where the computational load gets very high. I also tried > to use a grid of one subject as a template for the other subject's grids > with ft_sourceinterpolate and cfg.interpmethod = 'smudge', but this seems to > require two grids with the same number of source points as input(?). > Is there a way to do a normalisation directly on brain triangulations / > source grids ? Thanks for any help! > Best regards, > Gregor > > -- > Dr. rer. nat. Gregor Volberg > ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) > University of Regensburg > Institute for Experimental Psychology > 93040 Regensburg, Germany > Tel: +49 941 943 3862 > Fax: +49 941 943 3233 > http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Wed Mar 6 10:37:37 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Wed, 6 Mar 2013 09:37:37 +0000 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Thanks, It works fine today, Regards On 6 March 2013 06:37, "Jörn M. Horschig" wrote: > Hi Hamid, > > Your link works for me, and also other links on the tutorial page work for > me. Not sure what might go wrong for you. Have you tried copy&pasting the > link rather than clicking? I doubt the following, but maybe there is some > firewall setting restricting access to the ftp-port for you? > > Best, > Jörn > > > > On 3/5/2013 7:03 PM, Hamid Mohseni wrote: > > Hi, > > I cannot download tutorial files e.g.: > > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip > > I tried both chrome and firefox, is there any reason? > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.ye.mei at gmail.com Wed Mar 6 22:35:53 2013 From: frank.ye.mei at gmail.com (Ye Mei) Date: Wed, 06 Mar 2013 16:35:53 -0500 Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well, (jan-mathijs schoffelen) In-Reply-To: References: Message-ID: <5137B6B9.5080400@gmail.com> Hi Jan-Mathijs, Thank you very much for the reply. I think the problem starts at "mri_sliced = ft_volumereslice([], mri);" before using "ft_volumesegment.". The attached file "beforevolumnslice.png" is the result of "imagesc(squeeze(mri.anatomy(:,111,:)))"; The attached file "aftervolumnslice.png" is the result of "imagesc(squeeze(mri_sliced.anatomy(:,111,:)))". We can see part of the head in "aftervolumnslice.png" is already sliced away. Could one do source localization without using "mri_sliced = ft_volumereslice([], mri);"? To circumvent the problem, I am trying to use FreeSurfer instead of ft_volumereslice and ft_volumesegment. I had several .mgz files from freesurfer. Can I do the following? -------- mri=ft_read_mri("brain.mgz"); %brain.mgz is the segmented brain by FreeSurfer cfg = []; cfg.method ='fiducial'; cfg.fiducial.nas = [30 132 96];% position of Nasion cfg.fiducial.lpa = [127 113 170];% position of LPA cfg.fiducial.rpa = [125 115 18]% position of RPA cfg.fiducial.zpoint = [125 125 220] [mri_aligned] = ft_volumerealign(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, mri_aligned); ... --------- thanks ahead, Ye On 13-02-28 05:10 PM, fieldtrip-request at science.ru.nl wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: NIHC-BrainGain Tutorial Day - March 21, 2013 > (Robert Oostenveld) > 2. Re: segmented brain seems not fitting the sensor helmet well > (jan-mathijs schoffelen) > 3. Re: segmented brain seems not fitting the sensor helmet well > (Ye Mei) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 28 Feb 2013 17:46:39 +0100 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] NIHC-BrainGain Tutorial Day - March 21, 2013 > Message-ID: <9741C083-F00A-4BC9-86EF-FB99715576A7 at donders.ru.nl> > Content-Type: text/plain; charset=windows-1252 > > Dear FieldTrip users, > > The NIHC-BrainGain Tutorial Day marks the end of the BrainGain project. For the last 6 years, the development and continued support of FieldTrip for normal/offline and realtime/online analysis has received support from the BrainGain project. > > There is now more information available online on this tutorial day, please see > https://www.hersenenencognitie.nl/contents/1876 > https://www.hersenenencognitie.nl/contents/1915 > > If you happen to be close to Nijmegen, you might also want to come to the "Breinfest" on Tuesday evening 19 March in the city centre with talks by international speakers and BCI demo's for the general public. Personally, I will be demonstrating how real-time data streaming and processing can be done using the FieldTrip buffer to various platforms (OS X, WIndows, Linux), to the Raspberry Pi and even to an Arduino (yes, fieldtrip runs on an arduino! ... well, a small part of it runs on an arduino). See http://www.ru.nl/breinfest for details on the evening. > > best regards, > Robert > > > > On 19 Feb 2013, at 14:30, Robert Oostenveld wrote: > >> NIHC-BrainGain Tutorial Day: >> Tools and novelties in neurotechnology research >> >> We invite PhD students, post-docs and senior researchers working in the fields of brain-computer interfacing (BCI), neurofeedback, cognitive neuroscience, neuroinformatics, neurosurgery and related topics to our Tutorial Day on March 21st, 2013 in the Sanadome Nijmegen. >> The day marks the end of the BrainGain consortium, a six-year joint-effort project on Brain-Computer Interfacing and related technologies. More information on BrainGain can be found here. >> >> The Tutorial Day will consist of a 'tools' track and a 'novelties? track. The 'tools' track is intended to provide both newcomers to the field and experienced researchers with an overview of the tools needed to integrate cognitive neuroscience and advanced invasive and non-invasive technology. Topics range from data streaming to modelling and statistics, and from online fMRI decoding to a crash course in neuroethics., You will also receive some helpful insights for a future career, in case you are interested in applying for a grant in the near future or considering setting up your own company. >> The 'novelties' track covers a wide range of topics indicating some of the possible topics to be further explored in BCI and neurotechnology research, including genetics, robotics and intracranial recordings. >> There is no need to stick to one of the two tracks the whole day: you are free to switch between tracks any time. >> >> In parallel to the lectures, there will be several interesting demonstrations. >> >> The full programme and registration form can be found on the NIHC website (https://www.hersenenencognitie.nl). Please register before 1 March 2013. Participation is free. Lunch and drinks will be provided. >> >> We hope to welcome you on March 21st in Nijmegen! >> >> Susanna Bicknell >> Radboud University Nijmegen >> ____________________________________________________________________ >> Faculty of Science | Finance and Economic Affairs | Project Management | LC-IMPACT >> Faculty of Social Sciences | Donders Centre for Cognition | BRAINGAIN | Project Manager >> T +31 24 3653300 | HG00.616 (Monday, Thursday) >> Faculty of Science | IMAPP | T +31 24 3652972 | HG07.315 (Tuesday, Wednesday) >> Postal address: P.O. Box 9010, 6500 GL Nijmegen, The Netherlands >> Visiting and courier service address: Heyendaalseweg 135, 6525 AJ Nijmegen, The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 2 > Date: Thu, 28 Feb 2013 18:54:14 +0100 > From: jan-mathijs schoffelen > To: FieldTrip discussion list > Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor > helmet well > Message-ID: > Content-Type: text/plain; charset="us-ascii" > > Hi Ye, > > Looks like a coregistration problem to me. In other words, something went wrong in ft_volumesegment, because the images were not sufficiently aligned. You need to investigate the input and output of ft_volumesegment. > Do you use ft_volumerealign after calling ft_volumesegment? This should be the other way around. > > Best, > > Jan-Mathijs > > > On Feb 28, 2013, at 5:38 PM, Ye Mei wrote: > >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Thu, 28 Feb 2013 17:09:57 -0500 > From: Ye Mei > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor > helmet well > Message-ID: <512FD5B5.8080700 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hello All, > > I found the problem I mentioned in the previous email was caused by > using "mri_sliced = ft_volumereslice([], mri);" before using > ft_volumesegment. > After erasing the line "mri_sliced = ft_volumereslice([], mri);", the > segmented brain seems to be normal and fits the sensor helmet well now, > as show in the attached figure(notvolumnsliced.jpg). > For another of my subject, if the "ft_volumereslice" is included, the > brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" > it looks normal(subject2.jpg). > > I notice in the fieldtrip headmodel tutorial > (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), > "ft_volumereslice" is not used. but in the field trip beamformer > tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. > > I am wondering if I should include "ft_volumereslice" in my source > localization code. Can anyone give me some suggestions? > > > > thanks ahead, > Ye > > > > > On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. segmented brain seems not fitting the sensor helmet well (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 11:38:21 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512F87FD.80500 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello FieldtripList, >> >> After segmentation and alignment using >> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' segmented >> brain seems rotated forward in the sensor helmet(brain.png) and the >> cerebellum part seems to be segmented out. However, his head MRI seems >> fitting the sensor helmet well(head.jpg). My another subject's brain >> seem to be correctly segmented without missing the cerebellum part. And >> the brain is not rotated forward. >> >> Could might be the problem? >> >> thanks ahead, >> Ye >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: brain.png >> Type: image/png >> Size: 15197 bytes >> Desc: not available >> URL: >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: head.jpg >> Type: image/jpeg >> Size: 50294 bytes >> Desc: not available >> URL: >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 31 >> ***************************************** > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: notvolumnsliced.jpg > Type: image/jpeg > Size: 28621 bytes > Desc: not available > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: subject2.jpg > Type: image/jpeg > Size: 27415 bytes > Desc: not available > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: subject2vc.jpg > Type: image/jpeg > Size: 27788 bytes > Desc: not available > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 27, Issue 32 > ***************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: beforevolumnslice.png Type: image/png Size: 73996 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aftervolumnslice.png Type: image/png Size: 63576 bytes Desc: not available URL: From ajaymaddirala at gmail.com Thu Mar 7 08:29:43 2013 From: ajaymaddirala at gmail.com (ajay maddirala) Date: Wed, 6 Mar 2013 23:29:43 -0800 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Hi, I need MEG pure data. 150 channel 147 for recording brain signals 3 channels for record environment noise. please help me thank you. On Wed, Mar 6, 2013 at 1:37 AM, Hamid Mohseni wrote: > Thanks, It works fine today, > > Regards > > > On 6 March 2013 06:37, "Jörn M. Horschig" wrote: > >> Hi Hamid, >> >> Your link works for me, and also other links on the tutorial page work >> for me. Not sure what might go wrong for you. Have you tried copy&pasting >> the link rather than clicking? I doubt the following, but maybe there is >> some firewall setting restricting access to the ftp-port for you? >> >> Best, >> Jörn >> >> >> >> On 3/5/2013 7:03 PM, Hamid Mohseni wrote: >> >> Hi, >> >> I cannot download tutorial files e.g.: >> >> ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/ArtifactMEG.zip >> >> I tried both chrome and firefox, is there any reason? >> >> -- >> Hamid R. Mohseni, PhD >> Post-Doctoral Research Assistant >> Institute of Biomedical Engineering >> University of Oxford, OX3 7DQ, UK >> Tel: +44 (0) 1865 2 83826 >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- AJAY KUMAR.MADDIRALA, Research Scholar, Department of Electronics & Electrical Engg (EEE), Indian Institute of Technology Guwahati (IITG), Guwahati, Assam State, India. cell +918011212952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Thu Mar 7 08:29:35 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 07 Mar 2013 08:29:35 +0100 Subject: [FieldTrip] segmented brain seems not fitting the sensor helmet well, (jan-mathijs schoffelen) In-Reply-To: <5137B6B9.5080400@gmail.com> References: <5137B6B9.5080400@gmail.com> Message-ID: <513841DF.7090701@donders.ru.nl> Hi Ye, could the problem be related to setting a wrong (or no) coordinate system? I am not an expert in anatomical preprocessing, but to me it seems that volumereslice assumes a false origin, thereby 'moving' the brain out of the picture. Also your first pictures you sent seem to me like a coordinate mismatch. Additionally, as you suggested, I think volumereslice is not necessary at all. It already looks fine beforehands and obviously, you do not specify any parameter, so why use it after all? I'd try to do it without ft_volumereslice, but check what coordinate system you are in, e.g. use ft_determine_coordsys(mri) after reading in your mri. Best, Jörn On 3/6/2013 10:35 PM, Ye Mei wrote: > Hi Jan-Mathijs, > > Thank you very much for the reply. > > I think the problem starts at "mri_sliced = ft_volumereslice([], > mri);" before using "ft_volumesegment.". > > The attached file "beforevolumnslice.png" is the result of > "imagesc(squeeze(mri.anatomy(:,111,:)))"; > The attached file "aftervolumnslice.png" is the result of > "imagesc(squeeze(mri_sliced.anatomy(:,111,:)))". > > We can see part of the head in "aftervolumnslice.png" is already > sliced away. > > Could one do source localization without using "mri_sliced = > ft_volumereslice([], mri);"? > > To circumvent the problem, I am trying to use FreeSurfer instead of > ft_volumereslice and ft_volumesegment. I had several .mgz files from > freesurfer. > Can I do the following? > -------- > mri=ft_read_mri("brain.mgz"); %brain.mgz is the segmented brain by > FreeSurfer > > cfg = []; > cfg.method ='fiducial'; > cfg.fiducial.nas = [30 132 96];% position of Nasion > cfg.fiducial.lpa = [127 113 170];% position of LPA > cfg.fiducial.rpa = [125 115 18]% position of RPA > cfg.fiducial.zpoint = [125 125 220] > [mri_aligned] = ft_volumerealign(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, mri_aligned); > ... > --------- > > thanks ahead, > Ye > > > On 13-02-28 05:10 PM, fieldtrip-request at science.ru.nl wrote: >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Re: NIHC-BrainGain Tutorial Day - March 21, 2013 >> (Robert Oostenveld) >> 2. Re: segmented brain seems not fitting the sensor helmet well >> (jan-mathijs schoffelen) >> 3. Re: segmented brain seems not fitting the sensor helmet well >> (Ye Mei) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 28 Feb 2013 17:46:39 +0100 >> From: Robert Oostenveld >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] NIHC-BrainGain Tutorial Day - March 21, 2013 >> Message-ID: <9741C083-F00A-4BC9-86EF-FB99715576A7 at donders.ru.nl> >> Content-Type: text/plain; charset=windows-1252 >> >> Dear FieldTrip users, >> >> The NIHC-BrainGain Tutorial Day marks the end of the BrainGain >> project. For the last 6 years, the development and continued support >> of FieldTrip for normal/offline and realtime/online analysis has >> received support from the BrainGain project. >> >> There is now more information available online on this tutorial day, >> please see >> https://www.hersenenencognitie.nl/contents/1876 >> https://www.hersenenencognitie.nl/contents/1915 >> >> If you happen to be close to Nijmegen, you might also want to come to >> the "Breinfest" on Tuesday evening 19 March in the city centre with >> talks by international speakers and BCI demo's for the general >> public. Personally, I will be demonstrating how real-time data >> streaming and processing can be done using the FieldTrip buffer to >> various platforms (OS X, WIndows, Linux), to the Raspberry Pi and >> even to an Arduino (yes, fieldtrip runs on an arduino! ... well, a >> small part of it runs on an arduino). See http://www.ru.nl/breinfest >> for details on the evening. >> >> best regards, >> Robert >> >> >> >> On 19 Feb 2013, at 14:30, Robert Oostenveld wrote: >> >>> NIHC-BrainGain Tutorial Day: >>> Tools and novelties in neurotechnology research >>> We invite PhD students, post-docs and senior researchers working >>> in the fields of brain-computer interfacing (BCI), neurofeedback, >>> cognitive neuroscience, neuroinformatics, neurosurgery and related >>> topics to our Tutorial Day on March 21st, 2013 in the Sanadome >>> Nijmegen. >>> The day marks the end of the BrainGain consortium, a six-year >>> joint-effort project on Brain-Computer Interfacing and related >>> technologies. More information on BrainGain can be found here. >>> The Tutorial Day will consist of a 'tools' track and a 'novelties? >>> track. The 'tools' track is intended to provide both newcomers to >>> the field and experienced researchers with an overview of the tools >>> needed to integrate cognitive neuroscience and advanced invasive and >>> non-invasive technology. Topics range from data streaming to >>> modelling and statistics, and from online fMRI decoding to a crash >>> course in neuroethics., You will also receive some helpful insights >>> for a future career, in case you are interested in applying for a >>> grant in the near future or considering setting up your own company. >>> The 'novelties' track covers a wide range of topics indicating some >>> of the possible topics to be further explored in BCI and >>> neurotechnology research, including genetics, robotics and >>> intracranial recordings. >>> There is no need to stick to one of the two tracks the whole day: >>> you are free to switch between tracks any time. >>> In parallel to the lectures, there will be several interesting >>> demonstrations. >>> The full programme and registration form can be found on the NIHC >>> website (https://www.hersenenencognitie.nl). Please register before >>> 1 March 2013. Participation is free. Lunch and drinks will be provided. >>> We hope to welcome you on March 21st in Nijmegen! >>> Susanna Bicknell >>> Radboud University Nijmegen >>> ____________________________________________________________________ >>> Faculty of Science | Finance and Economic Affairs | Project >>> Management | LC-IMPACT >>> Faculty of Social Sciences | Donders Centre for Cognition | >>> BRAINGAIN | Project Manager >>> T +31 24 3653300 | HG00.616 (Monday, Thursday) >>> Faculty of Science | IMAPP | T +31 24 3652972 | HG07.315 (Tuesday, >>> Wednesday) >>> Postal address: P.O. Box 9010, 6500 GL Nijmegen, The Netherlands >>> Visiting and courier service address: Heyendaalseweg 135, 6525 AJ >>> Nijmegen, The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Thu, 28 Feb 2013 18:54:14 +0100 >> From: jan-mathijs schoffelen >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Ye, >> >> Looks like a coregistration problem to me. In other words, something >> went wrong in ft_volumesegment, because the images were not >> sufficiently aligned. You need to investigate the input and output of >> ft_volumesegment. >> Do you use ft_volumerealign after calling ft_volumesegment? This >> should be the other way around. >> >> Best, >> >> Jan-Mathijs >> >> >> On Feb 28, 2013, at 5:38 PM, Ye Mei wrote: >> >>> Hello FieldtripList, >>> >>> After segmentation and alignment using >>> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >>> segmented >>> brain seems rotated forward in the sensor helmet(brain.png) and the >>> cerebellum part seems to be segmented out. However, his head MRI seems >>> fitting the sensor helmet well(head.jpg). My another subject's brain >>> seem to be correctly segmented without missing the cerebellum part. And >>> the brain is not rotated forward. >>> >>> Could might be the problem? >>> >>> thanks ahead, >>> Ye >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 3 >> Date: Thu, 28 Feb 2013 17:09:57 -0500 >> From: Ye Mei >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] segmented brain seems not fitting the sensor >> helmet well >> Message-ID: <512FD5B5.8080700 at gmail.com> >> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >> >> Hello All, >> >> I found the problem I mentioned in the previous email was caused by >> using "mri_sliced = ft_volumereslice([], mri);" before using >> ft_volumesegment. >> After erasing the line "mri_sliced = ft_volumereslice([], mri);", the >> segmented brain seems to be normal and fits the sensor helmet well now, >> as show in the attached figure(notvolumnsliced.jpg). >> For another of my subject, if the "ft_volumereslice" is included, the >> brain looks sliced on the top(subject2vs.jpg). If no "ft_volumreslice" >> it looks normal(subject2.jpg). >> >> I notice in the fieldtrip headmodel tutorial >> (http://fieldtrip.fcdonders.nl/tutorial/headmodel_meg), >> "ft_volumereslice" is not used. but in the field trip beamformer >> tutorial(http://fieldtrip.fcdonders.nl/tutorial/beamformer), it is used. >> >> I am wondering if I should include "ft_volumereslice" in my source >> localization code. Can anyone give me some suggestions? >> >> >> >> thanks ahead, >> Ye >> >> >> >> >> On 13-02-28 11:45 AM, fieldtrip-request at science.ru.nl wrote: >>> Send fieldtrip mailing list submissions to >>> fieldtrip at science.ru.nl >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> or, via email, send a message with subject or body 'help' to >>> fieldtrip-request at science.ru.nl >>> >>> You can reach the person managing the list at >>> fieldtrip-owner at science.ru.nl >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of fieldtrip digest..." >>> >>> >>> Today's Topics: >>> >>> 1. segmented brain seems not fitting the sensor helmet well (Ye >>> Mei) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Thu, 28 Feb 2013 11:38:21 -0500 >>> From: Ye Mei >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] segmented brain seems not fitting the sensor >>> helmet well >>> Message-ID: <512F87FD.80500 at gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" >>> >>> Hello FieldtripList, >>> >>> After segmentation and alignment using >>> 'ft_volumesegment' and 'ft_volumerealign', one of the subjects' >>> segmented >>> brain seems rotated forward in the sensor helmet(brain.png) and the >>> cerebellum part seems to be segmented out. However, his head MRI seems >>> fitting the sensor helmet well(head.jpg). My another subject's brain >>> seem to be correctly segmented without missing the cerebellum part. And >>> the brain is not rotated forward. >>> >>> Could might be the problem? >>> >>> thanks ahead, >>> Ye >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: brain.png >>> Type: image/png >>> Size: 15197 bytes >>> Desc: not available >>> URL: >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: head.jpg >>> Type: image/jpeg >>> Size: 50294 bytes >>> Desc: not available >>> URL: >>> >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> End of fieldtrip Digest, Vol 27, Issue 31 >>> ***************************************** >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: notvolumnsliced.jpg >> Type: image/jpeg >> Size: 28621 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: subject2.jpg >> Type: image/jpeg >> Size: 27415 bytes >> Desc: not available >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: subject2vc.jpg >> Type: image/jpeg >> Size: 27788 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 27, Issue 32 >> ***************************************** > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at DONDERS.RU.NL Thu Mar 7 09:49:27 2013 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Thu, 7 Mar 2013 09:49:27 +0100 Subject: [FieldTrip] new set of template sourcemodels uploaded Message-ID: Dear all, I just uploaded a new set of template sourcemodels into fieldtrip/template/sourcemodel, and I removed the old ones. You can read about it here: http://fieldtrip.fcdonders.nl/template/sourcemodel This change may be of consequence for your own analyses, if you rely on these templates. This is only likely when you are using beamformers for source reconstruction, and you use sourcemodels (grids) that have been created using an inverse warp of a template sourcemodel. Essentially, the change has consequences if you use cfg.grid.warpmni = 'yes' in ft_prepare_sourcemodel. The old sourcemodels are different from the new ones, and a group analysis across subjects can obviously only be performed when the subjects have been processed all with the same template sourcemodel. Of course we recommend the new version, but if you prefer to stick to the old version, you can only recover them from older versions of FieldTrip, because we have removed them from the release version as of now (i.e. svn revision number 7600, March 7, 2013). Happy computing, Jan-Mathijs Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Mar 7 10:01:00 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 7 Mar 2013 10:01:00 +0100 Subject: [FieldTrip] Downloading tutorial data In-Reply-To: References: Message-ID: Hi Ajay, I also need pure MEG data, but typically the data I record is quite noisy ;-). Seriously, you may want to have a look here: http://cobre.mrn.org/megsim/ Please try to be a bit more specific next time when asking questions on this list. Best wishes, Jan-Mathijs On Mar 7, 2013, at 8:29 AM, ajay maddirala wrote: > Hi, I need MEG pure data. > > 150 channel > > 147 for recording brain signals > 3 channels for record environment noise. > please help me thank you. > AJAY KUMAR.MADDIRALA, > Research Scholar, > Department of Electronics & Electrical Engg (EEE), > Indian Institute of Technology Guwahati (IITG), > Guwahati, > Assam State, > India. > cell +918011212952 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Thu Mar 7 13:08:56 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Thu, 7 Mar 2013 13:08:56 +0100 Subject: [FieldTrip] auditory evoked gamma Message-ID: Hi, I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 8 02:16:32 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 7 Mar 2013 20:16:32 -0500 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: Message-ID: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Hi Nenad On 7 Mar 2013, at 7:08, Nenad Polomac wrote: > I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. best regards, Robert From smoratti at psi.ucm.es Fri Mar 8 08:51:00 2013 From: smoratti at psi.ucm.es (Stephan Moratti) Date: Fri, 8 Mar 2013 08:51:00 +0100 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Message-ID: Dear Nenad, An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). It should also work for EEG and is easy to implement. Best, Stephan El 08/03/2013, a las 02:16, Robert Oostenveld escribió: > Hi Nenad > > On 7 Mar 2013, at 7:08, Nenad Polomac wrote: >> I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. > > > Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. > > One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. > > If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. > > best regards, > Robert > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Peyman.Adjamian at ihr.mrc.ac.uk Fri Mar 8 09:47:52 2013 From: Peyman.Adjamian at ihr.mrc.ac.uk (Peyman Adjamian) Date: Fri, 8 Mar 2013 08:47:52 +0000 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: Message-ID: <82BB4DFB02A77749989A31D0F5BFA1A006AAEE0A@eir.nus.ihr.mrc.ac.uk> Dear Nenad, >From my experience, auditory gamma activity is not a robust effect, certainly not as prevalent and robust as the visual gamma activity which is best induced by high contrast stimuli at certain spatial frequencies. So whether you observe auditory gamma activity or not very much depends on your type of stimulus. Can I ask what auditory stimuli you are using to induce gamma activity? Assuming that auditory gamma activity exists at all, and given that you use the appropriate stimulus, you should see it with DICS or some other beamformer. To avoid correlated sources, you can analyse right and left channels separately perhaps. I hope this helps. Peyman ========================================================================== Dr Peyman Adjamian Investigator Scientist MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115) 922 3431 Fax: (0115) 951 8503 Email: peyman at ihr.mrc.ac.uk From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Nenad Polomac Sent: 07 March 2013 12:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] auditory evoked gamma Hi, I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eschulz at lrz.tu-muenchen.de Fri Mar 8 13:31:32 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Fri, 8 Mar 2013 13:31:32 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Message-ID: Dear Lilla and Jörn, thank you very much for your reply on my problem. I already checked the example sites but got still error messages. For creating the (leadfield) grid variable used the template files provided by Fieldtrip. vol structure: load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); I created a sensor structure based on the "standard_1020.elc" file. sens = chanpos: [65x3 double] elecpos: [65x3 double] label: {65x1 cell} type: 'ext1020' unit: 'mm' pnt: [65x3 double] I started creating the leadfiled: cfg = []; cfg.elec = sens; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; [grid65] = ft_prepare_leadfield(cfg); Finally I got the following error message. ??? Reference to non-existent field 'pnt'. Error in ==> ft_prepare_vol_sens at 301 sens.pnt = sens.pnt(selsens,:); Error in ==> prepare_headmodel at 90 [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ==> ft_prepare_leadfield at 148 [vol, sens, cfg] = prepare_headmodel(cfg, data); That error message is funny because my sens variable has a sens.pnt subnode. I (hopefully) solved the problem by editing the " ft_prepare_vol_sens"function and loading the sens variable just before the error line in the 295. It is running now but is that way correct? Any help is highly appreciated. Thank you very much. Best, Enrico On 5 March 2013 12:08, wrote: > Dear Enrico, > > I think more information is needed about the error messages and about how > you try to compute leadfield in order to help. > > If you have not encountered the FT tutorial sites, example scripts and > FAQs yet, maybe you can check out those as well because they provide > information on source-reconstruction, leadfields... etc.. > (For example, a tutorial for EEG headmodels: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example script > for leadfield computation: > http://fieldtrip.fcdonders.nl/example/compute_leadfield). > > Best, > Lilla > > > > Dear Fieldtrip experts, > > > > I would like to create a leadfield based on the standard brain provided > by > > the fieldtrip package and standard electrode positions. > > Unfortunately, whatever I'm trying it ends up in a number of error > > messages. > > > > Is anybody out there who could provide some support? > > > > Thank you very much in advance, > > Best, > > Enrico > > > > > > -- > > Dr. Enrico Schulz > > Postdoc > > Klinikum rechts der Isar der Technischen Universität München > > Neurologische Klinik und Poliklinik > > Neuro-Kopf-Zentrum > > Ismaningerstr. 22 > > 81675 München > > > > Tel.: 089-4140-7664 > > _______________________________________________ > > 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 > -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Mar 8 15:52:27 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 08 Mar 2013 15:52:27 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> Message-ID: <5139FB2A.50300@donders.ru.nl> Dear Enrico, the error you are describing is clearly from a rather old version of FieldTrip, because sens.pnt is deprecated. Could you make sure that you are using the newest FieldTrip version? Since you load from c:\...\fieldtrip-20130307\... I assume that you downloaded the newest version already. It might be that either you have not updated your startup script in adding the correct FieldTrip version or that you are adding both, an old and a new FieldTrip version to your Matlab path. You could check in Matlab what function is being used by typing: / which ft_prepare_vol_sens/ If you want to add only the newest FieldTrip and remove the old one, you can call///restoredefaultpath/ in Matlab. The add c:\MATLAB\R2009b\work\fieldtrip-20130307\ to your path and call /ft_def//aults/. That should solve the issue. Note that your Matlab is _definitely_ calling an old FT version, because the line tyour error comes from does not exist anymore (i.e. it has been rewritten, because sens.pnt is deprecated) Hope it works out for you! Best, Jörn. On 3/8/2013 1:31 PM, Enrico Schulz wrote: > Dear Lilla and Jörn, > > thank you very much for your reply on my problem. > I already checked the example sites but got still error messages. > > For creating the (leadfield) grid variable used the template files > provided by Fieldtrip. > vol structure: > load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); > > I created a sensorstructure based on the "standard_1020.elc" file. > > sens = > > chanpos: [65x3 double] > elecpos: [65x3 double] > label: {65x1 cell} > type: 'ext1020' > unit: 'mm' > pnt: [65x3 double] > > I started creating the leadfiled: > cfg = []; > cfg.elec = sens; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid65] = ft_prepare_leadfield(cfg); > > > Finally I got the following error message. > ??? Reference to non-existent field 'pnt'. > > Error in ==> ft_prepare_vol_sens at 301 > sens.pnt = sens.pnt(selsens,:); > > Error in ==> prepare_headmodel at 90 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order', > cfg.order); > > Error in ==> ft_prepare_leadfield at 148 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > That error message is funny because my sens variable has a sens.pnt > subnode. > > I (hopefully) solved the problem by editing the "ft_prepare_vol_sens" > function and loading the sens variable just before the error line in > the 295. It is running now but is that way correct? > > Any help is highly appreciated. > Thank you very much. > Best, > Enrico > > > On 5 March 2013 12:08, > wrote: > > Dear Enrico, > > I think more information is needed about the error messages and > about how > you try to compute leadfield in order to help. > > If you have not encountered the FT tutorial sites, example scripts and > FAQs yet, maybe you can check out those as well because they provide > information on source-reconstruction, leadfields... etc.. > (For example, a tutorial for EEG headmodels: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an > example script > for leadfield computation: > http://fieldtrip.fcdonders.nl/example/compute_leadfield). > > Best, > Lilla > > > > Dear Fieldtrip experts, > > > > I would like to create a leadfield based on the standard brain > provided by > > the fieldtrip package and standard electrode positions. > > Unfortunately, whatever I'm trying it ends up in a number of error > > messages. > > > > Is anybody out there who could provide some support? > > > > Thank you very much in advance, > > Best, > > Enrico > > > > > > -- > > Dr. Enrico Schulz > > Postdoc > > Klinikum rechts der Isar der Technischen Universität München > > Neurologische Klinik und Poliklinik > > Neuro-Kopf-Zentrum > > Ismaningerstr. 22 > > 81675 München > > > > Tel.: 089-4140-7664 > > _______________________________________________ > > 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 > > > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mushfa.yousuf at googlemail.com Fri Mar 8 16:12:52 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Fri, 8 Mar 2013 16:12:52 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> Message-ID: Hello; I have few problems while calculating combine “MEG & EEG” source reconstruction and I need your help to troubleshoot the problems. I have a data from a Parkinson’s disease patient who underwent DBS and we recorded 306 MEG channels and 64 EEG channels simultaneously, first I have calculated the leadfield individually for both EEG and MEG. I have defined all the calculations step by step so that I can describe my problems very precisely. *CALCULATE THE LEADFIELD FOR MEG CHANNELS:-* // I have defined the Pre-Stimulus data i.e. Stim-off data in the original code. *Reading raw data set for MEG channels* * * cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'MEG'}; *// In order to read raw data only for MEG channels* dataFIC12 = ft_preprocessing(cfg); After that I have defined the *time of window of interest* for the MEG raw data set cfg.toilim = [0 0.5]; dataPost = ft_redefinetrial(cfg, dataFIC12); and calculate the *Power Spectral density matrix* for the MEG channels data set cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the stimulation frequency cfg.pad = 1; freqPost = ft_freqanalysis(cfg, dataPost); Now next step for me is to choose the method for the Head Model. I have noticed that Singlesphere is the common method which can be used for both EEG and MEG. So I have selected the singlesphere method for the calculation of volume conduction model. mri = ft_read_mri(‘ms1879865-0004-00001-000192-01.img'); // READ MRI cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the segmented mri cfg = []; cfg.method = 'singlesphere'; // *METHOD* vol1 = ft_prepare_headmodel(cfg, segmentedmri1); Now next step is to calculate the LEADFIELD cfg = []; cfg.grad = freqPost.grad; cfg.vol = vol1; cfg.reducerank = 2; // MEG cfg.channel = {'MEG'}; cfg.grid.resolution = 1; // I choose a resolution 1 [grid1] = ft_prepare_leadfield(cfg); *disp(grid1)* * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* * dim: [15 16 16]* * pos: [3840x3 double]* * unit: 'cm'* * inside: [1x2037 double]* * outside: [1x1803 double]* * cfg: [1x1 struct]* * leadfield: {1x3840 cell}* * * * * Ø It has to be noticed that Inside Dipole is 2037. * * *CALCULATE THE LEADFIELD FOR EEG CHANNELS:-* *Reading raw data set for EEG channels* * * cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'EEG'}; *// In order to read raw data only for EEG channels* dataFIC12 = ft_preprocessing(cfg); After that I have defined the *time of window of interest* for the EEG raw data set cfg.toilim = [0 0.5]; dataPost = ft_redefinetrial(cfg, dataFIC12); and calculate the *Power Spectral density matrix* for the EEG channels data set cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [129 129]; // Frequency of interest is 129 Hz cfg.pad = 1; freqPost = ft_freqanalysis(cfg, dataPost); *HEAD MODEL FOR EEG* mri = ft_read_mri(‘ms1879865-0004-00001-000192-01.img'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri2 = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singlesphere'; // METHOD vol2 = ft_prepare_headmodel(cfg, segmentedmri2); *LEADFIELD:*** cfg = []; cfg.elec = freqPost.elec; cfg.vol = vol2; cfg.reducerank = 3; % 3 for EEG cfg.channel = {'EEG'}; cfg.grid.resolution = 9.54; // Increase the resolution so that the inside dipoles for EEG should be close to the inside dipoles of MEG [grid2] = ft_prepare_leadfield(cfg); *disp(grid2)* * xgrid: [1x16 double]* * ygrid: [1x16 double]* * zgrid: [1x13 double]* * dim: [16 16 13]* * pos: [3328x3 double]* * unit: 'mm'* * inside: [1x2038 double]* * outside: [1x1290 double]* * cfg: [1x1 struct]* * leadfield: {1x3328 cell}* Ø It has to be noticed that Inside Dipole is 2038. *Concatenate of MEG and EEG LEADFIELD:-* Now I have the individual LEADFIELD of both MEG and EEG grid1 and grid2 respectively. *disp(grid1)* * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* * dim: [15 16 16]* * pos: [3840x3 double]* * unit: 'cm'* * inside: [1x2037 double]* * outside: [1x1803 double]* * cfg: [1x1 struct]* * leadfield: {1x3840 cell}* * * *disp(grid2)* * xgrid: [1x16 double]* * ygrid: [1x16 double]* * zgrid: [1x13 double]* * dim: [16 16 13]* * pos: [3328x3 double]* * unit: 'mm'* * inside: [1x2038 double]* * outside: [1x1290 double]* * cfg: [1x1 struct]* * leadfield: {1x3328 cell}* * * *Few things to be noticed here * * * Ø *unit is different for both MEG ‘cm’ and EEG ‘mm’* Ø *I have used the same method for calculating the Volume for both MEG & EEG => “Singlesphere” * Ø *Concatenating the “pos” vector of EEG and MEG and the other vectors* * * *Grid.pos = cat(1,grid1.pos,grid2.pos);* *Grid.xgrid = [grid1.xgrid grid2.xgrid];* *Grid.ygrid = [grid1.ygrid grid2.ygrid];* *Grid.zgrid = [grid1.zgrid grid2.zgrid];* *Grid.inside = [grid1.inside grid2.inside];* *Grid.outside = [grid1.outside grid2.outside];* *Grid.leadfield = [grid1.leadfield grid2.leadfield];* *Grid.dim = [grid1.dim grid2.dim];* * * *Combined Source Reconstruction:-* cfg = []; cfg.dataset = ‘ap_rest_stimon_bi_2_5ma.fif'; cfg.trialdef.eventtype = '?'; cfg.trialdef.triallength = 1; cfg.trialdef.poststim = 88; cfg = ft_definetrial(cfg); cfg.trl = cfg.trl(1:88,:); // Read 88 trials cfg.channel = {'MEG',’EEG’}; *// In order to read raw data for MEG & EEG channels* dataFIC12 = ft_preprocessing(cfg); After that as previously defined, I have calculated the Spectral density. Now I have to calculate the inverse solution for both EEG & MEG data trials. *Source Analysis: without contrasting condition:-* * * cfg = []; cfg.method = 'dics'; cfg.frequency = 129; cfg.grid = Grid; // Concatenated grid cfg.vol = vol1; // As vol1 = vol2 : both singlesphere cfg.powmethod = 'trace'; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0.0001; sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost contains both MEG * * and EEG row data* * *** I have received the following error: scanning grid 2037/4075 ??? Error using ==> svd Input to SVD must not contain NaN or Inf. Error in ==> beamformer_dics>pinv at 568 [U,S,V] = svd(A,0); Error in ==> beamformer_dics at 314 filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ==> ft_sourceanalysis at 595 dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), optarg{:}); Error in ==> code at 227 sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); Ø If you notice that till 2037 grid it represents the MEG grid and after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which also represent inside dipole). Ø Secondly I try to use other method for the head modeling i.e openmeeg, dipoli and bemcp method which leads me to different errors which I was unable to trouble shoot. · Openmeeg = OpenMEEG binaries are not correctly installed · Dipoli = vol.mat file was missing after calculating the headmodel · Bemcp = vol.mat file contains NaN fiels which leads to wrong leadfield computation. *I apologize for the long email. I wanted to show the steps which I used so that it is easier to debug the problem.* * * Thank you; Mushfa Yousuf On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Dear Mushfa > > In principle it can be made to work, but you'll have to do a little bit of > work outside fieldtrip. You would start with > 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part > 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part > Subsequently you would (manually) concatenate the leadfields of the MEG > and EEG. Here you have to make sure that the channel order is consistent > with that in your combined data. > The resulting structure with combined leadfields can be passed into > ft_sourceanalysis as cfg.grid. > > However, I foresee a problem with the scaling. At this moment FieldTrip is > not (yet) very precise in maintaining the correct units throughout. > Consequently you might get different units for the EEG and MEG contribution > to each dipole, causing weird cancelation effects. You'll just have to > check carefully that the leadfield units and the data units consistently > scaled between megmag, megplanar and eeg. > > This brings me to another known problem for the combined vectorview > magnetometer and planar gradiometer channels: at this moment the forward > computation computes both in T (or fT), whereas the data is represented as > T for the magnetometers and T/m for the gradiometers. So the gradiometer > leadfields are off by a factor "1/baseline", which is approximately 1/70 if > I recall correctly. Many neuromag users use only the planar channels, and > therefore don't notice. We are working on fixing the neuromag > channel/gradiometer units. That is not as simple as it appears, because > conversions of the geometrical dimensions from m to cm or mm also affect > the gradiometer baseline. So converting the data from m to mm should result > in the planar channel data getting 1000 times smaller, whereas the > magnetometer channels shoudl stay the same. See > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 and > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want to follow > this. > > best regards > Robert > > > > On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: > > Hello Fieldtrippers, > > I am currently doing source analysis using beamformer method in fieldtrip. > > The data i work on is a simultaneous measurement of MEG (306) with EEG > (128) on PD patients. > > I was successful in calculating the sources for both the modalities alone. > > I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation > > of the lead field. But, then when i want to use the created vol for the > source analysis i have two structures one for EEG and the second one for > MEG. Now, i can only define only one to estimate the sources. How to use > > this for both the modalities? Any help would be appreciated. > > With regards > Mushfa > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Fri Mar 8 17:48:00 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Fri, 8 Mar 2013 09:48:00 -0700 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> Message-ID: <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> Dear Stephan, If I may ask, have you implemented this approach successfully in Fieldtrip? I agree that it can work well for auditory gamma, but have only done this in BESA. The minimumnormestimate.m function in FT is a time domain only technique as far as I know. If you have done this in Fieldtrip and can provide some guidance, I would very much appreciate the pointers. Best, Don On Mar 8, 2013, at 12:51 AM, Stephan Moratti wrote: Dear Nenad, An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). It should also work for EEG and is easy to implement. Best, Stephan El 08/03/2013, a las 02:16, Robert Oostenveld > escribió: Hi Nenad On 7 Mar 2013, at 7:08, Nenad Polomac wrote: I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. best regards, Robert _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From smoratti at psi.ucm.es Sat Mar 9 02:11:11 2013 From: smoratti at psi.ucm.es (smoratti at psi.ucm.es) Date: Sat, 9 Mar 2013 02:11:11 +0100 Subject: [FieldTrip] auditory evoked gamma In-Reply-To: <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> References: <26FF1BC2-BE83-4341-B015-F188F28CE8A7@donders.ru.nl> <39906789-BB08-47F4-98C7-F3BAA21EE52F@ucdenver.edu> Message-ID: Dear Don, I have done it using Brainstorm (sorry Fieldtrippers) as in Brainstorm minimum norm in the frequency domain is implemented. But as the minimum norm estimate (MNE) is applied to each time point I guess the following approach should easily work: Estimate your gamma response with ft_frequanalysis and ask for the fourier components instead of power. Create a data structure that you normally feed into the minimum norm algorithm with source analysis. The data structure has two time points. Copy the real and imaginary part into the two time points each. Run the minimum norm estimate on that data structure (I guess you will have to estimate some noise covariance matrix from a baseline or so before). Then, take the modulus of the minimum norm estimates across the two "time points" (that include the inverse real and imaginary part). I have never tried it with field trip and the approach above is just an idea. I am happy of any feedback if it works or if there is a more elegant solution. Sorry that I don't have a "fixed" solution. I will try it myself. I hope I could help. Best, Stephan ________________________________________________________ Stephan Moratti, PhD see also: http://web.me.com/smoratti/ Universidad Complutense de Madrid Facultad de Psicología Departamento de Psicología Básica I Campus de Somosaguas 28223 Pozuelo de Alarcón (Madrid) Spain and Center for Biomedical Technology Laboratory for Cognitive and Computational Neuroscience Parque Científico y Tecnológico de la Universidad Politecnica de Madrid Campus Montegancedo 28223 Pozuelo de Alarcón (Madrid) Spain email: smoratti at psi.ucm.es Tel.: +34 679219982 El 08/03/2013, a las 17:48, Rojas, Don escribió: > Dear Stephan, > > If I may ask, have you implemented this approach successfully in Fieldtrip? I agree that it can work well for auditory gamma, but have only done this in BESA. The minimumnormestimate.m function in FT is a time domain only technique as far as I know. If you have done this in Fieldtrip and can provide some guidance, I would very much appreciate the pointers. > > Best, > > Don > > On Mar 8, 2013, at 12:51 AM, Stephan Moratti wrote: > >> Dear Nenad, >> >> An alternative could be doing minimum norm on the real and imaginary part of your gamma response and then take the modulus get a measure of absolute power. This works for highly correlated sources see: >> >> 1. Jensen, O. & Vanni, S. A new method to identify multiple sources of oscillatory activity from magnetoencephalographic data. Neuroimage 15, 568-574 (2002). >> >> It should also work for EEG and is easy to implement. >> >> Best, >> >> Stephan >> >> El 08/03/2013, a las 02:16, Robert Oostenveld escribió: >> >>> Hi Nenad >>> >>> On 7 Mar 2013, at 7:08, Nenad Polomac wrote: >>>> I would like to ask you for a suggestion about localisation o auditory evoked gamma osculations. I checked all tutorials and I haven't found much help. DICS beamformer doesn't work in this case. >>> >>> >>> Please do note that the tutorials are not meant as a complete list of analyses that you can do, but they merely provide a practical starting point. Something not being listed on the fieldtrip wiki does not mean that it cannot be done. >>> >>> One would not expect strong correlations/coherence between auditory activity in the gamma band, so beamforming is from a methodological viewpoint also not as problematic for high frequenies as it is for AEFs. This paper by Till Schneider (http://www.ncbi.nlm.nih.gov/pubmed/18617422) demonstrates that with EEG beamforming of auditory gamma is possible. >>> >>> If you fear for too strong correlations, you can try subsets of channels over both hemispheres. Or use a symmetric dipole pair (cfg.symmetric in ft_prepare_leadfield) as source model. >>> >>> best regards, >>> Robert >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> ________________________________________________________ >> Stephan Moratti, PhD >> >> see also: http://web.me.com/smoratti/ >> >> Universidad Complutense de Madrid >> Facultad de Psicología >> Departamento de Psicología Básica I >> Campus de Somosaguas >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> and >> >> Center for Biomedical Technology >> Laboratory for Cognitive and Computational Neuroscience >> Parque Científico y Tecnológico de la Universidad Politecnica de Madrid >> Campus Montegancedo >> 28223 Pozuelo de Alarcón (Madrid) >> Spain >> >> >> email: smoratti at psi.ucm.es >> Tel.: +34 679219982 >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Mar 9 02:56:44 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 9 Mar 2013 01:56:44 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? Message-ID: Hi Fieldtrip list, Firstly I'd like to thank those who have asked questions using ICA on neuromag 306 data and the answers given. It's been extremely informative and taught me a lot about the general principles of ICA (it's no longer completely black magic, only partially...). I have two and a bit questions about using ICA on neuromag data, the first on the full rank assumption. After maxfiltering, the output data is rank deficient due to removal of the b-out components. I see that fastica is able to detect this and makes adjustments to the amounts of components extracted accordingly, but is doing this justified? What actually happens to the data if ICA is applied to a rank deficient data set? Are there any papers that examine this? Secondly, I've been including all the meg channels (mags + grads) when running ICA (due to my interpretation of the conversation in http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) then examining the time series components for those related to artifact (specifically ECG and EOG), while using a magnetometer only layout to view component topographies as a backup. My question (well, really a confirmation) is, by removing the artifact components calculated using the mixed sensors, does this remove the associated components from all the sensor types? Viewing pre and post ICA data appears to confirm this, but expert opinion is always good. The bit of a question is - is it acceptable to use a magnetometer only layout to interpret topoplots of the components if the components are based on mixed sensors? I've been using it because the readily identifiable artifact components have a distribution I'd expect from ECG and EOG as does the associated time series but I'm wanting to make sure. Also, if this is the wrong forum to ask these questions can someone suggest one that might be a better fit? Thanks again, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 9 12:12:04 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 9 Mar 2013 11:12:04 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> Message-ID: Hi Peter, Regarding your first question: after maxfilter, you need to do a pca, simply because your rank of data has been reduced from 306 to about 64. You can do this by: cfg = []; cfg.method = 'runica'; n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); cfg.runica.pca = n_comp; cfg.runica.stop = 1e-7; comp = ft_componentanalysis(cfg, data); Here, n_comp is the number of component and it is equal to the rank of data set. If you don't do this, the algorithm takes a long time and normally does not converge. Note that the data should be continuous and it is highly recommended to remove big and jump artefacts before ICA (for example using ft_databrowser). I found ICA using infomax 'runica' quite robust with high accuracy fro removing EOG and ECG. Regarding your second question: Using only 'MAG' to investigate the topograph of component is fine, and better than 'GRAD', but have a look at the components time-series as well. If you remove that component it will be removed from the whole data set. On 9 March 2013 01:56, Peter Goodin wrote: > Hi Fieldtrip list, > > Firstly I'd like to thank those who have asked questions using ICA on > neuromag 306 data and the answers given. It's been extremely informative > and taught me a lot about the general principles of ICA (it's no longer > completely black magic, only partially...). > > I have two and a bit questions about using ICA on neuromag data, the first > on the full rank assumption. After maxfiltering, the output data is rank > deficient due to removal of the b-out components. I see that fastica is > able to detect this and makes adjustments to the amounts of components > extracted accordingly, but is doing this justified? What actually happens > to the data if ICA is applied to a rank deficient data set? Are there any > papers that examine this? > > Secondly, I've been including all the meg channels (mags + grads) when > running ICA (due to my interpretation of the conversation in > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) > then examining the time series components for those related to artifact > (specifically ECG and EOG), while using a magnetometer only layout to view > component topographies as a backup. My question (well, really a > confirmation) is, by removing the artifact components calculated using the > mixed sensors, does this remove the associated components from all the > sensor types? Viewing pre and post ICA data appears to confirm this, but > expert opinion is always good. The bit of a question is - is it acceptable > to use a magnetometer only layout to interpret topoplots of the components > if the components are based on mixed sensors? I've been using it because > the readily identifiable artifact components have a distribution I'd expect > from ECG and EOG as does the associated time series but I'm wanting to make > sure. > > Also, if this is the wrong forum to ask these questions can someone > suggest one that might be a better fit? > > Thanks again, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Mar 9 13:13:57 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 9 Mar 2013 12:13:57 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk>, Message-ID: Hi Hamid, Thanks very much for the response. I'm concerned to do PCA on my dataset due to a recent conversation on the EEGlab mailing list where Arnaud Delorme states that PCA prior to ICA may create artifacts in the data (he does say that this occurs especially in frequency space, but doesn't discount problems in the time series). I'm using fastica to decompose my data as this appears to take into account the rank deficiency (especially when using tsss) through examination of data specific co-variance matrices, but thank you for the the script to use the runICA algorithm. If I have the time (and patience) I might do a quick exploration of PCA and runICA vs. fastICA. Additionally, thank you for confirmation regarding using the mags to examine components. I agree, far better than attempting to decipher the grads topoplots... Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, 9 March 2013 10:12 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? Hi Peter, Regarding your first question: after maxfilter, you need to do a pca, simply because your rank of data has been reduced from 306 to about 64. You can do this by: cfg = []; cfg.method = 'runica'; n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); cfg.runica.pca = n_comp; cfg.runica.stop = 1e-7; comp = ft_componentanalysis(cfg, data); Here, n_comp is the number of component and it is equal to the rank of data set. If you don't do this, the algorithm takes a long time and normally does not converge. Note that the data should be continuous and it is highly recommended to remove big and jump artefacts before ICA (for example using ft_databrowser). I found ICA using infomax 'runica' quite robust with high accuracy fro removing EOG and ECG. Regarding your second question: Using only 'MAG' to investigate the topograph of component is fine, and better than 'GRAD', but have a look at the components time-series as well. If you remove that component it will be removed from the whole data set. On 9 March 2013 01:56, Peter Goodin > wrote: Hi Fieldtrip list, Firstly I'd like to thank those who have asked questions using ICA on neuromag 306 data and the answers given. It's been extremely informative and taught me a lot about the general principles of ICA (it's no longer completely black magic, only partially...). I have two and a bit questions about using ICA on neuromag data, the first on the full rank assumption. After maxfiltering, the output data is rank deficient due to removal of the b-out components. I see that fastica is able to detect this and makes adjustments to the amounts of components extracted accordingly, but is doing this justified? What actually happens to the data if ICA is applied to a rank deficient data set? Are there any papers that examine this? Secondly, I've been including all the meg channels (mags + grads) when running ICA (due to my interpretation of the conversation in http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) then examining the time series components for those related to artifact (specifically ECG and EOG), while using a magnetometer only layout to view component topographies as a backup. My question (well, really a confirmation) is, by removing the artifact components calculated using the mixed sensors, does this remove the associated components from all the sensor types? Viewing pre and post ICA data appears to confirm this, but expert opinion is always good. The bit of a question is - is it acceptable to use a magnetometer only layout to interpret topoplots of the components if the components are based on mixed sensors? I've been using it because the readily identifiable artifact components have a distribution I'd expect from ECG and EOG as does the associated time series but I'm wanting to make sure. Also, if this is the wrong forum to ask these questions can someone suggest one that might be a better fit? Thanks again, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 9 13:29:44 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 9 Mar 2013 12:29:44 +0000 Subject: [FieldTrip] ICA on neuromag data - invalid assumption of full rank data & mixed sensors? In-Reply-To: <6c0212a7-8817-4c48-9a03-d0ab7f132243@HUB04.ad.oak.ox.ac.uk> References: <847702fc-ede6-4f9e-b0ef-18ae3de1a035@HUB06.ad.oak.ox.ac.uk> <6c0212a7-8817-4c48-9a03-d0ab7f132243@HUB04.ad.oak.ox.ac.uk> Message-ID: I'm concerned to do PCA on my dataset due to a recent conversation on the EEGlab mailing list .... This is good to know, but in our case we don't reduce the rank of data set and we don't remove any information using PCA dimension reduction. So I think it should be fine. On 9 March 2013 12:13, Peter Goodin wrote: > Hi Hamid, > > Thanks very much for the response. > > I'm concerned to do PCA on my dataset due to a recent conversation on > the EEGlab mailing list where Arnaud Delorme states that PCA prior to ICA > may create artifacts in the data (he does say that this occurs especially > in frequency space, but doesn't discount problems in the time series). > > I'm using fastica to decompose my data as this appears to take into > account the rank deficiency (especially when using tsss) through > examination of data specific co-variance matrices, but thank you for the > the script to use the runICA algorithm. If I have the time (and patience) I > might do a quick exploration of PCA and runICA vs. fastICA. > > Additionally, thank you for confirmation regarding using the mags to > examine components. I agree, far better than attempting to decipher the > grads topoplots... > > Peter. > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > *Sent:* Saturday, 9 March 2013 10:12 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] ICA on neuromag data - invalid assumption of > full rank data & mixed sensors? > > Hi Peter, > > Regarding your first question: after maxfilter, you need to do a pca, > simply because your rank of data has been reduced from 306 to about 64. You > can do this by: > > cfg = []; > cfg.method = 'runica'; > n_comp = rank(squeeze(data.trial{1}) * squeeze(data.trial{1})'); > cfg.runica.pca = n_comp; > cfg.runica.stop = 1e-7; > comp = ft_componentanalysis(cfg, data); > > Here, n_comp is the number of component and it is equal to the rank of > data set. If you don't do this, the algorithm takes a long time and > normally does not converge. Note that the data should be continuous and it > is highly recommended to remove big and jump artefacts before ICA (for > example using ft_databrowser). I found ICA using infomax 'runica' quite > robust with high accuracy fro removing EOG and ECG. > > > Regarding your second question: Using only 'MAG' to investigate the > topograph of component is fine, and better than 'GRAD', but have a look at > the components time-series as well. If you remove that component it will be > removed from the whole data set. > > > > > On 9 March 2013 01:56, Peter Goodin wrote: > >> Hi Fieldtrip list, >> >> Firstly I'd like to thank those who have asked questions using ICA on >> neuromag 306 data and the answers given. It's been extremely informative >> and taught me a lot about the general principles of ICA (it's no longer >> completely black magic, only partially...). >> >> I have two and a bit questions about using ICA on neuromag data, the >> first on the full rank assumption. After maxfiltering, the output data is >> rank deficient due to removal of the b-out components. I see that fastica >> is able to detect this and makes adjustments to the amounts of components >> extracted accordingly, but is doing this justified? What actually happens >> to the data if ICA is applied to a rank deficient data set? Are there any >> papers that examine this? >> >> Secondly, I've been including all the meg channels (mags + grads) when >> running ICA (due to my interpretation of the conversation in >> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-April/005016.html) >> then examining the time series components for those related to artifact >> (specifically ECG and EOG), while using a magnetometer only layout to view >> component topographies as a backup. My question (well, really a >> confirmation) is, by removing the artifact components calculated using the >> mixed sensors, does this remove the associated components from all the >> sensor types? Viewing pre and post ICA data appears to confirm this, but >> expert opinion is always good. The bit of a question is - is it acceptable >> to use a magnetometer only layout to interpret topoplots of the components >> if the components are based on mixed sensors? I've been using it because >> the readily identifiable artifact components have a distribution I'd expect >> from ECG and EOG as does the associated time series but I'm wanting to make >> sure. >> >> Also, if this is the wrong forum to ask these questions can someone >> suggest one that might be a better fit? >> >> Thanks again, >> >> Peter. >> >> __________________________ >> Peter Goodin, >> BSc (Hons), Ph.D Candidate. >> >> Brain and Psychological Sciences Research Centre (BPsych) >> Swinburne University, >> Hawthorn, Vic, 3122 >> >> Monash Alfred Psychiatry Research Centre (MAPrc) >> Level 1, Old Baker Building >> Commercial Road >> Melbourne, Vic, 3004 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallisgj at gmail.com Sat Mar 9 15:34:00 2013 From: wallisgj at gmail.com (George Wallis) Date: Sat, 09 Mar 2013 14:34:00 +0000 Subject: [FieldTrip] Trialwise log of TF transform before condition averaging? Message-ID: <513B4858.9090007@gmail.com> Dear fieldtrip experts When computing condition averages of TF transformed data, I take the log of the trialwise data before averaging over the trials for a given condition. As I was taking the log of the trialwise data for trialwise analyses, this seemed the most consistent approach. However, I notice it isn't implemented in fieldtrip (it requires a tweak of the ft_freqanalysis function), and the tf averages tend to look noisier this way than if they are averaged before taking the log. Does anyone have any insight into whether this is a sensible way to generate condition averages? I originally thought this would reduce the influence of outlier trials - but since it is equivalent to taking the log of the product of all the trials within a condition, perhaps it is going to do the opposite? George From eschulz at lrz.tu-muenchen.de Sat Mar 9 19:55:54 2013 From: eschulz at lrz.tu-muenchen.de (Enrico Schulz) Date: Sat, 9 Mar 2013 19:55:54 +0100 Subject: [FieldTrip] creating leadfiled In-Reply-To: <5139FB2A.50300@donders.ru.nl> References: <49670.131.174.45.70.1362481688.squirrel@131.174.45.70> <5139FB2A.50300@donders.ru.nl> Message-ID: Dear Jörn, thank you very much for your support. You were right. Matlab called an old version of the function which came from the EEGlab external folder. After deleting SPM and EEGlab from pathdef, it is running now without code editing and error messages. Best, Enrico On 8 March 2013 15:52, "Jörn M. Horschig" wrote: > Dear Enrico, > > the error you are describing is clearly from a rather old version of > FieldTrip, because sens.pnt is deprecated. Could you make sure that you are > using the newest FieldTrip version? Since you load from > c:\...\fieldtrip-20130307\... I assume that you downloaded the newest > version already. It might be that either you have not updated your startup > script in adding the correct FieldTrip version or that you are adding both, > an old and a new FieldTrip version to your Matlab path. You could check in > Matlab what function is being used by typing: > * > which ft_prepare_vol_sens* > > If you want to add only the newest FieldTrip and remove the old one, you > can call* **restoredefaultpath* in Matlab. The add c:\MATLAB\R2009b\work\fieldtrip-20130307\ > to your path and call *ft_def**aults*. That should solve the issue. Note > that your Matlab is *definitely* calling an old FT version, because the > line tyour error comes from does not exist anymore (i.e. it has been > rewritten, because sens.pnt is deprecated) > > Hope it works out for you! Best, > Jörn. > > > > On 3/8/2013 1:31 PM, Enrico Schulz wrote: > > Dear Lilla and Jörn, > > thank you very much for your reply on my problem. > I already checked the example sites but got still error messages. > > For creating the (leadfield) grid variable used the template files > provided by Fieldtrip. > vol structure: > > load('c:\MATLAB\R2009b\work\fieldtrip-20130307\template\headmodel\standard_bem.mat'); > > I created a sensor structure based on the "standard_1020.elc" file. > > sens = > > chanpos: [65x3 double] > elecpos: [65x3 double] > label: {65x1 cell} > type: 'ext1020' > unit: 'mm' > pnt: [65x3 double] > > I started creating the leadfiled: > cfg = []; > cfg.elec = sens; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid65] = ft_prepare_leadfield(cfg); > > > Finally I got the following error message. > ??? Reference to non-existent field 'pnt'. > > Error in ==> ft_prepare_vol_sens at 301 > sens.pnt = sens.pnt(selsens,:); > > Error in ==> prepare_headmodel at 90 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order', > cfg.order); > > Error in ==> ft_prepare_leadfield at 148 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > That error message is funny because my sens variable has a sens.pnt subno > de. > > I (hopefully) solved the problem by editing the " ft_prepare_vol_sens"function and loading the sens > variable just before the error line in the 295. It is running now but is that > way correct? > > Any help is highly appreciated. > Thank you very much. > Best, > Enrico > > > On 5 March 2013 12:08, wrote: > >> Dear Enrico, >> >> I think more information is needed about the error messages and about how >> you try to compute leadfield in order to help. >> >> If you have not encountered the FT tutorial sites, example scripts and >> FAQs yet, maybe you can check out those as well because they provide >> information on source-reconstruction, leadfields... etc.. >> (For example, a tutorial for EEG headmodels: >> http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg and an example >> script >> for leadfield computation: >> http://fieldtrip.fcdonders.nl/example/compute_leadfield). >> >> Best, >> Lilla >> >> >> > Dear Fieldtrip experts, >> > >> > I would like to create a leadfield based on the standard brain provided >> by >> > the fieldtrip package and standard electrode positions. >> > Unfortunately, whatever I'm trying it ends up in a number of error >> > messages. >> > >> > Is anybody out there who could provide some support? >> > >> > Thank you very much in advance, >> > Best, >> > Enrico >> > >> > >> > -- >> > Dr. Enrico Schulz >> > Postdoc >> > Klinikum rechts der Isar der Technischen Universität München >> > Neurologische Klinik und Poliklinik >> > Neuro-Kopf-Zentrum >> > Ismaningerstr. 22 >> > 81675 München >> > >> > Tel.: 089-4140-7664 >> > _______________________________________________ >> > 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 >> > > > > -- > Dr. Enrico Schulz > Postdoc > Klinikum rechts der Isar der Technischen Universität München > Neurologische Klinik und Poliklinik > Neuro-Kopf-Zentrum > Ismaningerstr. 22 > 81675 München > > Tel.: 089-4140-7664 > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Dr. Enrico Schulz Postdoc Klinikum rechts der Isar der Technischen Universität München Neurologische Klinik und Poliklinik Neuro-Kopf-Zentrum Ismaningerstr. 22 81675 München Tel.: 089-4140-7664 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sun Mar 10 02:38:44 2013 From: russgport at gmail.com (Russell G Port) Date: Sat, 9 Mar 2013 19:38:44 -0600 Subject: [FieldTrip] source interpolate - tmp = interpmat*tmp; inner matrix must agree Message-ID: Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: *People can skip the first part of code, I included it as possibly useful information for this plead * %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); *Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition* %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; *Heres where it falls apart, because I try to source interpolate* %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with the current problem * cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos *(position of the leadfield locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), 'sphereradius', cfg.sphereradius) (0.*05*); what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata*. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Sun Mar 10 13:34:23 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Sun, 10 Mar 2013 13:34:23 +0100 Subject: [FieldTrip] auditory evoked gamma Message-ID: Dear all, Thank you very much for thorough discussion! I will try to figure out something! All the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Sun Mar 10 18:22:54 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Sun, 10 Mar 2013 18:22:54 +0100 Subject: [FieldTrip] problem with MEG leadfield Message-ID: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> Hi everybody I'm trying to generate a field for a simulated dipole using the command ft_dipolesimulation, for a MEG study. I do the following: -read the hdr -import the sensor structure with the following lines grad=hdr.grad; radius = sqrt(sum(grad.chanpos.^2,2)); grad.chanpos = grad.chanpos./ [radius radius radius]; grad.label=hdr.label(1:306)'; -then I create the vol structure using the following code vol = []; vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 cm vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; At this point I have the grad structure, and the vol structure. Then I give all the options for the dipole simulation with the code %% create a dipole simulation with a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.grad = grad; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; cfg.dip.frequency = 10; %Hz cfg.ntrials = 10; cfg.triallength = 20; % seconds cfg.fsample = 250; % Hz but when I try to esecute the line raw1 = ft_dipolesimulation(cfg); I find this error ??? Error using ==> ft_compute_leadfield at 301 unsupported volume conductor model for MEG Error in ==> ft_dipolesimulation at 198 lf = ft_compute_leadfield(dippos{trial}, sens, vol); I really cannot understand why volume conductor model is not supported. Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not able to see it. Thank you! Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3491530515 tel +39 0818675361 fax +39 0818675128 "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From hamid.mohseni at eng.ox.ac.uk Sun Mar 10 19:32:25 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sun, 10 Mar 2013 18:32:25 +0000 Subject: [FieldTrip] Trialwise log of TF transform before condition averaging? In-Reply-To: References: Message-ID: Hi George, You are right, getting logarithm of the trials and then average is equivalent to the multiplying trials and then getting log. It remains that whether summing or multiplying trials can reduce the outliers. I therefore really doubt this way of analysis can remove or suppress the outliers. Thanks On 9 March 2013 14:34, George Wallis wrote: > Dear fieldtrip experts > > When computing condition averages of TF transformed data, I take the log > of the trialwise data before averaging over the trials for a given > condition. As I was taking the log of the trialwise data for trialwise > analyses, this seemed the most consistent approach. However, I notice it > isn't implemented in fieldtrip (it requires a tweak of the ft_freqanalysis > function), and the tf averages tend to look noisier this way than if they > are averaged before taking the log. > > Does anyone have any insight into whether this is a sensible way to > generate condition averages? I originally thought this would reduce the > influence of outlier trials - but since it is equivalent to taking the log > of the product of all the trials within a condition, perhaps it is going to > do the opposite? > > George > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 11 03:09:59 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 11 Mar 2013 10:09:59 +0800 Subject: [FieldTrip] creating leadfiled Message-ID: Dear Fieldtrip experts, I would like to create a leadfield based on the standard brain provided by the fieldtrip package and standard electrode positions. I do it like this : load standard_singleshell % from template\headmodel cfg = []; cfg.elec = sens;% also from template cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; [grid] = ft_prepare_leadfield(cfg); Finally I got the following error message. converting units from 'mm' to 'cm' ??? Error using ==> ft_prepare_vol_sens at 495 unsupported volume conductor model for EEG Error in ==> prepare_headmodel at 84 [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ==> ft_prepare_leadfield at 147 [vol, sens, cfg] = prepare_headmodel(cfg, data); but when I use 'standard_bem' (from template )is OK . Is anybody out there who could provide some support? Thank you very much in advance, Best, mengtongxiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 11 08:45:48 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Mon, 11 Mar 2013 15:45:48 +0800 Subject: [FieldTrip] Calculating the cross spectral density matrix Message-ID: Dear all: I calculate the cross spectral density matrix and my data from rest. I want do beta-band activity(14-30Hz).so I use a center frequency of about 22 Hz.we select a time window of 0.5s.I do this as follow: cfg = []; cfg.toilim = [0.5 1]; dataP = ft_redefinetrial(cfg, data_org); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 8; cfg.foilim = [22 22]; freqP = ft_freqanalysis(cfg, dataP); And i got this wrong message ??? Error using ==> dpss at 45 Time-bandwidth product NW must be less than N/2. Error in ==> ft_specest_mtmfft>double_dpss at 303 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_specest_mtmfft at 115 tap = double_dpss(ndatsample,ndatsample*(tapsmofrq./fsample))'; Error in ==> ft_freqanalysis at 526 [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt); thanks for your attention. best, mengtongxiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 11 09:47:24 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 11 Mar 2013 09:47:24 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> Message-ID: <513D9A1C.2040009@donders.ru.nl> Dear Mushfa, I never tried what you did, however from what I know of the matter and from what Robert wrote, I can see that you made some errors in your script that I can point to. I can, however, neither guarantee that this solves all or any of your problems nor that it's all correct what you are doing. So, I can only tell you some minor things: 1) When defining trial, setting cfg.trialdef.eventtype to '?' should actually only be done if you do not know the eventtype. Also note that it might be better to use all your trials rather than a subset - better signal-to-noise that way ;) 2) No reason to segment the brain twice - this operation should be done only once and the segmented brain you base the two leadfield-matrices on *must* be exactly the same. So you can save time by removing the computation of vol2. 3) Specifying only one frequency might not be a good idea, because of imperfect sampling. 4) 'singlesphere' is created specifically for MEG data. BEM models are good for EEG, not sure how good they are for MEG, but the dipoli implementation only works under unix (Linux/Mac) and openMEEG has to be downloaded manually first to make it work. 5) As Robert said, units are not always properly controlled for using FieldTrip. You can use ft_convert_units to make them match. 6) Please check again how 'grid' is defined, e.g. the .dim field shouldn't be concatenated. 7) You do not only need to concatenate the grids, but also the data, hope you did that ;) But I would really rather concatenated the two freq structures you used to compute the sourcemodel/leadfield than to compute it newly. If you concatenate you can be sure that the channel order is persistent. If you keep on having problems, I would suggest to use breakpoints or /dbstop if error/ and then step through the function to see where the error comes from, i.e. why there are NaNs or Infs in (lf*Cf*lf), and start off with looking at if there are NaNs or Infs in lf or Cf already. That's all I can help you with, cause that's were my knowledge ends ;) Maybe someone else is wiser than I am. Good luck! Best, Jörn On 3/8/2013 4:12 PM, Mushfa Yousuf wrote: > > Hello; > > I have few problems while calculating combine "MEG & EEG" source > reconstruction and I need your help to troubleshoot the problems. > > I have a data from a Parkinson's disease patient who underwent DBS and > we recorded 306 MEG channels and 64 EEG channels simultaneously, first > I have calculated the leadfield individually for both EEG and MEG. > > I have defined all the calculations step by step so that I can > describe my problems very precisely. > > *_CALCULATE THE LEADFIELD FOR MEG CHANNELS:-_* > > // I have defined the Pre-Stimulus data i.e. Stim-off data in the > original code. > > _Reading raw data set for MEG channels_ > > __ > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'MEG'}; *// In order to read raw data only for MEG > channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that I have defined the _time of window of interest_ for the MEG > raw data set > > cfg.toilim = [0 0.5]; > > dataPost = ft_redefinetrial(cfg, dataFIC12); > > and calculate the _Power Spectral density matrix_ for the MEG channels > data set > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'powandcsd'; > > cfg.tapsmofrq = 2; > > cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the > stimulation frequency > > cfg.pad = 1; > > freqPost = ft_freqanalysis(cfg, dataPost); > > Now next step for me is to choose the method for the Head Model. I > have noticed that Singlesphere is the common method which can be used > for both EEG and MEG. So I have selected the singlesphere method for > the calculation of volume conduction model. > > mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); // READ MRI > > cfg = []; > > cfg.write = 'no'; > > cfg.coordsys = 'ctf'; > > segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the segmented mri > > cfg = []; > > cfg.method = 'singlesphere'; // *METHOD* > > vol1 = ft_prepare_headmodel(cfg, segmentedmri1); > > Now next step is to calculate the LEADFIELD > > cfg = []; > > cfg.grad = freqPost.grad; > > cfg.vol = vol1; > > cfg.reducerank = 2; // MEG > > cfg.channel = {'MEG'}; > > cfg.grid.resolution = 1; // I choose a resolution 1 > > [grid1] = ft_prepare_leadfield(cfg); > > *disp(grid1)* > > * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* > > * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* > > * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* > > * dim: [15 16 16]* > > * pos: [3840x3 double]* > > * unit: 'cm'* > > * inside: [1x2037 double]* > > * outside: [1x1803 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3840 cell}* > > ** > > ** > > ØIt has to be noticed that Inside Dipole is 2037. > > ** > > *_CALCULATE THE LEADFIELD FOR EEG CHANNELS:-_* > > _Reading raw data set for EEG channels_ > > __ > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'EEG'}; *// In order to read raw data only for EEG > channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that I have defined the _time of window of interest_ for the EEG > raw data set > > cfg.toilim = [0 0.5]; > > dataPost = ft_redefinetrial(cfg, dataFIC12); > > and calculate the _Power Spectral density matrix_ for the EEG channels > data set > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'powandcsd'; > > cfg.tapsmofrq = 2; > > cfg.foilim = [129 129]; // Frequency of interest is 129 Hz > > cfg.pad = 1; > > freqPost = ft_freqanalysis(cfg, dataPost); > > _HEAD MODEL FOR EEG_ > > mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); > > cfg = []; > > cfg.write = 'no'; > > cfg.coordsys = 'ctf'; > > segmentedmri2 = ft_volumesegment(cfg, mri); > > cfg = []; > > cfg.method = 'singlesphere'; // METHOD > > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > _LEADFIELD:___ > > cfg = []; > > cfg.elec = freqPost.elec; > > cfg.vol = vol2; > > cfg.reducerank = 3; % 3 for EEG > > cfg.channel = {'EEG'}; > > cfg.grid.resolution = 9.54; // Increase the resolution so that the > inside dipoles for > > EEG should be close to the inside dipoles of MEG > > [grid2] = ft_prepare_leadfield(cfg); > > *disp(grid2)* > > * xgrid: [1x16 double]* > > * ygrid: [1x16 double]* > > * zgrid: [1x13 double]* > > * dim: [16 16 13]* > > * pos: [3328x3 double]* > > * unit: 'mm'* > > * inside: [1x2038 double]* > > * outside: [1x1290 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3328 cell}* > > ØIt has to be noticed that Inside Dipole is 2038. > > *_Concatenate of MEG and EEG LEADFIELD:-_* > > Now I have the individual LEADFIELD of both MEG and EEG grid1 and > grid2 respectively. > > *disp(grid1)* > > * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* > > * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* > > * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* > > * dim: [15 16 16]* > > * pos: [3840x3 double]* > > * unit: 'cm'* > > * inside: [1x2037 double]* > > * outside: [1x1803 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3840 cell}* > > ** > > *disp(grid2)* > > * xgrid: [1x16 double]* > > * ygrid: [1x16 double]* > > * zgrid: [1x13 double]* > > * dim: [16 16 13]* > > * pos: [3328x3 double]* > > * unit: 'mm'* > > * inside: [1x2038 double]* > > * outside: [1x1290 double]* > > * cfg: [1x1 struct]* > > * leadfield: {1x3328 cell}* > > ** > > *Few things to be noticed here * > > ** > > Ø*unit is different for both MEG 'cm' and EEG 'mm'* > > Ø*I have used the same method for calculating the Volume for both MEG > & EEG => "Singlesphere" * > > Ø*Concatenating the "pos" vector of EEG and MEG and the other vectors* > > ** > > *Grid.pos = cat(1,grid1.pos,grid2.pos);* > > *Grid.xgrid = [grid1.xgrid grid2.xgrid];* > > *Grid.ygrid = [grid1.ygrid grid2.ygrid];* > > *Grid.zgrid = [grid1.zgrid grid2.zgrid];* > > *Grid.inside = [grid1.inside grid2.inside];* > > *Grid.outside = [grid1.outside grid2.outside];* > > *Grid.leadfield = [grid1.leadfield grid2.leadfield];* > > *Grid.dim = [grid1.dim grid2.dim];* > > ** > > *_Combined Source Reconstruction:-_* > > cfg = []; > > cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; > > cfg.trialdef.eventtype = '?'; > > cfg.trialdef.triallength = 1; > > cfg.trialdef.poststim = 88; > > cfg = ft_definetrial(cfg); > > cfg.trl = cfg.trl(1:88,:); // Read 88 trials > > cfg.channel = {'MEG','EEG'}; *// In order to read raw data for MEG & > EEG channels* > > dataFIC12 = ft_preprocessing(cfg); > > After that as previously defined, I have calculated the Spectral density. > > Now I have to calculate the inverse solution for both EEG & MEG data > trials. > > _Source Analysis: without contrasting condition:-_ > > __ > > cfg = []; > > cfg.method = 'dics'; > > cfg.frequency = 129; > > cfg.grid = Grid; // Concatenated grid > > cfg.vol = vol1; // As vol1 = vol2 : both singlesphere > > cfg.powmethod = 'trace'; > > cfg.dics.projectnoise = 'yes'; > > cfg.dics.lambda = 0.0001; > > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost > contains both MEG * > > *and EEG row data* > > **** > > I have received the following error: > > scanning grid 2037/4075 > > ??? Error using ==> svd > > Input to SVD must not contain NaN or Inf. > > Error in ==> beamformer_dics>pinv at 568 > > [U,S,V] = svd(A,0); > > Error in ==> beamformer_dics at 314 > > filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, > > use PINV/SVD to cover rank deficient leadfield > > Error in ==> ft_sourceanalysis at 595 > > dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), > > optarg{:}); > > Error in ==> code at 227 > > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > ØIf you notice that till 2037 grid it represents the MEG grid and > after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which also > represent inside dipole). > > ØSecondly I try to use other method for the head modeling i.e > openmeeg, dipoli and bemcp method which leads me to different errors > which I was unable to trouble shoot. > > ·Openmeeg = OpenMEEG binaries are not correctly installed > > ·Dipoli =vol.mat file was missing after calculating the headmodel > > ·Bemcp =vol.mat file contains NaN fiels which leads to wrong > > leadfield computation. > > *_I apologize for the long email. I wanted to show the steps which I > used so that it is easier to debug the problem._* > > *__* > > Thank you; > > Mushfa Yousuf > > > > On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld > > wrote: > > Dear Mushfa > > In principle it can be made to work, but you'll have to do a > little bit of work outside fieldtrip. You would start with > 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part > 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part > Subsequently you would (manually) concatenate the leadfields of > the MEG and EEG. Here you have to make sure that the channel order > is consistent with that in your combined data. > The resulting structure with combined leadfields can be passed > into ft_sourceanalysis as cfg.grid. > > However, I foresee a problem with the scaling. At this moment > FieldTrip is not (yet) very precise in maintaining the correct > units throughout. Consequently you might get different units for > the EEG and MEG contribution to each dipole, causing weird > cancelation effects. You'll just have to check carefully that the > leadfield units and the data units consistently scaled between > megmag, megplanar and eeg. > > This brings me to another known problem for the combined > vectorview magnetometer and planar gradiometer channels: at this > moment the forward computation computes both in T (or fT), whereas > the data is represented as T for the magnetometers and T/m for the > gradiometers. So the gradiometer leadfields are off by a factor > "1/baseline", which is approximately 1/70 if I recall correctly. > Many neuromag users use only the planar channels, and therefore > don't notice. We are working on fixing the neuromag > channel/gradiometer units. That is not as simple as it appears, > because conversions of the geometrical dimensions from m to cm or > mm also affect the gradiometer baseline. So converting the data > from m to mm should result in the planar channel data getting 1000 > times smaller, whereas the magnetometer channels shoudl stay the > same. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 and > http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want to > follow this. > > best regards > Robert > > > > On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: > >> Hello Fieldtrippers, >> >> I am currently doing source analysis using beamformer method in fieldtrip. >> >> The data i work on is a simultaneous measurement of MEG (306) with EEG >> (128) on PD patients. >> >> I was successful in calculating the sources for both the modalities alone. >> >> I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation >> >> >> of the lead field. But, then when i want to use the created vol for the >> source analysis i have two structures one for EEG and the second one for >> MEG. Now, i can only define only one to estimate the sources. How to use >> >> >> this for both the modalities? Any help would be appreciated. >> >> With regards >> Mushfa >> _______________________________________________ >> 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 > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 11 10:18:42 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 11 Mar 2013 10:18:42 +0100 (CET) Subject: [FieldTrip] creating leadfiled In-Reply-To: References: Message-ID: <1959.87.78.53.29.1362993522.squirrel@87.78.53.29> hi, the singleshell volume conduction model (standard_singleshell) is implemented for MEG data, while BEM models are used for EEG. It seems to me that you use EEG template electrodes, therefore those will work only with EEG volume conduction models. You can look at the reference documentation of ft_prepare_headmodel (http://fieldtrip.fcdonders.nl/reference/ft_prepare_headmodel) to see which headmodels work with which type of data. If you would like to compute a leadfield with the singlehell model, you need a structure with gradiometer definition in the cfg.grad instead of the EEG electrode definition in cfg.elec. I hope this helps. Best, Lilla > Dear Fieldtrip experts, > I would like to create a leadfield based on the standard brain provided > by the fieldtrip package and standard electrode positions. > I do it like this : > load standard_singleshell % from template\headmodel > cfg = []; > cfg.elec = sens;% also from template > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; > [grid] = ft_prepare_leadfield(cfg); > > Finally I got the following error message. > converting units from 'mm' to 'cm' > ??? Error using ==> ft_prepare_vol_sens at 495 > unsupported volume conductor model for EEG > Error in ==> prepare_headmodel at 84 > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', > cfg.channel, 'order', cfg.order); > Error in ==> ft_prepare_leadfield at 147 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > but when I use 'standard_bem' (from template )is OK . > > Is anybody out there who could provide some support? > Thank you very much in advance, > Best, > mengtongxiao > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 11 10:41:33 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 11 Mar 2013 10:41:33 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction In-Reply-To: <513D9A1C.2040009@donders.ru.nl> References: <8FB714F5-02E8-4B44-96C3-E8472120AD4F@donders.ru.nl> <513D9A1C.2040009@donders.ru.nl> Message-ID: <513DA6CD.7030402@donders.ru.nl> whoopsy, just realized that you use singlesphere, not singleshell. I was talking about singleshell ;) On 3/11/2013 9:47 AM, "Jörn M. Horschig" wrote: > Dear Mushfa, > > I never tried what you did, however from what I know of the matter and > from what Robert wrote, I can see that you made some errors in your > script that I can point to. I can, however, neither guarantee that > this solves all or any of your problems nor that it's all correct what > you are doing. So, I can only tell you some minor things: > 1) When defining trial, setting cfg.trialdef.eventtype to '?' should > actually only be done if you do not know the eventtype. Also note that > it might be better to use all your trials rather than a subset - > better signal-to-noise that way ;) > > 2) No reason to segment the brain twice - this operation should be > done only once and the segmented brain you base the two > leadfield-matrices on *must* be exactly the same. So you can save time > by removing the computation of vol2. > > 3) Specifying only one frequency might not be a good idea, because of > imperfect sampling. > > 4) 'singlesphere' is created specifically for MEG data. BEM models are > good for EEG, not sure how good they are for MEG, but the dipoli > implementation only works under unix (Linux/Mac) and openMEEG has to > be downloaded manually first to make it work. > > 5) As Robert said, units are not always properly controlled for using > FieldTrip. You can use ft_convert_units to make them match. > > 6) Please check again how 'grid' is defined, e.g. the .dim field > shouldn't be concatenated. > > 7) You do not only need to concatenate the grids, but also the data, > hope you did that ;) But I would really rather concatenated the two > freq structures you used to compute the sourcemodel/leadfield than to > compute it newly. If you concatenate you can be sure that the channel > order is persistent. > > > If you keep on having problems, I would suggest to use breakpoints or > /dbstop if error/ and then step through the function to see where the > error comes from, i.e. why there are NaNs or Infs in (lf*Cf*lf), and > start off with looking at if there are NaNs or Infs in lf or Cf > already. That's all I can help you with, cause that's were my > knowledge ends ;) Maybe someone else is wiser than I am. Good luck! > > Best, > Jörn > > On 3/8/2013 4:12 PM, Mushfa Yousuf wrote: >> >> Hello; >> >> I have few problems while calculating combine "MEG & EEG" source >> reconstruction and I need your help to troubleshoot the problems. >> >> I have a data from a Parkinson's disease patient who underwent DBS >> and we recorded 306 MEG channels and 64 EEG channels simultaneously, >> first I have calculated the leadfield individually for both EEG and MEG. >> >> I have defined all the calculations step by step so that I can >> describe my problems very precisely. >> >> *_CALCULATE THE LEADFIELD FOR MEG CHANNELS:-_* >> >> // I have defined the Pre-Stimulus data i.e. Stim-off data in the >> original code. >> >> _Reading raw data set for MEG channels_ >> >> __ >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'MEG'}; *// In order to read raw data only for MEG >> channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that I have defined the _time of window of interest_ for the >> MEG raw data set >> >> cfg.toilim = [0 0.5]; >> >> dataPost = ft_redefinetrial(cfg, dataFIC12); >> >> and calculate the _Power Spectral density matrix_ for the MEG >> channels data set >> >> cfg = []; >> >> cfg.method = 'mtmfft'; >> >> cfg.output = 'powandcsd'; >> >> cfg.tapsmofrq = 2; >> >> cfg.foilim = [129 129]; // Frequency of interest is 129 Hz the >> stimulation frequency >> >> cfg.pad = 1; >> >> freqPost = ft_freqanalysis(cfg, dataPost); >> >> Now next step for me is to choose the method for the Head Model. I >> have noticed that Singlesphere is the common method which can be used >> for both EEG and MEG. So I have selected the singlesphere method for >> the calculation of volume conduction model. >> >> mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); // READ MRI >> >> cfg = []; >> >> cfg.write = 'no'; >> >> cfg.coordsys = 'ctf'; >> >> segmentedmri1 = ft_volumesegment(cfg, mri); // Calculate the >> segmented mri >> >> cfg = []; >> >> cfg.method = 'singlesphere'; // *METHOD* >> >> vol1 = ft_prepare_headmodel(cfg, segmentedmri1); >> >> Now next step is to calculate the LEADFIELD >> >> cfg = []; >> >> cfg.grad = freqPost.grad; >> >> cfg.vol = vol1; >> >> cfg.reducerank = 2; // MEG >> >> cfg.channel = {'MEG'}; >> >> cfg.grid.resolution = 1; // I choose a resolution 1 >> >> [grid1] = ft_prepare_leadfield(cfg); >> >> *disp(grid1)* >> >> * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* >> >> * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* >> >> * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* >> >> * dim: [15 16 16]* >> >> * pos: [3840x3 double]* >> >> * unit: 'cm'* >> >> * inside: [1x2037 double]* >> >> * outside: [1x1803 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3840 cell}* >> >> ** >> >> ** >> >> ØIt has to be noticed that Inside Dipole is 2037. >> >> ** >> >> *_CALCULATE THE LEADFIELD FOR EEG CHANNELS:-_* >> >> _Reading raw data set for EEG channels_ >> >> __ >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'EEG'}; *// In order to read raw data only for EEG >> channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that I have defined the _time of window of interest_ for the >> EEG raw data set >> >> cfg.toilim = [0 0.5]; >> >> dataPost = ft_redefinetrial(cfg, dataFIC12); >> >> and calculate the _Power Spectral density matrix_ for the EEG >> channels data set >> >> cfg = []; >> >> cfg.method = 'mtmfft'; >> >> cfg.output = 'powandcsd'; >> >> cfg.tapsmofrq = 2; >> >> cfg.foilim = [129 129]; // Frequency of interest is 129 Hz >> >> cfg.pad = 1; >> >> freqPost = ft_freqanalysis(cfg, dataPost); >> >> _HEAD MODEL FOR EEG_ >> >> mri = ft_read_mri('ms1879865-0004-00001-000192-01.img'); >> >> cfg = []; >> >> cfg.write = 'no'; >> >> cfg.coordsys = 'ctf'; >> >> segmentedmri2 = ft_volumesegment(cfg, mri); >> >> cfg = []; >> >> cfg.method = 'singlesphere'; // METHOD >> >> vol2 = ft_prepare_headmodel(cfg, segmentedmri2); >> >> _LEADFIELD:___ >> >> cfg = []; >> >> cfg.elec = freqPost.elec; >> >> cfg.vol = vol2; >> >> cfg.reducerank = 3; % 3 for EEG >> >> cfg.channel = {'EEG'}; >> >> cfg.grid.resolution = 9.54; // Increase the resolution so that the >> inside dipoles for >> >> EEG should be close to the inside dipoles of MEG >> >> [grid2] = ft_prepare_leadfield(cfg); >> >> *disp(grid2)* >> >> * xgrid: [1x16 double]* >> >> * ygrid: [1x16 double]* >> >> * zgrid: [1x13 double]* >> >> * dim: [16 16 13]* >> >> * pos: [3328x3 double]* >> >> * unit: 'mm'* >> >> * inside: [1x2038 double]* >> >> * outside: [1x1290 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3328 cell}* >> >> ØIt has to be noticed that Inside Dipole is 2038. >> >> *_Concatenate of MEG and EEG LEADFIELD:-_* >> >> Now I have the individual LEADFIELD of both MEG and EEG grid1 and >> grid2 respectively. >> >> *disp(grid1)* >> >> * xgrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]* >> >> * ygrid: [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]* >> >> * zgrid: [-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11]* >> >> * dim: [15 16 16]* >> >> * pos: [3840x3 double]* >> >> * unit: 'cm'* >> >> * inside: [1x2037 double]* >> >> * outside: [1x1803 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3840 cell}* >> >> ** >> >> *disp(grid2)* >> >> * xgrid: [1x16 double]* >> >> * ygrid: [1x16 double]* >> >> * zgrid: [1x13 double]* >> >> * dim: [16 16 13]* >> >> * pos: [3328x3 double]* >> >> * unit: 'mm'* >> >> * inside: [1x2038 double]* >> >> * outside: [1x1290 double]* >> >> * cfg: [1x1 struct]* >> >> * leadfield: {1x3328 cell}* >> >> ** >> >> *Few things to be noticed here * >> >> ** >> >> Ø*unit is different for both MEG 'cm' and EEG 'mm'* >> >> Ø*I have used the same method for calculating the Volume for both MEG >> & EEG => "Singlesphere" * >> >> Ø*Concatenating the "pos" vector of EEG and MEG and the other vectors* >> >> ** >> >> *Grid.pos = cat(1,grid1.pos,grid2.pos);* >> >> *Grid.xgrid = [grid1.xgrid grid2.xgrid];* >> >> *Grid.ygrid = [grid1.ygrid grid2.ygrid];* >> >> *Grid.zgrid = [grid1.zgrid grid2.zgrid];* >> >> *Grid.inside = [grid1.inside grid2.inside];* >> >> *Grid.outside = [grid1.outside grid2.outside];* >> >> *Grid.leadfield = [grid1.leadfield grid2.leadfield];* >> >> *Grid.dim = [grid1.dim grid2.dim];* >> >> ** >> >> *_Combined Source Reconstruction:-_* >> >> cfg = []; >> >> cfg.dataset = 'ap_rest_stimon_bi_2_5ma.fif'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg.trialdef.triallength = 1; >> >> cfg.trialdef.poststim = 88; >> >> cfg = ft_definetrial(cfg); >> >> cfg.trl = cfg.trl(1:88,:); // Read 88 trials >> >> cfg.channel = {'MEG','EEG'}; *// In order to read raw data for MEG >> & EEG channels* >> >> dataFIC12 = ft_preprocessing(cfg); >> >> After that as previously defined, I have calculated the Spectral >> density. >> >> Now I have to calculate the inverse solution for both EEG & MEG data >> trials. >> >> _Source Analysis: without contrasting condition:-_ >> >> __ >> >> cfg = []; >> >> cfg.method = 'dics'; >> >> cfg.frequency = 129; >> >> cfg.grid = Grid; // Concatenated grid >> >> cfg.vol = vol1; // As vol1 = vol2 : both singlesphere >> >> cfg.powmethod = 'trace'; >> >> cfg.dics.projectnoise = 'yes'; >> >> cfg.dics.lambda = 0.0001; >> >> sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); // *freqpost >> contains both MEG * >> >> *and EEG row data* >> >> **** >> >> I have received the following error: >> >> scanning grid 2037/4075 >> >> ??? Error using ==> svd >> >> Input to SVD must not contain NaN or Inf. >> >> Error in ==> beamformer_dics>pinv at 568 >> >> [U,S,V] = svd(A,0); >> >> Error in ==> beamformer_dics at 314 >> >> filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, >> >> use PINV/SVD to cover rank deficient leadfield >> >> Error in ==> ft_sourceanalysis at 595 >> >> dip(i) = beamformer_dics(grid, sens, vol, [], squeeze(Cf(i,:,:)), >> >> optarg{:}); >> >> Error in ==> code at 227 >> >> sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); >> >> ØIf you notice that till 2037 grid it represents the MEG grid and >> after that EEG grid is concatenated. i.e 2037 +2038 = 4075 (which >> also represent inside dipole). >> >> ØSecondly I try to use other method for the head modeling i.e >> openmeeg, dipoli and bemcp method which leads me to different errors >> which I was unable to trouble shoot. >> >> ·Openmeeg = OpenMEEG binaries are not correctly installed >> >> ·Dipoli =vol.mat file was missing after calculating the headmodel >> >> ·Bemcp =vol.mat file contains NaN fiels which leads to wrong >> >> leadfield computation. >> >> *_I apologize for the long email. I wanted to show the steps which I >> used so that it is easier to debug the problem._* >> >> *__* >> >> Thank you; >> >> Mushfa Yousuf >> >> >> >> On Fri, Feb 8, 2013 at 2:36 PM, Robert Oostenveld >> > wrote: >> >> Dear Mushfa >> >> In principle it can be made to work, but you'll have to do a >> little bit of work outside fieldtrip. You would start with >> 1) ft_prepare_headmodel and ft_prepare_leadfield for the MEG part >> 2) ft_prepare_headmodel and ft_prepare_leadfield for the EEG part >> Subsequently you would (manually) concatenate the leadfields of >> the MEG and EEG. Here you have to make sure that the channel >> order is consistent with that in your combined data. >> The resulting structure with combined leadfields can be passed >> into ft_sourceanalysis as cfg.grid. >> >> However, I foresee a problem with the scaling. At this moment >> FieldTrip is not (yet) very precise in maintaining the correct >> units throughout. Consequently you might get different units for >> the EEG and MEG contribution to each dipole, causing weird >> cancelation effects. You'll just have to check carefully that the >> leadfield units and the data units consistently scaled between >> megmag, megplanar and eeg. >> >> This brings me to another known problem for the combined >> vectorview magnetometer and planar gradiometer channels: at this >> moment the forward computation computes both in T (or fT), >> whereas the data is represented as T for the magnetometers and >> T/m for the gradiometers. So the gradiometer leadfields are off >> by a factor "1/baseline", which is approximately 1/70 if I recall >> correctly. Many neuromag users use only the planar channels, and >> therefore don't notice. We are working on fixing the neuromag >> channel/gradiometer units. That is not as simple as it appears, >> because conversions of the geometrical dimensions from m to cm or >> mm also affect the gradiometer baseline. So converting the data >> from m to mm should result in the planar channel data getting >> 1000 times smaller, whereas the magnetometer channels shoudl stay >> the same. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 >> and http://bugzilla.fcdonders.nl/show_bug.cgi?id=963 if you want >> to follow this. >> >> best regards >> Robert >> >> >> >> On 28 Jan 2013, at 20:20, Mushfa Yousuf wrote: >> >>> Hello Fieldtrippers, >>> >>> I am currently doing source analysis using beamformer method in fieldtrip. >>> >>> The data i work on is a simultaneous measurement of MEG (306) with EEG >>> (128) on PD patients. >>> >>> I was successful in calculating the sources for both the modalities alone. >>> >>> I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation >>> >>> >>> of the lead field. But, then when i want to use the created vol for the >>> source analysis i have two structures one for EEG and the second one for >>> MEG. Now, i can only define only one to estimate the sources. How to use >>> >>> >>> this for both the modalities? Any help would be appreciated. >>> >>> With regards >>> Mushfa >>> _______________________________________________ >>> 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 >> >> >> >> >> _______________________________________________ >> 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 -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Mon Mar 11 10:46:33 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Mon, 11 Mar 2013 10:46:33 +0100 (CET) Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> References: <20130310182254.peulqz4tc0so88kg@arco.cib.na.cnr.it> Message-ID: <2126.87.78.53.29.1362995193.squirrel@87.78.53.29> hi Sara, I am not entirely sure of this: But I think you get the error message because your vol structure is recognized as a concentric-spheres type volume conduction model which is supported for EEG data, while your input is MEG data. You can check it here (in the reference documentation of ft_prepare_headmodel) which headmodels are implemented for MEG: http://fieldtrip.fcdonders.nl/reference/ft_prepare_headmodel. Best, Lilla > Hi everybody > I'm trying to generate a field for a simulated dipole using the > command ft_dipolesimulation, for a MEG study. > > I do the following: > -read the hdr > > -import the sensor structure with the following lines > grad=hdr.grad; > radius = sqrt(sum(grad.chanpos.^2,2)); > grad.chanpos = grad.chanpos./ [radius radius radius]; > grad.label=hdr.label(1:306)'; > > -then I create the vol structure using the following code > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 > cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; > > At this point I have the grad structure, and the vol structure. > Then I give all the options for the dipole simulation with the code > > %% create a dipole simulation with a custom timecourse > cfg = []; > cfg.vol = vol; % see above > cfg.grad = grad; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; > cfg.dip.frequency = 10; %Hz > cfg.ntrials = 10; > cfg.triallength = 20; % seconds > cfg.fsample = 250; % Hz > > but when I try to esecute the line > > raw1 = ft_dipolesimulation(cfg); > > I find this error > > ??? Error using ==> ft_compute_leadfield at 301 > unsupported volume conductor model for MEG > > Error in ==> ft_dipolesimulation at 198 > lf = ft_compute_leadfield(dippos{trial}, sens, vol); > > > I really cannot understand why volume conductor model is not supported. > Any suggestion? I'm pretty sure that the mistake is trivial, but I'm > not able to see it. > > Thank you! > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3491530515 > tel +39 0818675361 > fax +39 0818675128 > > > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From hamid.mohseni at eng.ox.ac.uk Mon Mar 11 12:55:30 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Mon, 11 Mar 2013 11:55:30 +0000 Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> References: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> Message-ID: Hi, In MEG normally people use single layer volume conductor and It is believed that three layer is not useful and can deteriorate the results (this is in contrast to EEG). Therefore, you should use a single shell or a single sphere for MEG, which models only the brain (conductivity of the scalp is assumed to be same as the air). Thanks On 10 March 2013 17:22, wrote: > Hi everybody > I'm trying to generate a field for a simulated dipole using the command > ft_dipolesimulation, for a MEG study. > > I do the following: > -read the hdr > > -import the sensor structure with the following lines > grad=hdr.grad; > radius = sqrt(sum(grad.chanpos.^2,2)); > grad.chanpos = grad.chanpos./ [radius radius radius]; > grad.label=hdr.label(1:306)'; > > -then I create the vol structure using the following code > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 > cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; > > At this point I have the grad structure, and the vol structure. > Then I give all the options for the dipole simulation with the code > > %% create a dipole simulation with a custom timecourse > cfg = []; > cfg.vol = vol; % see above > cfg.grad = grad; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; > cfg.dip.frequency = 10; %Hz > cfg.ntrials = 10; > cfg.triallength = 20; % seconds > cfg.fsample = 250; % Hz > > but when I try to esecute the line > > raw1 = ft_dipolesimulation(cfg); > > I find this error > > ??? Error using ==> ft_compute_leadfield at 301 > unsupported volume conductor model for MEG > > Error in ==> ft_dipolesimulation at 198 > lf = ft_compute_leadfield(dippos{**trial}, sens, vol); > > > I really cannot understand why volume conductor model is not supported. > Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not > able to see it. > > Thank you! > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3491530515 > tel +39 0818675361 > fax +39 0818675128 > > > "I disapprove of what you say, but I will defend to the death your right > to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ------------------------------**------------------------------**---- > This message was sent using IMP, the Internet Messaging Program. > > > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Mon Mar 11 16:05:21 2013 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Mon, 11 Mar 2013 16:05:21 +0100 Subject: [FieldTrip] problem with MEG leadfield In-Reply-To: References: <6dd0747f-f9b3-4170-a8d5-efd0819d198f@HUB03.ad.oak.ox.ac.uk> Message-ID: <20130311160521.ay852ph1ws0gs0s0@arco.cib.na.cnr.it> Thank you Hamid and Lilla your observations were correct and I solved my problem :-) Thanks for helping Best regards Sara > Hi, > > In MEG normally people use single layer volume conductor and It > is believed that three layer is not useful and can deteriorate the results > (this is in contrast to EEG). Therefore, you should use a single shell or > a single sphere for MEG, which models only the brain (conductivity of the > scalp is assumed to be same as the air). > > Thanks > > > > > On 10 March 2013 17:22, wrote: > >> Hi everybody >> I'm trying to generate a field for a simulated dipole using the command >> ft_dipolesimulation, for a MEG study. >> >> I do the following: >> -read the hdr >> >> -import the sensor structure with the following lines >> grad=hdr.grad; >> radius = sqrt(sum(grad.chanpos.^2,2)); >> grad.chanpos = grad.chanpos./ [radius radius radius]; >> grad.label=hdr.label(1:306)'; >> >> -then I create the vol structure using the following code >> vol = []; >> vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 >> cm >> vol.c = [1 1/80 1]; % conductivity >> vol.o = [0 0 0]; >> >> At this point I have the grad structure, and the vol structure. >> Then I give all the options for the dipole simulation with the code >> >> %% create a dipole simulation with a custom timecourse >> cfg = []; >> cfg.vol = vol; % see above >> cfg.grad = grad; % see above >> cfg.dip.pos = [0 0.5 0.3]; >> cfg.dip.mom = [1 0 0]'; >> cfg.dip.frequency = 10; %Hz >> cfg.ntrials = 10; >> cfg.triallength = 20; % seconds >> cfg.fsample = 250; % Hz >> >> but when I try to esecute the line >> >> raw1 = ft_dipolesimulation(cfg); >> >> I find this error >> >> ??? Error using ==> ft_compute_leadfield at 301 >> unsupported volume conductor model for MEG >> >> Error in ==> ft_dipolesimulation at 198 >> lf = ft_compute_leadfield(dippos{**trial}, sens, vol); >> >> >> I really cannot understand why volume conductor model is not supported. >> Any suggestion? I'm pretty sure that the mistake is trivial, but I'm not >> able to see it. >> >> Thank you! >> Dott.ssa Sara Rombetto >> >> Istituto di Cibernetica >> "E. Caianiello" >> Via Campi Flegrei, 34 >> 80078 Pozzuoli (NA) >> Italy >> mob +39 3491530515 >> tel +39 0818675361 >> fax +39 0818675128 >> >> >> "I disapprove of what you say, but I will defend to the death your right >> to say >> it." [Evelyn Beatrice Hall, The Friends Of Voltaire] >> >> ------------------------------**------------------------------**---- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3491530515 tel +39 0818675361 fax +39 0818675128 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From mengtongxiao at gmail.com Tue Mar 12 12:21:52 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Tue, 12 Mar 2013 19:21:52 +0800 Subject: [FieldTrip] analysis of source level connectivity Message-ID: Dear all: I am interesting in connectivity and use the fieldtrip get the source. How do I use it do connectivity. Where can I find some script. I kown use 'svd' I can get 'project along the strongest dipole direction', where is the dilpole. ROI to the strongest dipole or strongest dipole to ROI ? thanks best, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Tue Mar 12 14:28:39 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 12 Mar 2013 14:28:39 +0100 Subject: [FieldTrip] Workshop "Disentangling the brain web" Message-ID: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> sorry for double posting. on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be organizing a small workshop at CIMeC (Rovereto, Italy). we have managed to attract several exciting invited speakers but are considering contributions from postdocs / phd students. see attached pdf. all the best, nathan -------------- next part -------------- A non-text attachment was scrubbed... Name: cimec_meg_workshop2013.pdf Type: application/pdf Size: 391680 bytes Desc: not available URL: From cmuehl at gmail.com Tue Mar 12 15:20:18 2013 From: cmuehl at gmail.com (Christian Muehl) Date: Tue, 12 Mar 2013 15:20:18 +0100 Subject: [FieldTrip] Call for Papers: 3rd Workshop on Affective Brain-Computer Interfaces at ACII 2013 Message-ID: ** Second Call for Papers ** 3rd Workshop on Affective Brain-Computer Interfaces (aBCI) Workshop at ACII 2013 (September 2-5), Geneva, Switzerland, September 2, 2013 http://hmi.ewi.utwente.nl/abci2013 http://www.acii2013.org During the last decade, brain computer interface (BCI) research has developed into a major research field establishing methodological frameworks, guidelines and a core community of established researchers. Besides proving valuable as a communication channel that bypasses impeded muscular pathways, the novel technology also spurred the investigation of applications for able-bodied users, foremost in the fields of entertainment, health and lifestyle. Affective BCI systems allowing users to control computer games, support relaxation training, or trigger your alarm clock during a shallow sleep stage have been proposed, implemented, and sold. Moreover, the affordable hardware and software tools also encouraged artists to play with the idea of a direct access to people’s most private information: their affective and cognitive states. From these explorations followed a number of interesting installations, suggesting novel ways of human-computer as well as human-human interaction: neurotechnology-based systems that encourage affective self-reflection, the synchronization and empathizing between or the competition of different minds, and the collaborative creation and manipulation of digital multimodal content. The third workshop on affective brain-computer interfaces will explore the advantages and limitations of using neuro-physiological signals as a modality for the automatic recognition of affective and cognitive states, and the possibilities of using this information about the user state in applications for domains like health, arts, and entertainment. The goal is to bring researchers, artists, and practitioners together to present state-of-the-art progress and their visions, and thus to spur the development of guidelines and frameworks for affective BCI. Topics of interest include, but are not limited to: • affective/cognitive state induction and data collection for affective BCI • detection of mental state via BCI and other modalities • innovative concepts for adaptive interfaces and affective BCI • demos of affective BCI systems and artworks Submission Instructions * The papers should feature original empirical work, theoretical work, or a well defendable but arguable position of the authors. * Papers will be published in the proceedings of ACII 2013 by IEEE. Papers should be limited to 6 pages. * Further details about the submission instructions and format can be found on the website of ACII 2013. * For further information, contact abci at ewi.utwente.nl Important Dates: April 20, 2013: Submission of manuscripts May 20, 2013: Acceptance/Rejection notification June 17, 2013: Submission of camera-ready papers and presenting author’s registration September 2, 2013: Date of the Workshop Programme Chairs: * Brendan Allison, University of California, San Diego, USA * Guilliaume Chanel, Swiss Center for Affective Sciences, Geneva, Switzerland, * Christian Mühl, INRIA Bordeaux - Sud-Ouest, France * Anton Nijholt, Universiteit Twente, the Netherlands Programme Committee: * Egon L. van den Broek, TNO Technical Sciences, Delft, The Netherlands * Anne-Marie Brouwer, TNO Perceptual and Cognitive Systems, Soesterberg, the Netherlands * Stephen Fairclough, John Moores University, Liverpool, UK * Didier Grandjean, Swiss Center for Affective Sciences, Geneva, Switzerland * Hayrettin Gürkök, University of Twente, Enschede, the Netherlands * Jonghwa Kim, University of Augsburg, Germany * Brent Lance, Army Research Laboratory/TNB, Aberdeen Proving Ground, USA, * Fabien Lotte, INRIA Bordeaux - Sud-Ouest, France * Winfried Menninghaus, Freie Universität Berlin, Germany * Gary Garcia Molina, Philips Research North America, Briarcliff, USA * Christopher Honey, Princeton University, USA * Ioannis Patras, Queen Mary University, London, UK * Mannes Poel, University of Twente, Enschede, the Netherlands * Olga Sourina, NanYang Technological University, Singapore * Ed Tan, Universiteit van Amsterdam, the Netherlands * Aleksander Valjamae, University of Graz, Austria * Thorsten Zander, Technische Universität Berlin, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Tue Mar 12 15:50:58 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 12 Mar 2013 10:50:58 -0400 Subject: [FieldTrip] Workshop "Disentangling the brain web" In-Reply-To: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> References: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> Message-ID: I realize I just missed the Toronto workshop - does anyone know when the Berkeley, CA workshop might take place? On Tue, Mar 12, 2013 at 9:28 AM, Nathan Weisz wrote: > sorry for double posting. > > on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be > organizing a small workshop at CIMeC (Rovereto, Italy). > > we have managed to attract several exciting invited speakers but are > considering contributions from postdocs / phd students. see attached pdf. > > all the best, > nathan > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From konklone at gmail.com Tue Mar 12 15:50:58 2013 From: konklone at gmail.com (Eric Mill) Date: Tue, 12 Mar 2013 10:50:58 -0400 Subject: [FieldTrip] Workshop "Disentangling the brain web" In-Reply-To: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> References: <0587795D-94E6-433D-8B3E-701CCBF10C66@mac.com> Message-ID: I realize I just missed the Toronto workshop - does anyone know when the Berkeley, CA workshop might take place? On Tue, Mar 12, 2013 at 9:28 AM, Nathan Weisz wrote: > sorry for double posting. > > on the 24./25.6.2013 we (christoph braun, ole jensen + me) will be > organizing a small workshop at CIMeC (Rovereto, Italy). > > we have managed to attract several exciting invited speakers but are > considering contributions from postdocs / phd students. see attached pdf. > > all the best, > nathan > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Markus.Butz at uni-duesseldorf.de Wed Mar 13 12:11:21 2013 From: Markus.Butz at uni-duesseldorf.de (Markus Butz) Date: Wed, 13 Mar 2013 11:11:21 +0000 (GMT) Subject: [FieldTrip] Problems reading in DICOM Message-ID: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Dear list,  I am experiencing problems reading in external MRI in DICOM format from a CD (doing it the first time though).  I wanted to do it the new and easy way as described here: http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom % read the DICOM files  mri = ft_read_mri('single_file_of_DICOM_series.IMA'); However, I have no single slices with extension *.ima but one dataset with the extension *.dcm and the other dataset with no extension for the single slice files. I am also not sure where to copy the DICOMDIR file. When I try to open a single file of the *.dcm series I get: mri = ft_read_mri('508652C3.dcm'); ??? Undefined function or variable "hdr". Error in ==> ft_read_mri at 216   hdr     = hdr(keep);  Trying to read in a single file of the no extension series I get: mri = ft_read_mri('73850486'); ??? Error using ==> dicominfo at 41 The specified file is not in DICOM format The Image Processing toolbox V 7.2 is installed and this is fieldtrip-20111101. Any help appreciated! Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Mar 13 12:23:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 13 Mar 2013 12:23:54 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Message-ID: Dear Markus, There have been several changes to ft_read_mri over the past 1,5 year. The first step I would suggest is to update your fieldtrip version to something more recent, perhaps that solves the problem 'automatically'. Best, Eelke On 13 March 2013 12:11, Markus Butz wrote: > Dear list, > > I am experiencing problems reading in external MRI in DICOM format from a CD > (doing it the first time though). > I wanted to do it the new and easy way as described here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom > > % read the DICOM files > mri = ft_read_mri('single_file_of_DICOM_series.IMA'); > > However, I have no single slices with extension *.ima but one dataset with > the extension *.dcm and the other dataset with no extension for the single > slice files. I am also not sure where to copy the DICOMDIR file. > > When I try to open a single file of the *.dcm series I get: > > mri = ft_read_mri('508652C3.dcm'); > > ??? Undefined function or variable "hdr". > > Error in ==> ft_read_mri at 216 > hdr = hdr(keep); > > Trying to read in a single file of the no extension series I get: > > mri = ft_read_mri('73850486'); > > ??? Error using ==> dicominfo at 41 > The specified file is not in DICOM format > > The Image Processing toolbox V 7.2 is installed and this is > fieldtrip-20111101. > > Any help appreciated! > > Markus > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Wed Mar 13 14:22:03 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 13 Mar 2013 14:22:03 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> Message-ID: <51407D7B.4070005@donders.ru.nl> Hi Markus, I kept on avoiding these errors by using MRIcron's dcm2nii functionality: http://www.mccauslandcenter.sc.edu/mricro/mricron/index.html But pay attention to the coordinate system when importing it into FieldTrip afterwards, it can be quite a hassle... Maybe Robert or JM know whether reading in .dcm files is possible, but I have to admit that I never tried ;) Best, Jörn On 3/13/2013 12:11 PM, Markus Butz wrote: > Dear list, > > I am experiencing problems reading in external MRI in DICOM format > from a CD (doing it the first time though). > I wanted to do it the new and easy way as described here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom > > % read the DICOM files > mri = ft_read_mri('single_file_of_DICOM_series.IMA'); > > However, I have no single slices with extension *.ima but one dataset > with the extension *.dcm and the other dataset with no extension for > the single slice files. I am also not sure where to copy the DICOMDIR > file. > > When I try to open a single file of the *.dcm series I get: > > mri = ft_read_mri('508652C3.dcm'); > > ??? Undefined function or variable "hdr". > > Error in ==> ft_read_mri at 216 > hdr = hdr(keep); > > Trying to read in a single file of the no extension series I get: > > mri = ft_read_mri('73850486'); > > ??? Error using ==> dicominfo at 41 > The specified file is not in DICOM format > > The Image Processing toolbox V 7.2 is installed and this is > fieldtrip-20111101. > > Any help appreciated! > > Markus > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingenieureniso at gmail.com Wed Mar 13 16:01:31 2013 From: ingenieureniso at gmail.com (ingenieur eniso) Date: Wed, 13 Mar 2013 16:01:31 +0100 Subject: [FieldTrip] Problems plotting TFR map Message-ID: I am using fieldtrip-20130101 and Matlab 7.10.I have a problem when I try to plot TFR map. The error message I receive is: ??? Error using ==> griddata at 53 X and Y must be same length as Z or the lengths of X and Y must match the size of Z. Error in ==> topoplot at 463 [Xi,Yi,Zi] = griddata(x', y, data, xi', yi, cfg.interpolation); % Interpolate the topographic data Error in ==> lecture at 65 [handle]=topoplot(cfg, meanfft) meanfft is a vector containing the average of the spectral power of each electrode. I have all the electrode locations loaded and the same command works on the same system using version fieldtrip-20130101. Thanks for your help, -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 13 16:33:31 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 13 Mar 2013 16:33:31 +0100 Subject: [FieldTrip] Problems plotting TFR map In-Reply-To: References: Message-ID: <51409C4B.7040408@donders.ru.nl> Dear Ingenieur Eniso, I'm sorry, but I don't follow. You wrote that you were "using fieldtrip-20130101 and Matlab 7.10" and got the error, but it worked "on the same system using version fieldtrip-20130101", so with what version did it crash and with what version did it work? In any case, could you please try whether the error persists with the latest version (20130312)? If the error persists, it would be of great for us to know how you preprocessed the data and how you are calling the topoplot function. I'm in particular even more confused, because the function you are calling should be named ft_topoplotER or ft_topoplotTFR and not just 'topoplot'. Could you try using one of these functions instead? Best, Jörn On 3/13/2013 4:01 PM, ingenieur eniso wrote: > I am using fieldtrip-20130101 and Matlab 7.10.I have a problem when I try to plot TFR map. > The error message I receive is: > ??? Error using ==> griddata at 53 > > > X and Y must be same length as Z or the lengths > of X and Y must match the size of Z. > > Error in ==> topoplot at 463 > [Xi,Yi,Zi] = griddata(x', y, data, xi', yi, cfg.interpolation); % Interpolate the topographic data > > > Error in ==> lecture at 65 > [handle]=topoplot(cfg, meanfft) > meanfft is a vector containing the average of thespectralpower of each electrode. > > > > I have all the electrode locations loaded and the same command works on the same system using versionfieldtrip-20130101. > > Thanks for your help, > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.maye at uke.de Wed Mar 13 17:07:06 2013 From: a.maye at uke.de (Alexander Maye) Date: Wed, 13 Mar 2013 17:07:06 +0100 Subject: [FieldTrip] Bug in ft_freqcomparison.m? Message-ID: <2555427.KrVFfpLWZt@mars.neurophys.uke.uni-hamburg.de> Hi All, I just spotted something that could be a bug in ft_freqcomparison.m (fieldtrip-20130312 and previous versions). Don't now if this is the place for report, but if this really is an issue everyone using this function may be interested. The problem is in line 87 where freq = varargin{1}; is initialized to the *first* freq argument, that according to the doc is used as the norm. So the output (powspctrm) has the dimension of the norm, not the second freq argument, that one wants to become normalized. Strange, hmm? Then, in the following for-loops the index variable runs over the size of the *second* freq argument, updating trials in the powspctrm with the size of the *first* freq argument, which seems simply wrong. Maybe this is an ingenious programming trick, but initializing freq = varargin{2}; on line 87 would make more sense from my point of view. Best, ALEX. -------------- next part -------------- -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Mar 13 23:26:12 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 13 Mar 2013 23:26:12 +0100 Subject: [FieldTrip] Problems reading in DICOM In-Reply-To: <51407D7B.4070005@donders.ru.nl> References: <74308a1f1ca78.51405ed9@uni-duesseldorf.de> <51407D7B.4070005@donders.ru.nl> Message-ID: <985C7F60-4B5F-4E16-B504-437C9095CBEF@donders.ru.nl> Hi DICOM files come with different extensions. I guess it depends on the scanner (Siemens/Philips/...). But the file format should be the same as it is a standard format, so the extension should not matter. The fileio/ft_filetype.m function detects both dcm and ima files as dicom. if the files have no extension, the autodetection fails and you should explicitly specify the format as mri = ft_read_mri('single_file_of_DICOM_series', 'format', 'dicom'); I now realize that to be a hidden option. I'll get that fixed in the function documentation. I recommend that you specify a filename from somewhere in the middle of the stack of files. There are often a few localizer scans in the same directory, and these (due to the sorting of the file names) tend to end up at the beginning or end of the (alphabetical) directory listing. cheers Robert On 13 Mar 2013, at 14:22, Jörn M. Horschig wrote: > Hi Markus, > > I kept on avoiding these errors by using MRIcron's dcm2nii functionality: http://www.mccauslandcenter.sc.edu/mricro/mricron/index.html > But pay attention to the coordinate system when importing it into FieldTrip afterwards, it can be quite a hassle... > > Maybe Robert or JM know whether reading in .dcm files is possible, but I have to admit that I never tried ;) > > Best, > Jörn > > On 3/13/2013 12:11 PM, Markus Butz wrote: >> Dear list, >> >> I am experiencing problems reading in external MRI in DICOM format from a CD (doing it the first time though). >> I wanted to do it the new and easy way as described here: >> http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_an_anatomical_mri_from_dicom_into_ctf_format?s[]=dicom >> >> % read the DICOM files >> mri = ft_read_mri('single_file_of_DICOM_series.IMA'); >> >> However, I have no single slices with extension *.ima but one dataset with the extension *.dcm and the other dataset with no extension for the single slice files. I am also not sure where to copy the DICOMDIR file. >> >> When I try to open a single file of the *.dcm series I get: >> >> mri = ft_read_mri('508652C3.dcm'); >> >> ??? Undefined function or variable "hdr". >> >> Error in ==> ft_read_mri at 216 >> hdr = hdr(keep); >> >> Trying to read in a single file of the no extension series I get: >> >> mri = ft_read_mri('73850486'); >> >> ??? Error using ==> dicominfo at 41 >> The specified file is not in DICOM format >> >> The Image Processing toolbox V 7.2 is installed and this is fieldtrip-20111101. >> >> Any help appreciated! >> >> Markus >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Thu Mar 14 00:09:05 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 13 Mar 2013 23:09:05 +0000 Subject: [FieldTrip] 64 channel ActiCap sensor locations Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, Do anyone of you have the sensor location file for a 64 channel ActiCap (Brain products GmbH)? If so can you please share it with me or give me a hint where I can get one from. Thank you. Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From mengtongxiao at gmail.com Thu Mar 14 03:36:20 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Thu, 14 Mar 2013 10:36:20 +0800 Subject: [FieldTrip] How do I select ROIs Message-ID: Dear all, I want do source level connectivity.I use the template,I want to konw where is the field that I want. For example, I want find Language area.How do I find the coordinates of the location of its corresponding template. Or there have some .mat file about listing the border of each region. How can I do? thanks, Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Mar 14 08:50:01 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Mar 2013 08:50:01 +0100 Subject: [FieldTrip] How do I select ROIs In-Reply-To: References: Message-ID: Dear Xiao, You might want to have a look at this FAQ: http://fieldtrip.fcdonders.nl/faq/how_can_i_determine_the_anatomical_label_of_a_source If it does not work, or if that does not help you, please feel free to ask again of course! Best, Eelke On 14 March 2013 03:36, 陈雪 wrote: > Dear all, > > I want do source level connectivity.I use the template,I want to > konw where is the field that I want. > For example, I want find Language area.How do I find the coordinates > of the location of its corresponding template. > Or there have some .mat file about listing the border of each > region. > How can I do? > > thanks, > Xiao > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From irina.simanova at mpi.nl Thu Mar 14 11:13:48 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Thu, 14 Mar 2013 11:13:48 +0100 Subject: [FieldTrip] 64 channel ActiCap sensor locations In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> References: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> Message-ID: <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> Dear Imali, Check out this page: http://fieldtrip.fcdonders.nl/template/layout There are two template layouts for a 64 channel ActiCap available in Fieldtrip. The electrode positions are the same, but the order of channels is different. If none of these channel orders matches the one you have in your ActiCap, you can create a layout yourself with ft_prepare_layout. See http://fieldtrip.fcdonders.nl/tutorial/layout best, Irina On Mar 14, 2013, at 12:09 AM 3/14/13, IMALI THANUJA HETTIARACHCHI wrote: > Dear Fieldtrippers, > > Do anyone of you have the sensor location file for a 64 channel > ActiCap (Brain products GmbH)? > > If so can you please share it with me or give me a hint where I can > get one from. > > Thank you. > Kind regards > Imali > > Imali Thanuja Hettiarachchi > PhD Candidate > Centre for Intelligent Systems research > Deakin University, Geelong 3217, Australia. > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Thu Mar 14 12:44:51 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 14 Mar 2013 11:44:51 +0000 Subject: [FieldTrip] Statistical Parametric Mapping for MEG/EEG 2013 course Message-ID: Dear colleagues, We are happy to advertise the 2013 Statistical Parametric Mapping for MEG/EEG course presented by the Wellcome Trust Centre for Neuroimaging. The course will take place on Monday 13th May –Wednesday 15th May 2013 at the Wellcome Trust Centre for Neuroimaging in London. This course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course will cover (1) data pre-processing, (2) statistical analysis of sensor-space maps using GLMs and Random Field theory, (3) source reconstruction and (4) Dynamic Causal Modelling for EEG/MEG. The course will be followed by the long-established three-day course on ‘SPM for fMRI’ so it is possible to attend both courses. The course is suitable for beginners and more advanced users. We advise students to gain at least minimal familiarity with the methodology, for example, from reading the paper available at http://www.hindawi.com/journals/cin/2011/852961/ and other introductory articles listed at the SPM website or by following data analysis examples in the SPM manual. Video lectures from the 2012 course are available at http://www.fil.ion.ucl.ac.uk/spm/course/video/#MEEG For the practical part of the course please bring a laptop that can run Matlab (7.4 or later, no toolboxes are required) and is powerful enough to analyse your data (64-bit OS is highly recommended). The detailed schedule and booking forms can be found at http://www.ion.ucl.ac.uk/articles/events/SPM . For further details and registration please contact Jean Reynolds (jean.reynolds at ucl.ac.uk). With best wishes, Vladimir Litvak Ph.D. Lecturer Wellcome Trust Centre for Neuroimaging -------------------------------------------------------------------------------------------------- SPM (http://www.fil.ion.ucl.ac.uk/spm/) is free and open source software written in MATLAB (The MathWorks, Inc.). In addition to standard M/EEG pre-processing, we presently offer three main analysis tools: (i) statistical analysis of scalp-maps, time-frequency images and volumetric 3D source reconstruction images based on the general linear model, with correction for multiple comparisons using random field theory; (ii) Bayesian M/EEG source reconstruction, including support for group studies, simultaneous EEG and MEG, and fMRI priors; (iii) Dynamic Causal Modelling (DCM), an approach combining neural modelling with data analysis for which there are several variants dealing with evoked responses, steady state responses (power spectra and cross-spectra), induced responses and phase coupling. SPM is integrated with the FieldTrip toolbox (http://fieldtrip.fcdonders.nl/), making it possible for users to combine a variety of standard analysis methods with new schemes implemented in SPM and build custom analysis tools using powerful graphical user interface (GUI) and batching tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Thu Mar 14 13:09:24 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 14 Mar 2013 13:09:24 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <1070910925.63690.1363262912932.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <34843150.63726.1363262964484.JavaMail.root@indus.zimbra.ru.nl> Hi guys and girls, I can't get my subscription to the list working. It probably has to do with the account that underlies my email-address stan.vanpelt at donders.ru.nl . I thought that was s.vanpelt at fcdonders.ru.nl , but if I subscribe using that email-address, it still doesn't work. Hope you can help me out! best, Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Thu Mar 14 14:10:56 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 14 Mar 2013 14:10:56 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <58508409.66135.1363265587310.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Second attempt, with the actual question :) Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. Best, Stan -- Stan van Pelt, PhD Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Phone: +49 (0)69 96769 517 Fax: +49 (0)69 96769 555 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Mar 14 14:20:54 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 14 Mar 2013 14:20:54 +0100 Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> References: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <0A626AF9-5C8A-4B18-A135-028509BCFDB6@gmail.com> Hi Stan, you have to specify the surface template. I think it's using cfg.surffile or something like that. There is a separate one for the left and the right hemisphere. Good Luck Julian Am 14.03.2013 um 14:10 schrieb Pelt, S. van (Stan): > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. > > Best, > Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Mar 14 14:48:52 2013 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 14 Mar 2013 14:48:52 +0100 Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> References: <666247331.67099.1363266656262.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <81A04E2A-2DF8-4B7B-91B1-A66D39D05597@uni-konstanz.de> Dear Stan, would you specify cfg.surffile = 'surface_14_left.mat'; and see if it works? cheers tzvetan > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each hemisphere seperately? There doesn't seem to be an configuration option for that in ft_sourceplot, and I wonder if it is possible at all. > > Best, > Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ******************************************* Tzvetan Popov Clinical Psychology University of Konstanz Box 23 78457 Konstanz, GERMANY Phone: 0049-7531-883086 Fax: 0049-7531-884601 Email: tzvetan.popov at uni-konstanz.de ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Thu Mar 14 20:41:27 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Thu, 14 Mar 2013 15:41:27 -0400 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI Message-ID: Hello fieldtrippers! I would like to calculate wPLI (weighted phase lag index) for two time-series (created by a beamformer). It's described here: http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli What do *repetitions *mean in input argument for the function? I have the data in a text or Excel format that I could import into Matlab directly: 1st column is time, 2nd column is 1st source intensities and 3rd column is 2nd source intensities. Assuming I get my input data in the correct format, is this a correct line to call the function (I need a debiased wPLI)? [wpi, v, n] = ft_connectivity_wpli(input, debias 1) Thanks, Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Mar 14 21:22:19 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 14 Mar 2013 21:22:19 +0100 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI In-Reply-To: References: Message-ID: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> Hi inna, never used this method, but repetitions means you need single trials (it's not an averaged time-series you are talking about, right?). here some suggestions: when importing your data from Excel (how did that happen? :-)) into matlab, make a data structure that looks like one following ft_preprocessing. then run ft_freqanalysis with output "powandcsd" and keeptrials "yes" as options (and other options of course). this is at least what i assume after looking ft_connectivityanalysis then enter the structure which results from your former step into ft_connectivityanalysis with method specified as "wpli_debiased" perhaps wpli-experts want to correct me if i got something wrong. good luck, n On 14.03.2013, at 20:41, McGowin, Inna wrote: > Hello fieldtrippers! > > I would like to calculate wPLI (weighted phase lag index) for two time-series (created by a beamformer). > It's described here: http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli > What do repetitions mean in input argument for the function? > > I have the data in a text or Excel format that I could import into Matlab directly: > 1st column is time, > 2nd column is 1st source intensities and > 3rd column is 2nd source intensities. > > Assuming I get my input data in the correct format, is this a correct line to call the function (I need a debiased wPLI)? > [wpi, v, n] = ft_connectivity_wpli(input, debias 1) > > > Thanks, > Inna > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Mar 15 00:17:54 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 14 Mar 2013 19:17:54 -0400 Subject: [FieldTrip] Inner matrix mismatch in source interpolate Message-ID: Hi Fieldtrippers, When running ft source interpolate on my CTF MEG data, I get an error where it reaches line 237; tmp = interpmat*tmp. The error is an inner matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 matrix of power at the leaderfield coordinates. If this is just matrix math, then I assume the problem is just that the matrix have to be mxn and nxp. Is there any reason I cannot just use tmp=tmp' to make the inner dimensions match? Cheers Russ ---------- Forwarded message ---------- From: Russell G Port Date: Sat, Mar 9, 2013 at 8:38 PM Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree To: FieldTrip discussion list Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: *People can skip the first part of code, I included it as possibly useful information for this plead * %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); *Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition* %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; *Heres where it falls apart, because I try to source interpolate* %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with the current problem * cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos *(position of the leadfield locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), 'sphereradius', cfg.sphereradius) (0.*05*); what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata*. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Fri Mar 15 00:41:49 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 14 Mar 2013 23:41:49 +0000 Subject: [FieldTrip] 64 channel ActiCap sensor locations In-Reply-To: <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> References: <5A1787011651BC42A4D41856DBC2E0607BFCE84B@mbox-f-3.du.deakin.edu.au> <3808B98A-FC4E-4EBB-863D-464AAF6590BF@mpi.nl> Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCE991@mbox-f-3.du.deakin.edu.au> Dear Irina, Thank you very much for the reply. Actually I did use the layout files and used them already for plotting, but I need to do a source reconstruction from the data, so for that I need the 3D sensor positions, not the 2D layout. I do not think I can use a 2D layout with ft_read_sens. Could you please help me on how I can find the 3D locations? Thanks again. Kind regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Irina Simanova Sent: Thursday, 14 March 2013 9:14 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] 64 channel ActiCap sensor locations Dear Imali, Check out this page: http://fieldtrip.fcdonders.nl/template/layout There are two template layouts for a 64 channel ActiCap available in Fieldtrip. The electrode positions are the same, but the order of channels is different. If none of these channel orders matches the one you have in your ActiCap, you can create a layout yourself with ft_prepare_layout. See http://fieldtrip.fcdonders.nl/tutorial/layout best, Irina On Mar 14, 2013, at 12:09 AM 3/14/13, IMALI THANUJA HETTIARACHCHI wrote: Dear Fieldtrippers, Do anyone of you have the sensor location file for a 64 channel ActiCap (Brain products GmbH)? If so can you please share it with me or give me a hint where I can get one from. Thank you. Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Fri Mar 15 10:01:07 2013 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Fri, 15 Mar 2013 10:01:07 +0100 (CET) Subject: [FieldTrip] Inner matrix mismatch in source interpolate In-Reply-To: References: Message-ID: <000801ce215b$9feddeb0$dfc99c10$@herring@fcdonders.ru.nl> Hi Russ, I ran into a similar error which was avoided by following the steps in the extended beamformer tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformingextended). The problem seems to rather be that ft_sourceinterpolate wrongly detects your functional data as being 2 dimensional (if I remember correctly) because a .dim field is not present. I did not have the time yet to find-out if it is a problem with the other beamformer tutorial or an actual bug. In any case, if I compare the steps in the extended beamformer tutorial with the steps you took I noticed that in the extended beamformer tutorial a sourcemodel (ft_prepare_sourcemodel) is calculated after calculating the headmodel, which is then used to calculate the leadfield (ft_prepare_leadfield), followed by using this leadfield in ft_sourceanalysis. Could you try and see if that works? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Russell G Port Sent: vrijdag 15 maart 2013 0:18 To: FieldTrip discussion list Subject: [FieldTrip] Inner matrix mismatch in source interpolate Hi Fieldtrippers, When running ft source interpolate on my CTF MEG data, I get an error where it reaches line 237; tmp = interpmat*tmp. The error is an inner matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 matrix of power at the leaderfield coordinates. If this is just matrix math, then I assume the problem is just that the matrix have to be mxn and nxp. Is there any reason I cannot just use tmp=tmp' to make the inner dimensions match? Cheers Russ ---------- Forwarded message ---------- From: Russell G Port Date: Sat, Mar 9, 2013 at 8:38 PM Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree To: FieldTrip discussion list Hi Fieldtrippers, I have a slight issue that I was hoping someone can help with. I have some CTF data, that I was trying to perform DICS beamforming and then source interpolation on. I am trying to beamform to the source of gamma frequency in the right hemisphere, comparing pre and post stimuli. Heres the basic script: People can skip the first part of code, I included it as possibly useful information for this plead %%%%% Data has already been preprocessed and timelocked%%%%%% load('processed_data_500Hz.mat') load('timelock_data_500Hz.mat') %%%% following the beamforming tutorial %%%%%%% %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% cfg = []; cfg.toilim = baseline; cfg.channel=channel total_bsl = ft_redefinetrial(cfg, data); cfg = []; cfg.toilim = interest; cfg.channel=channel total_interest = ft_redefinetrial(cfg, data); cfg = []; total_cmb = ft_appenddata(cfg, total_bsl, total_interest); total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); ones(length(total_interest.trial), 1)]; %%%%%%%%%%%%%cross spectrial density for dics and tf for common filter%%%%%%%%%%%%%% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPre_total = ft_freqanalysis(cfg, total_bsl); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqPost_total = ft_freqanalysis(cfg, total_interest); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 25; cfg.foilim = 55; freqALL_total = ft_freqanalysis(cfg, total_cmb); %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% % T=ft_read_mri('R128_V2.mri') cfg.fiducial.nas = T.hdr.fiducial.mri.nas cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa cfg.method = 'fiducial' cfg.coordsys = 'ctf' [mri] = ft_volumerealign(cfg, T) cfg = []; cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, see below segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; hdm = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); %%%%%%%%%%%%%%% cfg = []; cfg.grad = freqPost_total.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = 'MR' [grid] = ft_prepare_leadfield(cfg); Upto this point everything works. My volume conduction model, grads, and grid looks good when verified visually... I then compute the common filter and apply it to the beamforming of each condition %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% cfg = []; cfg.method = 'dics'; cfg.grad = freqALL_total.grad; cfg.keeptrials = 'yes'; cfg.frequency = freqALL_total.freq; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; cfg.channel = 'MR' sourceAll = ft_sourceanalysis(cfg, freqALL_total); %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% cfg.grid.filter = sourceAll.avg.filter; cfg.grid = grid; sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% sourceDiff = sourcePost_con; sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ sourcePre_con.avg.pow; Heres where it falls apart, because I try to source interpolate %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% % slicemri = ft_volumereslice([], mri); % % mri = ft_volumereslice([],segmentedmri) %% didnt appear to help with the current problem cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; cfg.coordsys = 'ctf'; cfg.channel = 'MR' source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also tried segmentedmri, but no difference It works until it reachs line 237; tmp = interpmat*tmp; where there is the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp is sourceDiff.avg.pow (the power difference for each leadfield point). interpmat is the interpolation matrix return by interpmat = interp_ungridded(functional.pos (position of the leadfield locations), pos (mri voxels), 'projmethod', cfg.interpmethod (nearest), 'sphereradius', cfg.sphereradius) (0.05); what I get out of this is a 16777216(256x256x256 voxels) x642 (leadfield position) matrix. it then undergoes interpmat(~anatomical.inside(:), :) = 0. My anatomical.inside is all voxels (all of the 256 x 256 x 256 matrix= 1), as a result of the defaults in ft_checkdata. When I try to find the minimum value in this matrix I get (via min(interpmat) = All zero sparse: 1-by-642 I think what is supposed to happen is that the interpmat is a matrix that relates meg to mri space, and as such then mutlipling with a vector that represents the power in meg space, I can see how that would get points of power in mri space. Though this must be wrong since the math is not allowed.... I cannot see where I went off the beaten track. It seems as if other people have not had this problem. Sorry for the bother, Russ Port Graduate Student @ Upenn P.S. thanks to anyone who tries to help in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at fcdonders.ru.nl Fri Mar 15 10:29:07 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 15 Mar 2013 10:29:07 +0100 (CET) Subject: [FieldTrip] Single hemisphere surfaceplot In-Reply-To: <81A04E2A-2DF8-4B7B-91B1-A66D39D05597@uni-konstanz.de> Message-ID: <265882854.85608.1363339747061.JavaMail.root@indus.zimbra.ru.nl> Thanks a lot for all your input, changing the surffile did the trick. ----- Oorspronkelijk bericht ----- > Van: "Tzvetan Popov" > Aan: "FieldTrip discussion list" > Verzonden: Donderdag 14 maart 2013 14:48:52 > Onderwerp: Re: [FieldTrip] Single hemisphere surfaceplot > Dear Stan, > would you specify cfg.surffile = 'surface_14_left.mat'; and see if it > works? > cheers > tzvetan > > Second attempt, with the actual question :) > > Is it possible to make a surfaceplot of source activity for each > > hemisphere seperately? There doesn't seem to be an configuration > > option for that in ft_sourceplot, and I wonder if it is possible at > > all. > > Best, > > Stan > > -- > > Stan van Pelt, PhD > > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for > > Neuroscience > > in Cooperation with Max Planck Society > > Deutschordenstr. 46, D-60528 Frankfurt > > Phone: +49 (0)69 96769 517 > > Fax: +49 (0)69 96769 555 > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > ******************************************* > Tzvetan Popov > Clinical Psychology > University of Konstanz > Box 23 > 78457 Konstanz, GERMANY > Phone: 0049-7531-883086 > Fax: 0049-7531-884601 > Email: tzvetan.popov at uni-konstanz.de > ******************************************* > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Fri Mar 15 16:32:21 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Fri, 15 Mar 2013 11:32:21 -0400 Subject: [FieldTrip] Smoothing for Time Frequency plots Message-ID: <2586A1048152BE4D861E64A98700AD420D5FFE3B@nki-mail.NKI.rfmh.org> Hi, I've been using the ft_singleplotTFR function to plot some TFR data I imported from BESA, and the plots are accurate, but very pixelated. I was wondering if anyone had any experience smoothing or interpolating data to make nicer looking plots? Thanks, -Michael ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Fri Mar 15 23:07:37 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Fri, 15 Mar 2013 22:07:37 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model Message-ID: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 From hamid.mohseni at eng.ox.ac.uk Sat Mar 16 16:27:30 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 16 Mar 2013 15:27:30 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: Message-ID: Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran wrote: > Hello FieldTrip users, > > I am having trouble aligning volume conduction model with source model > > The link to the data is > https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi > > Here are the steps I followed > > % Read mri > mri = ft_read_mri('T1.mgz'); > > % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s > and origin as i. At the end mri.coordsys was equal to 'neuromag' > mri = ft_determine_coordsys(mri); > > % Align volume. Selected l, r, l and z in + z direction > cfg=[]; > cfg.coordsys='neuromag'; > mri = ft_volumerealign(cfg,mri); > > %Volume segment > cfg=[]; > cfg.coordsys='neuromag'; > cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; > seg = ft_volumesegment(cfg, mri); > > % Prepare head model. The model aligns well with sensors > cfg=[]; > cfg.coordsys='neuromag'; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > % compute sourcespace > bnd = > ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); > T = mri.transform*inv(mri.transformorig); > sourcespace = ft_transform_geometry(T, bnd); > > % Plot > figure;hold on; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > > > > These surfaces do not align. Any ideas? > > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Sat Mar 16 17:10:09 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Sat, 16 Mar 2013 16:10:09 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , Message-ID: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamid.mohseni at eng.ox.ac.uk Sat Mar 16 17:46:39 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Sat, 16 Mar 2013 16:46:39 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: Message-ID: If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" wrote: > Hi Hamid, > Thanks for the reply. I see what you mean. > When I import the T1, there is a mri.transform already present in it. This > is generated by the freesurfer. mri.tranform gets changed when I do the > ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , > nas as n and z in the positive z direction. I have vitamin pills at the > fiducials ( some also at the forehead) that would help in marking the > points. > > I cannot figure out where am I messing up. Also I am using the src file > in MNE and I do not have this issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > *Sent:* Saturday, March 16, 2013 11:28 AM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Hi, > > I THINK there is a problem with your mri.transform matrix. Basically, > without any pre-processing, when you apply this transformation to the > headshape points 'bnd', it should match the original mri. I checked that > and apparently it dosen't happen. How did you obtain this transformation? > > Thanks > > > > On 15 March 2013 22:07, Doshi, Chiran wrote: > >> Hello FieldTrip users, >> >> I am having trouble aligning volume conduction model with source model >> >> The link to the data is >> https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi >> >> Here are the steps I followed >> >> % Read mri >> mri = ft_read_mri('T1.mgz'); >> >> % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as >> s and origin as i. At the end mri.coordsys was equal to 'neuromag' >> mri = ft_determine_coordsys(mri); >> >> % Align volume. Selected l, r, l and z in + z direction >> cfg=[]; >> cfg.coordsys='neuromag'; >> mri = ft_volumerealign(cfg,mri); >> >> %Volume segment >> cfg=[]; >> cfg.coordsys='neuromag'; >> cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; >> seg = ft_volumesegment(cfg, mri); >> >> % Prepare head model. The model aligns well with sensors >> cfg=[]; >> cfg.coordsys='neuromag'; >> cfg.method = 'singleshell'; >> vol = ft_prepare_headmodel(cfg, seg); >> >> % compute sourcespace >> bnd = >> ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); >> T = mri.transform*inv(mri.transformorig); >> sourcespace = ft_transform_geometry(T, bnd); >> >> % Plot >> figure;hold on; >> ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight >> ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; >> >> >> >> These surfaces do not align. Any ideas? >> >> >> >> Chiran Doshi, MS >> MEG system technologist >> Department of Neurology >> Boston Childrens Hospital >> Phone: 781-216-1136 >> Fax: 781-216-1172 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Mon Mar 18 14:41:19 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Mon, 18 Mar 2013 13:41:19 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , Message-ID: Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" > wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mcgoiv0 at wfu.edu Mon Mar 18 15:25:39 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 18 Mar 2013 10:25:39 -0400 Subject: [FieldTrip] FT_CONNECTIVITY_WPLI In-Reply-To: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> References: <3BB2F42C-8D8D-49D7-B4AB-14AD8DF9E103@mac.com> Message-ID: Thanks Nathan! Sorry I am not a frequent FieldTrip user and not sure how a data stutructure should look like after ft_preprocessing. I have two time-series for two virtual electrodes; the time-series were calculated by CTF SAM (synthetic aperture magnetometry), and then extracted and converted into a text file (and Excel if needed). Now I want to use the weighted Phase Lag Index (wPLI) and compare these two time-series for any coupling. My understanding is that the input for this function should be a cross-spertal density matrix? I tried to follow the steps you suggested with the CTF dataset that includes both the original data and the two time-series but got stuck on ft-freqanalysis as it requires lots of inputs I am not knowledgeable about, plus it still works with the whole dataset instead of just two time-series that I am interested in. Is there a short-cut for CTF SAM output dataset? Thanks! Inna On Thu, Mar 14, 2013 at 4:22 PM, Nathan Weisz wrote: > Hi inna, > > never used this method, but repetitions means you need single trials (it's > not an averaged time-series you are talking about, right?). > > here some suggestions: > > - when importing your data from Excel (how did that happen? :-)) into > matlab, make a data structure that looks like one following > ft_preprocessing. > - then run ft_freqanalysis with output "powandcsd" and keeptrials > "yes" as options (and other options of course). this is at least what i > assume after looking ft_connectivityanalysis > - then enter the structure which results from your former step into > ft_connectivityanalysis with method specified as "wpli_debiased" > > perhaps wpli-experts want to correct me if i got something wrong. > > good luck, > n > > > > > On 14.03.2013, at 20:41, McGowin, Inna wrote: > > Hello fieldtrippers! > > I would like to calculate wPLI (weighted phase lag index) for two > time-series (created by a beamformer). > It's described here: > http://fieldtrip.fcdonders.nl/reference/ft_connectivity_wpli > What do *repetitions *mean in input argument for the function? > > I have the data in a text or Excel format that I could import into Matlab > directly: > 1st column is time, > 2nd column is 1st source intensities and > 3rd column is 2nd source intensities. > > Assuming I get my input data in the correct format, is this a correct line > to call the function (I need a debiased wPLI)? > > [wpi, v, n] = ft_connectivity_wpli(input, debias 1) > > Thanks, > > Inna > _______________________________________________ > 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 > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Mon Mar 18 16:09:45 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Mon, 18 Mar 2013 11:09:45 -0400 Subject: [FieldTrip] fieldtrip2eeglab Message-ID: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Hello all, I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing list, but I can't actually find it. Does anyone have a copy or know where I should look? -Michael ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Mar 18 16:19:41 2013 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 18 Mar 2013 16:19:41 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> Hi Michael, I have a version, but it seems quite old and I have never actually used it. Maybe it's of any help to you. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 18.03.2013 um 16:09 schrieb Epstein, Michael: > Hello all, > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing list, but I can't actually find it. Does anyone have a copy or know where I should look? > > -Michael > > Conserve Resources. Print only when necessary. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip2eeglab.m Type: application/octet-stream Size: 1094 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEpstein at NKI.RFMH.ORG Mon Mar 18 16:26:24 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Mon, 18 Mar 2013 11:26:24 -0400 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> <822CB7F4-F255-4963-B468-C2B8162107C4@gmail.com> Message-ID: <2586A1048152BE4D861E64A98700AD420D600042@nki-mail.NKI.rfmh.org> Doesn't work for me, but it gives me something to start with - thank you. -Michael From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Julian Keil Sent: Monday, March 18, 2013 11:20 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] fieldtrip2eeglab Hi Michael, I have a version, but it seems quite old and I have never actually used it. Maybe it's of any help to you. Best, Julian ________________________________ Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privileged or otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Mar 18 16:47:39 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 18 Mar 2013 16:47:39 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: Dear Michael, Perhaps you can find it within EEGlab code? FieldTrip usually includes the *2fieldtrip functions but not the fieldtrip2* functions. Best, Johanna 2013/3/18 Epstein, Michael : > Hello all, > > > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki > (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the mailing > list, but I can't actually find it. Does anyone have a copy or know where I > should look? > > > > -Michael > > ________________________________ > Conserve Resources. Print only when necessary. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > recipient. It may contain confidential information which is legally > privilegedor otherwise protected by law. If you received this e-mail in > error or from someone who is not authorized to send it to you, you are > strictly prohibited from reviewing, using, disseminating, distributing or > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > cooperation. > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > recipient. It may contain confidential information which is legally > privileged or otherwise protected by law. If you received this e-mail in > error or from someone who is not authorized to send it to you, you are > strictly prohibited from reviewing, using, disseminating, distributing or > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > cooperation. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From singhharsimrat at gmail.com Mon Mar 18 17:50:56 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 18 Mar 2013 16:50:56 +0000 Subject: [FieldTrip] mytrialfun & ft_read_event Message-ID: Hi All**** ** ** I am trying to read in my data in which the first channel contains the marker signal (spike) superimposed on the trigger channel.**** I would like to use mytrialfun before ft_definetrial. To do this I would like to check the value of the marker channel and compare it with mean value of the channel and record that value in the even field.**** But I guess I can’t do it as the fieldtrip doesn’t read the channel values before ft_definetrial. Can I use data channel values in mytrialfun? If not, is there a way around this?**** ** ** Here is my trialfun**** ** ** function [trl, event] = mytrialfun(cfg)**** ** ** % read the header information and the events from the data**** hdr = ft_read_header(cfg.datafile);**** event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, 'detectflank','up');**** ** ** % search for "trigger" events according to 'trigchannel' defined outside the function The problem lies here ** *value = [event(find(cfg.trialdef.trigchannel (it needs data of this channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); ** ** % creating your own trialdefinition based upon the events**** for j = 1:length(value);**** trlbegin = sample(j) + pretrig;**** trlend = sample(j) + posttrig;**** offset = pretrig;**** newtrl = [ trlbegin trlend offset];**** trl = [ trl; newtrl]; **** end**** ** ** ** ** Thanks in advance**** Best regards**** Harsimrat**** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.schubert at uni-hamburg.de Mon Mar 18 18:14:40 2013 From: jonathan.schubert at uni-hamburg.de (Jonathan Schubert) Date: Mon, 18 Mar 2013 18:14:40 +0100 Subject: [FieldTrip] fieldtrip2eeglab In-Reply-To: References: <2586A1048152BE4D861E64A98700AD420D60002B@nki-mail.NKI.rfmh.org> Message-ID: Dear Micheal, Johanna seems to be right about the EEGLAB code. There is a function called fieldtripchan2eeglab in the eeglab toolbox. Never tried it before though. Hope that helps. Best, Jonathan 2013/3/18 Johanna Zumer > Dear Michael, > > Perhaps you can find it within EEGlab code? FieldTrip usually > includes the *2fieldtrip functions but not the fieldtrip2* functions. > > Best, > Johanna > > 2013/3/18 Epstein, Michael : > > Hello all, > > > > > > > > I'm looking for the fieldtrip2eeglab function. It's mentioned in the wiki > > (http://fieldtrip.fcdonders.nl/integrating_with_eeglab) and in the > mailing > > list, but I can't actually find it. Does anyone have a copy or know > where I > > should look? > > > > > > > > -Michael > > > > ________________________________ > > Conserve Resources. Print only when necessary. > > > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > > recipient. It may contain confidential information which is legally > > privilegedor otherwise protected by law. If you received this e-mail in > > error or from someone who is not authorized to send it to you, you are > > strictly prohibited from reviewing, using, disseminating, distributing or > > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > > cooperation. > > > > IMPORTANT NOTICE: This e-mail is meant only for the use of the intended > > recipient. It may contain confidential information which is legally > > privileged or otherwise protected by law. If you received this e-mail in > > error or from someone who is not authorized to send it to you, you are > > strictly prohibited from reviewing, using, disseminating, distributing or > > copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN > > E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your > > cooperation. > > > > _______________________________________________ > > 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 > -- Jonathan Schubert, Dipl.-Psych. University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11, Room 301 D-20146 Hamburg Germany - Phone: (49) 40 - 42838 7626 Fax: (49) 40 - 42838 6591 jonathan.schubert at uni-hamburg.de www.bpn.uni-hamburg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstolzbe at uwo.ca Mon Mar 18 19:18:11 2013 From: dstolzbe at uwo.ca (Daniel Stolzberg) Date: Mon, 18 Mar 2013 14:18:11 -0400 Subject: [FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints Message-ID: Hello, I have been working with continuous data trials which begin before the trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when using ft_singleplotER. The error occurs in the raw2timelock subfunction of ft_checkdata after calling ft_singleplotER with a time axis that includes pre-trigger (i.e. < 0) time points. This error may not be for ft_singleplotER, but it is the function I was trying to use. Here is the error: > Subscripted assignment dimension mismatch. > > Error in ft_checkdata>raw2timelock (line 1753) > tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i}; > > Error in ft_checkdata (line 302) > data = raw2timelock(data); > > Error in ft_singleplotER (line 186) > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', 'freq'}); After some debugging, I found that the number of samples used to (re)generate the time vector is always 1 sample too small if there are negative time values. I assume that this is because the time point 0 is not being considered (?). By adding the following line to raw2timelock in ft_checkdata of the most recent build, I was able to get around any errors in this subfunction and all is now copacetic: line 1740: nsmp = nsmp + any(time<0); % <--- acounting for timepoint at 0? I don't know if anyone else has run into this problem but I thought I would share this with the community. Regards, Dan -- Daniel Stolzberg, PhD Post-doctoral Fellow Cerebral Systems Laboratory Department of Physiology and Pharmacology Schulich School of Medicine & Dentistry University of Western Ontario http://www.cerebralsystems.ca/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 19 08:17:49 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 19 Mar 2013 08:17:49 +0100 Subject: [FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints In-Reply-To: References: Message-ID: <5148111D.2010902@donders.ru.nl> HI Daniel, thanks for reporting this. Strange error... but it should not be related to having timepoint before 0. The fix of the time-axis in raw2timelock was implemented because of numerical inaccuracies that can occur across trials. For example, some trials might start at -0.24999 others at -0.25 (this can happen during acquisition or during resampling, etc., also computers make errors, especially when dealing with decimals). When computing a common time-axis, Matlab would compare these two values and treat them as two samples before 0 rather than 1 (which strictly speaking is true). So a common time-axis needs to be build, which is invariant to small differences. Unfortunately, that was not very trivial to accomplish. I've build a test scripts which tests very many different cases for which this function works fine. So first, just to be sure, are you using the most recent version of FieldTrip? Most colleagues in our group including myself are interested in the prestimulus period, so if this was a trivial error, we probably would have found it long time ago ;) However, it might be that it indeed breaks with your data nonetheless due to some reason. Since this might be specific to some few datasets, it would be great if you could send me a snippet of your data (like one or two trials) together with some lines of code to reproduce this error. It is quite nasty to debug this stuff, so in order to not keep you from doing research, just go ahead with the fix you implemented for this one dataset, but be aware that I am pretty sure that it will break for other datasets ;) Best regards, Jörn On 3/18/2013 7:18 PM, Daniel Stolzberg wrote: > Hello, > > I have been working with continuous data trials which begin before the > trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when > using ft_singleplotER. The error occurs in the raw2timelock > subfunction of ft_checkdata after calling ft_singleplotER with a time > axis that includes pre-trigger (i.e. < 0) time points. This error may > not be for ft_singleplotER, but it is the function I was trying to use. > > Here is the error: > > Subscripted assignment dimension mismatch. > > > > Error in ft_checkdata>raw2timelock (line 1753) > > tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i}; > > > > Error in ft_checkdata (line 302) > > data = raw2timelock(data); > > > > Error in ft_singleplotER (line 186) > > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', > 'freq'}); > > After some debugging, I found that the number of samples used to > (re)generate the time vector is always 1 sample too small if there are > negative time values. I assume that this is because the time point 0 > is not being considered (?). By adding the following line to > raw2timelock in ft_checkdata of the most recent build, I was able to > get around any errors in this subfunction and all is now copacetic: > > line 1740: nsmp = nsmp + any(time<0); % <--- acounting for > timepoint at 0? > > I don't know if anyone else has run into this problem but I thought I > would share this with the community. > > Regards, > Dan > > -- > Daniel Stolzberg, PhD > Post-doctoral Fellow > Cerebral Systems Laboratory > Department of Physiology and Pharmacology > Schulich School of Medicine & Dentistry > University of Western Ontario > http://www.cerebralsystems.ca/ > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Tue Mar 19 08:48:51 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Tue, 19 Mar 2013 07:48:51 +0000 Subject: [FieldTrip] MNI template warping to fit the electrode locations Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFCED8A@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I use a MNI template as the volume conduction model (vol) as I have no individual MRI files. However I have the electrode locations of the subject. I read my sensor locations with elec = ft_read_sens('sensor_file') and then use [vol_coreg, sens] = ft_prepare_vol_sens(vol, elec) For coregistration of electrodes. When I plot the outer boundary with my sensors it looks as in head.jpg attached image. Shown in blue are the electrode locations of the original file. It seems that the electrodes are shifted upwards , say FP1 for instance is way above the forehead. Is there anything I can do to warp the MNI template volume(vol) to the original electrode locations(shown in blue)? Or am I doing something conceptually wrong here? Can you please tell me what is the correct thing to do with fieldTrip when only electrode location file is available? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Mobile : +61430321972 Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: head.jpg Type: image/jpeg Size: 11740 bytes Desc: head.jpg URL: From r.vandermeij at donders.ru.nl Tue Mar 19 10:47:14 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Tue, 19 Mar 2013 10:47:14 +0100 Subject: [FieldTrip] mytrialfun & ft_read_event In-Reply-To: References: Message-ID: Hi Harsimrat, One way this could be achieved is by reading in the specific channel by calling ft_read_data, just like calling ft_read_event and ft_read_header. On how to specify the call to ft_read_data, please see the documentation/help of the function. Hope it helps, Roemer On Mon, Mar 18, 2013 at 5:50 PM, Harsimrat Singh wrote: > Hi All**** > > ** ** > > I am trying to read in my data in which the first channel contains the > marker signal (spike) superimposed on the trigger channel.**** > > I would like to use mytrialfun before ft_definetrial. To do this I would > like to check the value of the marker channel and compare it with mean > value of the channel and record that value in the even field.**** > > But I guess I can’t do it as the fieldtrip doesn’t read the channel values > before ft_definetrial. Can I use data channel values in mytrialfun? If > not, is there a way around this?**** > > ** ** > > Here is my trialfun**** > > ** ** > > function [trl, event] = mytrialfun(cfg)**** > > ** ** > > % read the header information and the events from the data**** > > hdr = ft_read_header(cfg.datafile);**** > > event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, > 'detectflank','up');**** > > ** ** > > % search for "trigger" events according to 'trigchannel' defined outside > the function > > The problem lies here > > ** > > *value = [event(find(cfg.trialdef.trigchannel (it needs data of this > channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); > > ** ** > > % creating your own trialdefinition based upon the events**** > > for j = 1:length(value);**** > > trlbegin = sample(j) + pretrig;**** > > trlend = sample(j) + posttrig;**** > > offset = pretrig;**** > > newtrl = [ trlbegin trlend offset];**** > > trl = [ trl; newtrl]; **** > > end**** > > ** ** > > ** ** > > Thanks in advance**** > > Best regards**** > > Harsimrat**** > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.vandermeij at donders.ru.nl Tue Mar 19 10:47:14 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Tue, 19 Mar 2013 10:47:14 +0100 Subject: [FieldTrip] mytrialfun & ft_read_event In-Reply-To: References: Message-ID: Hi Harsimrat, One way this could be achieved is by reading in the specific channel by calling ft_read_data, just like calling ft_read_event and ft_read_header. On how to specify the call to ft_read_data, please see the documentation/help of the function. Hope it helps, Roemer On Mon, Mar 18, 2013 at 5:50 PM, Harsimrat Singh wrote: > Hi All**** > > ** ** > > I am trying to read in my data in which the first channel contains the > marker signal (spike) superimposed on the trigger channel.**** > > I would like to use mytrialfun before ft_definetrial. To do this I would > like to check the value of the marker channel and compare it with mean > value of the channel and record that value in the even field.**** > > But I guess I can’t do it as the fieldtrip doesn’t read the channel values > before ft_definetrial. Can I use data channel values in mytrialfun? If > not, is there a way around this?**** > > ** ** > > Here is my trialfun**** > > ** ** > > function [trl, event] = mytrialfun(cfg)**** > > ** ** > > % read the header information and the events from the data**** > > hdr = ft_read_header(cfg.datafile);**** > > event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2, > 'detectflank','up');**** > > ** ** > > % search for "trigger" events according to 'trigchannel' defined outside > the function > > The problem lies here > > ** > > *value = [event(find(cfg.trialdef.trigchannel (it needs data of this > channel & not channel name))>mean(cfg.trialdef.trigchannel)+500)]*%mkrchannel is data.trial{1}(1,:)); > > ** ** > > % creating your own trialdefinition based upon the events**** > > for j = 1:length(value);**** > > trlbegin = sample(j) + pretrig;**** > > trlend = sample(j) + posttrig;**** > > offset = pretrig;**** > > newtrl = [ trlbegin trlend offset];**** > > trl = [ trl; newtrl]; **** > > end**** > > ** ** > > ** ** > > Thanks in advance**** > > Best regards**** > > Harsimrat**** > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chiran.Doshi at childrens.harvard.edu Tue Mar 19 15:49:41 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Tue, 19 Mar 2013 14:49:41 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: , , Message-ID: Hi, So I tried form the beginning and it fixed the issue. Any ideas why this might be hapenning in the first place? The problem is I already have a freesurfer database with reconstructed surfaces. If there is any fix like a missing transformation that I can compute so I do not have to recon-all again for all subjects. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] Sent: Monday, March 18, 2013 9:49 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" > wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran > wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ 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 From hamid.mohseni at eng.ox.ac.uk Tue Mar 19 16:42:51 2013 From: hamid.mohseni at eng.ox.ac.uk (Hamid Mohseni) Date: Tue, 19 Mar 2013 15:42:51 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk> References: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk> Message-ID: Hi, I had this problem before, and I think it is something with freesurfer: If you plot the original MRI and its segmented volume in freesurfer, you may see that they are not in the same coordinate. I think the best way is to ask freesurfer people, we probably missing a small thing here. Thanks On 19 March 2013 14:49, Doshi, Chiran wrote: > Hi, > So I tried form the beginning and it fixed the issue. Any ideas why this > might be hapenning in the first place? > The problem is I already have a freesurfer database with reconstructed > surfaces. If there is any fix like a missing transformation that I can > compute so I do not have to recon-all again for all subjects. > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] > Sent: Monday, March 18, 2013 9:49 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Thanks for the help, > I will try again from the beginning. I will let know if I am able to get > the fix the issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] > Sent: Saturday, March 16, 2013 12:47 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > If you want to do beam former source localization, there is no need to > freesurfer and you can extract the brain shape points from the segmented > MRI using FieldTrip itself and you will not have this problem. > > However, if you want to do minimum norm source localisation, you may do a > realignment before applying free surfer, please see this > > http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate > > On Mar 16, 2013 4:23 PM, "Doshi, Chiran" < > Chiran.Doshi at childrens.harvard.edu Chiran.Doshi at childrens.harvard.edu>> wrote: > Hi Hamid, > Thanks for the reply. I see what you mean. > When I import the T1, there is a mri.transform already present in it. This > is generated by the freesurfer. mri.tranform gets changed when I do the > ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , > nas as n and z in the positive z direction. I have vitamin pills at the > fiducials ( some also at the forehead) that would help in marking the > points. > > I cannot figure out where am I messing up. Also I am using the src file in > MNE and I do not have this issue. > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > ________________________________ > From: fieldtrip-bounces at science.ru.nl fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl fieldtrip-bounces at science.ru.nl>] on behalf of Hamid Mohseni [ > hamid.mohseni at eng.ox.ac.uk] > Sent: Saturday, March 16, 2013 11:28 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Issue aligning volume conduction model with > source model > > Hi, > > I THINK there is a problem with your mri.transform matrix. Basically, > without any pre-processing, when you apply this transformation to the > headshape points 'bnd', it should match the original mri. I checked that > and apparently it dosen't happen. How did you obtain this transformation? > > Thanks > > > > On 15 March 2013 22:07, Doshi, Chiran > wrote: > Hello FieldTrip users, > > I am having trouble aligning volume conduction model with source model > > The link to the data is > https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi > > Here are the steps I followed > > % Read mri > mri = ft_read_mri('T1.mgz'); > > % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s > and origin as i. At the end mri.coordsys was equal to 'neuromag' > mri = ft_determine_coordsys(mri); > > % Align volume. Selected l, r, l and z in + z direction > cfg=[]; > cfg.coordsys='neuromag'; > mri = ft_volumerealign(cfg,mri); > > %Volume segment > cfg=[]; > cfg.coordsys='neuromag'; > cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; > seg = ft_volumesegment(cfg, mri); > > % Prepare head model. The model aligns well with sensors > cfg=[]; > cfg.coordsys='neuromag'; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > % compute sourcespace > bnd = > ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); > T = mri.transform*inv(mri.transformorig); > sourcespace = ft_transform_geometry(T, bnd); > > % Plot > figure;hold on; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > > > > These surfaces do not align. Any ideas? > > > > Chiran Doshi, MS > MEG system technologist > Department of Neurology > Boston Childrens Hospital > Phone: 781-216-1136 > Fax: 781-216-1172 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Hamid R. Mohseni, PhD > Post-Doctoral Research Assistant > Institute of Biomedical Engineering > University of Oxford, OX3 7DQ, UK > Tel: +44 (0) 1865 2 83826 > > _______________________________________________ > 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 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Tue Mar 19 16:56:04 2013 From: russgport at gmail.com (Russell G Port) Date: Tue, 19 Mar 2013 10:56:04 -0500 Subject: [FieldTrip] Inner matrix mismatch in source interpolate In-Reply-To: <5142e35f.c46f0e0a.2db7.fffff846SMTPIN_ADDED_BROKEN@mx.google.com> References: <5142e35f.c46f0e0a.2db7.fffff846SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Thanks Jim, That was exactly what was wrong. Sorry for the delayed response. I mistakenly thought that the leadfield function would create a grid (which it can, but I forgot to put in a cfg.resolution). On Fri, Mar 15, 2013 at 4:01 AM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Hi Russ,**** > > ** ** > > I ran into a similar error which was avoided by following the steps in the > *extended* beamformer tutorial ( > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended). The problem > seems to rather be that ft_sourceinterpolate wrongly detects your > functional data as being 2 dimensional (if I remember correctly) because a > .dim field is not present. I did not have the time yet to find-out if it is > a problem with the other beamformer tutorial or an actual bug.**** > > ** ** > > In any case, if I compare the steps in the extended beamformer tutorial > with the steps you took I noticed that in the extended beamformer tutorial > a sourcemodel (ft_prepare_sourcemodel) is calculated after calculating the > headmodel, which is then used to calculate the leadfield > (ft_prepare_leadfield), followed by using this leadfield in > ft_sourceanalysis. Could you try and see if that works? **** > > ** ** > > Best,**** > > ** ** > > Jim**** > > ** ** > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Russell G Port > *Sent:* vrijdag 15 maart 2013 0:18 > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] Inner matrix mismatch in source interpolate**** > > ** ** > > Hi Fieldtrippers,**** > > ** ** > > When running ft source interpolate on my CTF MEG data, I get an error > where it reaches line 237; tmp = interpmat*tmp. The error is an inner > matrix dimension mismatch. Here interpmat is a 16777216(256x256x256) x642 > matrix, (mri voxels X leaderfield interpolation matrix). tmp is a 1 * 642 > matrix of power at the leaderfield coordinates. If this is just matrix > math, then I assume the problem is just that the matrix have to be mxn and > nxp. Is there any reason I cannot just use tmp=tmp' to make the inner > dimensions match?**** > > ** ** > > Cheers Russ**** > > ** ** > > ---------- Forwarded message ---------- > From: *Russell G Port* > Date: Sat, Mar 9, 2013 at 8:38 PM > Subject: source interpolate - tmp = interpmat*tmp; inner matrix must agree > To: FieldTrip discussion list > > > Hi Fieldtrippers, > > I have a slight issue that I was hoping someone can help with. I have some > CTF data, that I was trying to perform DICS beamforming and then source > interpolation on. I am trying to beamform to the source of gamma frequency > in the right hemisphere, comparing pre and post stimuli. Heres the basic > script: > > *People can skip the first part of code, I included it as possibly useful > information for this plead > * > %%%%% Data has already been preprocessed and timelocked%%%%%% > > load('processed_data_500Hz.mat') > load('timelock_data_500Hz.mat') > > %%%% following the beamforming tutorial %%%%%%% > > %%%%%%%%%%%%%split and combine%%%%%%%%%%%%% > > cfg = []; > cfg.toilim = baseline; > cfg.channel=channel > total_bsl = ft_redefinetrial(cfg, data); > > > cfg = []; > cfg.toilim = interest; > cfg.channel=channel > total_interest = ft_redefinetrial(cfg, data); > > cfg = []; > total_cmb = ft_appenddata(cfg, total_bsl, total_interest); > > total_cmb.trialinfo = [zeros(length(total_bsl.trial), 1); > ones(length(total_interest.trial), 1)]; > > > %%%%%%%%%%%%%cross spectrial density for dics and tf for common > filter%%%%%%%%%%%%%% > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqPre_total = ft_freqanalysis(cfg, total_bsl); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqPost_total = ft_freqanalysis(cfg, total_interest); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 25; > cfg.foilim = 55; > freqALL_total = ft_freqanalysis(cfg, total_cmb); > > > %%%%%%%%%%%%%%%%%%%%%%%% calc leadfield %%%%%%%%%%%%%%%%%%%%%%%%%%% > > % > T=ft_read_mri('R128_V2.mri') > > cfg.fiducial.nas = T.hdr.fiducial.mri.nas > cfg.fiducial.lpa = T.hdr.fiducial.mri.lpa > cfg.fiducial.rpa = T.hdr.fiducial.mri.rpa > cfg.method = 'fiducial' > cfg.coordsys = 'ctf' > > [mri] = ft_volumerealign(cfg, T) > > cfg = []; > cfg.coordsys = 'ctf'; % the MRI is expressed in the CTF coordinate system, > see below > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > > vol = ft_convert_units(hdm, 'cm'); > > %%%%%%%%%%%%%%% > > > cfg = []; > cfg.grad = freqPost_total.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = 'MR' > [grid] = ft_prepare_leadfield(cfg); > > > > *Upto this point everything works. My volume conduction model, grads, and > grid looks good when verified visually... > > I then compute the common filter and apply it to the beamforming of each > condition* > > > %%%%%%%%%%%%%%%%%%%%% computer common filter%%%%%%%%%%% > > cfg = []; > cfg.method = 'dics'; > cfg.grad = freqALL_total.grad; > cfg.keeptrials = 'yes'; > cfg.frequency = freqALL_total.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.realfilter = 'yes'; > cfg.channel = 'MR' > sourceAll = ft_sourceanalysis(cfg, freqALL_total); > > %%%%%%%%%%%%%%%%%% source for bsl + interest %%%%%%%%%%%%% > > cfg.grid.filter = sourceAll.avg.filter; > cfg.grid = grid; > sourcePre_con = ft_sourceanalysis(cfg, freqPre_total ); > sourcePost_con = ft_sourceanalysis(cfg, freqPost_total); > > > %%%%%%%%%% Calc difference %%%%%%%%%%%%%%%%% > > sourceDiff = sourcePost_con; > sourceDiff.avg.pow = (sourcePost_con.avg.pow - sourcePre_con.avg.pow) ./ > sourcePre_con.avg.pow; > > > > *Heres where it falls apart, because I try to source interpolate* > > > %%%%%%%%%%%%%%%%%%%%% graph time %%%%%%%%%%%%%%%%%% > > % slicemri = ft_volumereslice([], mri); > % % mri = ft_volumereslice([],segmentedmri) %%* didnt appear to help with > the current problem > * > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > cfg.coordsys = 'ctf'; > cfg.channel = 'MR' > source_diffInt = ft_sourceinterpolate(cfg, sourceDiff , mri); &&& I also > tried segmentedmri, but no difference > > It works until it reachs line 237; tmp = interpmat*tmp; where there is > the matrixs are mismatch (interpmat is a 16777216(256x256x256) x642 > matrix, and tmp is a 1 * 642 matrix. From my basic skills I gather that tmp > is sourceDiff.avg.pow (the power difference for each leadfield point). > interpmat is the interpolation matrix return by > > interpmat = interp_ungridded(functional.pos *(position of the leadfield > locations)*, pos (mri voxels), 'projmethod', cfg.interpmethod (*nearest*), > 'sphereradius', cfg.sphereradius) (0.*05*); > > what I get out of this is a 16777216(*256x256x256* voxels) x642 *(leadfield > position)* matrix*. *it then undergoes interpmat(~anatomical.inside(:), > :) = 0. My *anatomical.inside is all voxels (all of the 256 x 256 x 256 > matrix= 1), as a result of the defaults in ft_checkdata*. > > When I try to find the minimum value in this matrix I get (via > min(interpmat) = All zero sparse: 1-by-642 > > I think what is supposed to happen is that the interpmat is a matrix that > relates meg to mri space, and as such then mutlipling with a vector that > represents the power in meg space, I can see how that would get points of > power in mri space. Though this must be wrong since the math is not > allowed.... I cannot see where I went off the beaten track. It seems as if > other people have not had this problem. > > Sorry for the bother, > > Russ Port > > Graduate Student @ Upenn > > > P.S. thanks to anyone who tries to help in advance... > > > > > > > > **** > > ** ** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.C.Schouten at tudelft.nl Wed Mar 20 09:03:35 2013 From: A.C.Schouten at tudelft.nl (Alfred Schouten - 3ME) Date: Wed, 20 Mar 2013 08:03:35 +0000 Subject: [FieldTrip] Postdoc position - TU Delft, the Netherlands Message-ID: The Department of Biomechanical Engineering is seeking a full-time post-doc for the advanced ERC Research Project ³4D-EEG: A new tool to investigate the spatial and temporal activity patterns in the brain². 4D-EEG is a highly prestigious project to develop a novel method for investigating brain activity in humans. The first goal of the project is to develop a new tool to determine brain activity at a high temporal and spatial resolution, with the focus on motor control. The method combines high density EEG and EEG source localization with advanced robot manipulators to impose precise perturbations to the joints. Using system identification, the dynamic response of brain areas to the perturbation will be assessed, leading to a functional interpretation of the EEG with time. 4D-EEG will provide a direct measure of the neural activity in the brain related to motor control tasks. The second goal is to generate and validate new hypotheses about the longitudinal relationship between motor learning and neuroplasticity in patients suffering from a stroke. The non-invasive 4D-EEG technique combined with haptic robots will open a window into what and how patients (re)learn when showing motor recovery after stroke, in order to develop more effective patient-tailored therapies in neuro-rehabilitation. A further aim is to link these functional results with structural measurements, like DTI. You will bring in your expertise in EEG recording and EEG source localization, and will work in a multidisciplinary team consisting of six PhD students and one other postdoc, divided over TU Delft and the VU medical center in Amsterdam. Your main objective will be to incorporate EEG source localization with our system identification techniques. You will provide guidance to three PhD students working on EEG source localization and system identification. We are looking for an independent mind, who takes initiative in a team, is able to translate high-level goals into small packages, and can provide guidance to PhD and MSc students. Requirements The project consists of five subprojects, each requiring specific expertise. At this moment we are looking for a post-doc with extensive expertise in EEG and source localization methods. You should have an affinity for experiments involving human subjects, have extensive programming skills (e.g. Matlab or C++), and preferably experience in one or more of the following fields: data acquisition and processing of electrophysiological and biomechanical signals, system identification and control engineering, or neuroimaging. You should have a PhD in a relevant field, like Biomedical, Mechanical or Electrical Engineering or in (applied) Mathematics, Physics, or Neuroscience. Excellent knowledge of English is a prerequisite. Conditions of employment We offer a challenging postdoc position within the 4D-EEG project. The position is initially for two-years, with the possibility to extend the contract for one or two years after a midterm evaluation. TU Delft offers an attractive benefits package, including a flexible workweek, free high-speed Internet access from home (with contracts of two years or longer), and the option of assembling a customized compensation and benefits package (the 'IKA'). Salary and benefits are in accordance with the Collective Labour Agreement for Dutch Universities. Information and application For more information about this position, please contact Dr. A. C. Schouten, e-mail: a.c.schouten at tudelft.nl. To apply, please e-mail a detailed CV along with a letter of application by May 1, 2013 to M.J.B. Kole, application-3mE at tudelft.nl. When applying for this position, please refer to vacancy number 3ME13-11. From eelke.spaak at donders.ru.nl Wed Mar 20 10:01:54 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Mar 2013 10:01:54 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics Message-ID: Dear FieldTrip community, Short version: if you did ft_freqstatistics across subjects with a different channel ordering across data sets (which is the case if you use ft_channelrepair), your results might have been erroneous. Read the following carefully. Yesterday, we discovered a possibly severe bug in a utility function (ft_selectdata_old) which was used by ft_freqstatistics. The bug entails that ft_selectdata_old assumes that the channels in all data input arguments are ordered identically, and does not take into account the order of the data.label field. This means that when several data input arguments with different channel orderings are passed to ft_selectdata_old, the resulting output structure (with a newly added 'rpt' dimension) will contain wrong data (i.e. data for channel X might end up in another channel Y). Importantly, the same thus holds for ft_freqstatistics: when doing statistics across subjects, if the different subjects' data sets have different channel orderings, the resulting statistics will be wrong. We expect that in many cases, the channel ordering across different data sets will be identical, and in those cases this bug will not have had any effect. However, one important case in which channel ordering *will* be different is when one does ft_channelrepair on a data set, since this function appends the repaired channels to the end of the data. So, if you have done ft_channelrepair on only a subset of your subjects' data, and/or used ft_channelrepair to repair different channels in different subjects, and subsequently passed the repaired data sets to ft_freqstatistics, there is a good chance the results you got were wrong. Most likely, this bug was introduced with revision 4101, in september 2011, so it has been in the code for quite a while. Note that ft_channelrepair only supports repairing missing channels since revision 5216 (february 2012), and that this was advised against until revision 6100 (june 2012), when the algorithm for doing so sensibly was implemented. The fix has been implemented and is now available from the FTP server as of fieldtrip-20130319 (Donders users: the fix is automatically available on the /home/common/ version of FieldTrip). Note that ft_selectdata_old still does not work correctly, this is something we will fix in the near future (ft_selectdata_old is deprecated). We fixed the behaviour of ft_appendfreq (the preferred replacement function for ft_selectdata_old when appending freq structures) and changed ft_freqstatistics to use this function instead. The other statistics functions, ft_timelockstatistics and ft_sourcestatistics, were not affected by this bug. We strongly advise you to upgrade to the latest version of FieldTrip. If the situation described above applies to you, you will need to redo your channel-level (time-)frequency statistics analyses. Details on the bug (and a test script) can be found here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any problems related to the bug, please post them there. We sincerely apologise for this bug and any trouble it might have caused. Best, On behalf of the FT core development team, Eelke From eelke.spaak at donders.ru.nl Wed Mar 20 14:49:15 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Mar 2013 14:49:15 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: Message-ID: Dear all, A short PS: Unfortunately, we found a remaining piece of bug in ft_freqstatistics, related to the same issue (and relevant under the same circumstances). This has now also been fixed, and should be available as of *tonight*'s FTP release, so fieldtrip-20130320. Apologies again, best, Eelke On 20 March 2013 10:01, Eelke Spaak wrote: > Dear FieldTrip community, > > Short version: if you did ft_freqstatistics across subjects with a > different channel ordering across data sets (which is the case if you > use ft_channelrepair), your results might have been erroneous. Read > the following carefully. > > Yesterday, we discovered a possibly severe bug in a utility function > (ft_selectdata_old) which was used by ft_freqstatistics. The bug > entails that ft_selectdata_old assumes that the channels in all data > input arguments are ordered identically, and does not take into > account the order of the data.label field. This means that when > several data input arguments with different channel orderings are > passed to ft_selectdata_old, the resulting output structure (with a > newly added 'rpt' dimension) will contain wrong data (i.e. data for > channel X might end up in another channel Y). Importantly, the same > thus holds for ft_freqstatistics: when doing statistics across > subjects, if the different subjects' data sets have different channel > orderings, the resulting statistics will be wrong. > > We expect that in many cases, the channel ordering across different > data sets will be identical, and in those cases this bug will not have > had any effect. However, one important case in which channel ordering > *will* be different is when one does ft_channelrepair on a data set, > since this function appends the repaired channels to the end of the > data. So, if you have done ft_channelrepair on only a subset of your > subjects' data, and/or used ft_channelrepair to repair different > channels in different subjects, and subsequently passed the repaired > data sets to ft_freqstatistics, there is a good chance the results you > got were wrong. > > Most likely, this bug was introduced with revision 4101, in september > 2011, so it has been in the code for quite a while. Note that > ft_channelrepair only supports repairing missing channels since > revision 5216 (february 2012), and that this was advised against until > revision 6100 (june 2012), when the algorithm for doing so sensibly > was implemented. > > The fix has been implemented and is now available from the FTP server > as of fieldtrip-20130319 (Donders users: the fix is automatically > available on the /home/common/ version of FieldTrip). Note that > ft_selectdata_old still does not work correctly, this is something we > will fix in the near future (ft_selectdata_old is deprecated). We > fixed the behaviour of ft_appendfreq (the preferred replacement > function for ft_selectdata_old when appending freq structures) and > changed ft_freqstatistics to use this function instead. > > The other statistics functions, ft_timelockstatistics and > ft_sourcestatistics, were not affected by this bug. We strongly advise > you to upgrade to the latest version of FieldTrip. If the situation > described above applies to you, you will need to redo your > channel-level (time-)frequency statistics analyses. > > Details on the bug (and a test script) can be found here: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > problems related to the bug, please post them there. > > We sincerely apologise for this bug and any trouble it might have caused. > > Best, > On behalf of the FT core development team, > > Eelke From Chiran.Doshi at childrens.harvard.edu Wed Mar 20 16:00:34 2013 From: Chiran.Doshi at childrens.harvard.edu (Doshi, Chiran) Date: Wed, 20 Mar 2013 15:00:34 +0000 Subject: [FieldTrip] Issue aligning volume conduction model with source model In-Reply-To: References: <7d288217-359e-413a-8293-d49e5bcce3d3@HUB04.ad.oak.ox.ac.uk>, Message-ID: Will do, Thanks!! Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Tuesday, March 19, 2013 11:51 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I had this problem before, and I think it is something with freesurfer: If you plot the original MRI and its segmented volume in freesurfer, you may see that they are not in the same coordinate. I think the best way is to ask freesurfer people, we probably missing a small thing here. Thanks On 19 March 2013 14:49, Doshi, Chiran > wrote: Hi, So I tried form the beginning and it fixed the issue. Any ideas why this might be hapenning in the first place? The problem is I already have a freesurfer database with reconstructed surfaces. If there is any fix like a missing transformation that I can compute so I do not have to recon-all again for all subjects. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Doshi, Chiran [Chiran.Doshi at childrens.harvard.edu] Sent: Monday, March 18, 2013 9:49 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Thanks for the help, I will try again from the beginning. I will let know if I am able to get the fix the issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk] Sent: Saturday, March 16, 2013 12:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model If you want to do beam former source localization, there is no need to freesurfer and you can extract the brain shape points from the segmented MRI using FieldTrip itself and you will not have this problem. However, if you want to do minimum norm source localisation, you may do a realignment before applying free surfer, please see this http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate On Mar 16, 2013 4:23 PM, "Doshi, Chiran" >> wrote: Hi Hamid, Thanks for the reply. I see what you mean. When I import the T1, there is a mri.transform already present in it. This is generated by the freesurfer. mri.tranform gets changed when I do the ft_volumerealign, (following right hand system) I mark rpa as r, lpa as l , nas as n and z in the positive z direction. I have vitamin pills at the fiducials ( some also at the forehead) that would help in marking the points. I cannot figure out where am I messing up. Also I am using the src file in MNE and I do not have this issue. Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 ________________________________ From: fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl>] on behalf of Hamid Mohseni [hamid.mohseni at eng.ox.ac.uk>] Sent: Saturday, March 16, 2013 11:28 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Issue aligning volume conduction model with source model Hi, I THINK there is a problem with your mri.transform matrix. Basically, without any pre-processing, when you apply this transformation to the headshape points 'bnd', it should match the original mri. I checked that and apparently it dosen't happen. How did you obtain this transformation? Thanks On 15 March 2013 22:07, Doshi, Chiran >> wrote: Hello FieldTrip users, I am having trouble aligning volume conduction model with source model The link to the data is https://www.dropbox.com/sh/7ejsvewemci8ixe/RpfP3F5ROi Here are the steps I followed % Read mri mri = ft_read_mri('T1.mgz'); % Determine coordinate system. Neuromag selected +x as r, +y as a, +z as s and origin as i. At the end mri.coordsys was equal to 'neuromag' mri = ft_determine_coordsys(mri); % Align volume. Selected l, r, l and z in + z direction cfg=[]; cfg.coordsys='neuromag'; mri = ft_volumerealign(cfg,mri); %Volume segment cfg=[]; cfg.coordsys='neuromag'; cfg.output = {'brain' 'scalp' 'skull' 'tpm'}; seg = ft_volumesegment(cfg, mri); % Prepare head model. The model aligns well with sensors cfg=[]; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); % compute sourcespace bnd = ft_read_headshape('ID_000000-ico-5-src.fif','format','mne_source','unit','mm'); T = mri.transform*inv(mri.transformorig); sourcespace = ft_transform_geometry(T, bnd); % Plot figure;hold on; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; These surfaces do not align. Any ideas? Chiran Doshi, MS MEG system technologist Department of Neurology Boston Childrens Hospital Phone: 781-216-1136 Fax: 781-216-1172 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 _______________________________________________ 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 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Hamid R. Mohseni, PhD Post-Doctoral Research Assistant Institute of Biomedical Engineering University of Oxford, OX3 7DQ, UK Tel: +44 (0) 1865 2 83826 From inieuwenhuis at berkeley.edu Wed Mar 20 20:55:49 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Wed, 20 Mar 2013 12:55:49 -0700 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: Message-ID: <514A1445.50007@berkeley.edu> Hi Eelke, Thanks for reporting. I did do ft_channelrepair on my EEG data for some subjects and subsequently used ft_freqstatistics. However, the channel order is indentical in all my subjects in the freq. I repaired bad channels using the default setting (method='nearest'). The bad channels were included in the input data to ft_channelrepair (so they were not missing). I just checked, and in data_out after ft_channelrepair, the order of the labels of the data is identical to the data_in, thus the repaired channels were NOT appended to the end of the data. So apparently ft_channelrepair not always appends the repaired channels at the end. I suppose this is good news for me, meaning that the bug did not affect me, since the channels were ordered identically when calling ft_freqstatistics. Do you agree, or am I missing something? And for others that used ft_channelrepair, might be worth checking if the ordering is indeed changed after calling it, because it appears not always to be the case. Thanks, Ingrid On 3/20/2013 2:01 AM, Eelke Spaak wrote: > Dear FieldTrip community, > > Short version: if you did ft_freqstatistics across subjects with a > different channel ordering across data sets (which is the case if you > use ft_channelrepair), your results might have been erroneous. Read > the following carefully. > > Yesterday, we discovered a possibly severe bug in a utility function > (ft_selectdata_old) which was used by ft_freqstatistics. The bug > entails that ft_selectdata_old assumes that the channels in all data > input arguments are ordered identically, and does not take into > account the order of the data.label field. This means that when > several data input arguments with different channel orderings are > passed to ft_selectdata_old, the resulting output structure (with a > newly added 'rpt' dimension) will contain wrong data (i.e. data for > channel X might end up in another channel Y). Importantly, the same > thus holds for ft_freqstatistics: when doing statistics across > subjects, if the different subjects' data sets have different channel > orderings, the resulting statistics will be wrong. > > We expect that in many cases, the channel ordering across different > data sets will be identical, and in those cases this bug will not have > had any effect. However, one important case in which channel ordering > *will* be different is when one does ft_channelrepair on a data set, > since this function appends the repaired channels to the end of the > data. So, if you have done ft_channelrepair on only a subset of your > subjects' data, and/or used ft_channelrepair to repair different > channels in different subjects, and subsequently passed the repaired > data sets to ft_freqstatistics, there is a good chance the results you > got were wrong. > > Most likely, this bug was introduced with revision 4101, in september > 2011, so it has been in the code for quite a while. Note that > ft_channelrepair only supports repairing missing channels since > revision 5216 (february 2012), and that this was advised against until > revision 6100 (june 2012), when the algorithm for doing so sensibly > was implemented. > > The fix has been implemented and is now available from the FTP server > as of fieldtrip-20130319 (Donders users: the fix is automatically > available on the /home/common/ version of FieldTrip). Note that > ft_selectdata_old still does not work correctly, this is something we > will fix in the near future (ft_selectdata_old is deprecated). We > fixed the behaviour of ft_appendfreq (the preferred replacement > function for ft_selectdata_old when appending freq structures) and > changed ft_freqstatistics to use this function instead. > > The other statistics functions, ft_timelockstatistics and > ft_sourcestatistics, were not affected by this bug. We strongly advise > you to upgrade to the latest version of FieldTrip. If the situation > described above applies to you, you will need to redo your > channel-level (time-)frequency statistics analyses. > > Details on the bug (and a test script) can be found here: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > problems related to the bug, please post them there. > > We sincerely apologise for this bug and any trouble it might have caused. > > Best, > On behalf of the FT core development team, > > Eelke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From ricardoojm at gmail.com Thu Mar 21 01:42:34 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Wed, 20 Mar 2013 21:42:34 -0300 Subject: [FieldTrip] finding gradiometer Message-ID: Dear all, I am trying to run a source localization analysis of eeg oscillatory activity. My data was recorded by a BrainAmp, and I exported using the brainvision analyzer. Since I am very new to fieldtrip, I have a (probably very basic) doubt, and would be really glad if someone could help me. First, when creating the leadfield, it asks for the gradiometer (cfg.grad), but I didnt figure out where I can find it. I checked the "localizing oscillatory sources using beamformer techniques" tutorial, and it seems that it can be recovered as an output of the "ft_freqanalysis" (since there is a "cfg.grad = freqPost.grad" definition), but I didnt manage to have it, even running the same parameters as in the tutorial. Here is how I am doing the oscillatory analysis. cfg = []; cfg.method = 'wavelet'; cfg.width = 2; cfg.output = 'pow'; cfg.foi = 2:2:20; cfg.toi = -0.5:0.05:1; TFR = ft_freqanalysis(cfg, dataEEGmax); Thanks a lot in advance, Best regards, Ricardo -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Mar 21 08:22:26 2013 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 21 Mar 2013 08:22:26 +0100 Subject: [FieldTrip] finding gradiometer In-Reply-To: References: Message-ID: Hi Ricardo, try cfg.elec rather than cfg.grad. also ft_freqanalysis does not "recover" electrode positions, at least that would be a feature of wavelets new to me :-) you need to give fieldtrip the electrode positions: with MEG data they are usually automatically read when doing ft_preprocessing. otherwise you need to read the info (e.g. from a polhemus file) using ft_read_sens. if you don not have digitized positions, i guess that for most standard caps there are standard electrode positions in fieldtrip. good luck, n On 21.03.2013, at 01:42, Ricardo Moura wrote: > Dear all, > I am trying to run a source localization analysis of eeg oscillatory activity. My data was recorded by a BrainAmp, and I exported using the brainvision analyzer. > > Since I am very new to fieldtrip, I have a (probably very basic) doubt, and would be really glad if someone could help me. > > First, when creating the leadfield, it asks for the gradiometer (cfg.grad), but I didnt figure out where I can find it. I checked the "localizing oscillatory sources using beamformer techniques" tutorial, and it seems that it can be recovered as an output of the "ft_freqanalysis" (since there is a "cfg.grad = freqPost.grad" definition), but I didnt manage to have it, even running the same parameters as in the tutorial. > > Here is how I am doing the oscillatory analysis. > cfg = []; > cfg.method = 'wavelet'; > cfg.width = 2; > cfg.output = 'pow'; > cfg.foi = 2:2:20; > cfg.toi = -0.5:0.05:1; > TFR = ft_freqanalysis(cfg, dataEEGmax); > > Thanks a lot in advance, > Best regards, > Ricardo > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Thu Mar 21 09:34:29 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 21 Mar 2013 09:34:29 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: <514A1445.50007@berkeley.edu> References: <514A1445.50007@berkeley.edu> Message-ID: Hi Ingrid, Thanks for your question; it made me realize that my e-mail was not clear enough. In your case, when you repaired channels that were still present in the data, the output channel order of ft_channelrepair will be the same as the input channel order. The problem only occurs if you use ft_channelrepair to repair *missing* channels, so e.g. channels switched off during acquisition or that were discarded during preprocessing. Groeten, Eelke On 20 March 2013 20:55, Ingrid Nieuwenhuis wrote: > Hi Eelke, > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > subjects and subsequently used ft_freqstatistics. However, the channel order > is indentical in all my subjects in the freq. > > I repaired bad channels using the default setting (method='nearest'). The > bad channels were included in the input data to ft_channelrepair (so they > were not missing). I just checked, and in data_out after ft_channelrepair, > the order of the labels of the data is identical to the data_in, thus the > repaired channels were NOT appended to the end of the data. So apparently > ft_channelrepair not always appends the repaired channels at the end. I > suppose this is good news for me, meaning that the bug did not affect me, > since the channels were ordered identically when calling ft_freqstatistics. > Do you agree, or am I missing something? And for others that used > ft_channelrepair, might be worth checking if the ordering is indeed changed > after calling it, because it appears not always to be the case. > > Thanks, > Ingrid > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> Dear FieldTrip community, >> >> Short version: if you did ft_freqstatistics across subjects with a >> different channel ordering across data sets (which is the case if you >> use ft_channelrepair), your results might have been erroneous. Read >> the following carefully. >> >> Yesterday, we discovered a possibly severe bug in a utility function >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> entails that ft_selectdata_old assumes that the channels in all data >> input arguments are ordered identically, and does not take into >> account the order of the data.label field. This means that when >> several data input arguments with different channel orderings are >> passed to ft_selectdata_old, the resulting output structure (with a >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> channel X might end up in another channel Y). Importantly, the same >> thus holds for ft_freqstatistics: when doing statistics across >> subjects, if the different subjects' data sets have different channel >> orderings, the resulting statistics will be wrong. >> >> We expect that in many cases, the channel ordering across different >> data sets will be identical, and in those cases this bug will not have >> had any effect. However, one important case in which channel ordering >> *will* be different is when one does ft_channelrepair on a data set, >> since this function appends the repaired channels to the end of the >> data. So, if you have done ft_channelrepair on only a subset of your >> subjects' data, and/or used ft_channelrepair to repair different >> channels in different subjects, and subsequently passed the repaired >> data sets to ft_freqstatistics, there is a good chance the results you >> got were wrong. >> >> Most likely, this bug was introduced with revision 4101, in september >> 2011, so it has been in the code for quite a while. Note that >> ft_channelrepair only supports repairing missing channels since >> revision 5216 (february 2012), and that this was advised against until >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> was implemented. >> >> The fix has been implemented and is now available from the FTP server >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> available on the /home/common/ version of FieldTrip). Note that >> ft_selectdata_old still does not work correctly, this is something we >> will fix in the near future (ft_selectdata_old is deprecated). We >> fixed the behaviour of ft_appendfreq (the preferred replacement >> function for ft_selectdata_old when appending freq structures) and >> changed ft_freqstatistics to use this function instead. >> >> The other statistics functions, ft_timelockstatistics and >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> you to upgrade to the latest version of FieldTrip. If the situation >> described above applies to you, you will need to redo your >> channel-level (time-)frequency statistics analyses. >> >> Details on the bug (and a test script) can be found here: >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> problems related to the bug, please post them there. >> >> We sincerely apologise for this bug and any trouble it might have caused. >> >> Best, >> On behalf of the FT core development team, >> >> Eelke >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From t.w.kononowicz at rug.nl Thu Mar 21 19:23:38 2013 From: t.w.kononowicz at rug.nl (T.W. Kononowicz) Date: Thu, 21 Mar 2013 19:23:38 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate Message-ID: Dear FieldTrip users, I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. cfg = []; cfg.method = 'mne'; cfg.grid = grid; cfg.vol = template_vol; cfg.grad = grad; cfg.projectnoise = 'yes'; cfg.reducerank = 'no'; cfg.mne.lambda = 1e8; repr2_mne = ft_sourceanalysis(cfg, repr2_cov); The repr2_mne structure looks as follows: >> repr2_mne repr2_mne = dim: [15 15 14] time: [1x1751 double] pos: [3150x3 double] inside: [1x1613 double] outside: [1x1537 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] >> repr2_mne.avg ans = mom: {1x3150 cell} pow: [3150x1751 double] noisecov: {1x3150 cell} As the next step I call the ft_sourceinterpolate: cfg=[]; cfg.interpmethod='linear'; cfg.parameter='avg.pow'; cfg.downsample = 2; cfg.feedback='yes'; repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); Then I get the following display message. the input is source data with 3150 positions on a [15 15 14] grid the input is volume data with dimensions [91 109 91] updating homogenous coordinate transformation matrix downsampling anatomy downsampling inside the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB selecting subvolume of 34.7% reslicing and interpolating avg.pow After that the code crashes and I get the error: ??? Error using ==> interpn at 155 Wrong number of input arguments or some dimension of V is less than 2. Error in ==> ft_sourceinterpolate>my_interpn at 494 av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); Error in ==> ft_sourceinterpolate at 397 av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); Just before crush in line 397 of ft_sourceinterpolate: av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are: size(fv) ans = 3150 1751 ax, ay, az, are: size(ay) ans = 46 55 46 size(sel) ans = 116380 1 I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here? Thank you in advance for you help, Tadeusz W. Kononowicz -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhharsimrat at gmail.com Thu Mar 21 20:08:16 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Thu, 21 Mar 2013 19:08:16 +0000 Subject: [FieldTrip] K-fold classification Multivariate Analysis Message-ID: Hello All A question @ the k-fold classification . Does cfg.method = 'crossvalidate'; randomize the trials when it builds the folds? And does each fold contains representative of each class? OR Do I need to do this manually before I feed the data to ft_freqstatistics? Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.simanova at mpi.nl Fri Mar 22 08:11:20 2013 From: irina.simanova at mpi.nl (Irina Simanova) Date: Fri, 22 Mar 2013 08:11:20 +0100 Subject: [FieldTrip] K-fold classification Multivariate Analysis In-Reply-To: References: Message-ID: <706F1C72-F1BD-473B-B2B0-79AC534B374A@mpi.nl> Dear Harsimrat, yes, the method does randomize trials. and each fold has trials of each class. You can check the 'trainfolds' field in the statistic's output. The indexes of trials assigned to each fold are stored there. best, Irina On Mar 21, 2013, at 8:08 PM 3/21/13, Harsimrat Singh wrote: > Hello All > > A question @ the k-fold classification > . > Does cfg.method = 'crossvalidate'; randomize the trials when it > builds the folds? And does each fold contains representative of each > class? > > OR > > Do I need to do this manually before I feed the data to > ft_freqstatistics? > > Best regards > Harsimrat > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Fri Mar 22 13:58:22 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Fri, 22 Mar 2013 12:58:22 +0000 Subject: [FieldTrip] Fwd: [SPM] UK MEG PhD studentships In-Reply-To: <4D3B09BC4D279A438B88696310A1B97D1FA7697A@AMSPRD0111MB483.eurprd01.prod.exchangelabs.com> References: <4D3B09BC4D279A438B88696310A1B97D1FA7697A@AMSPRD0111MB483.eurprd01.prod.exchangelabs.com> Message-ID: ---------- Forwarded message ---------- From: Barnes, Gareth Date: Fri, Mar 22, 2013 at 12:13 PM Subject: [SPM] UK MEG PhD studentships To: SPM at jiscmail.ac.uk Dear All The UK is recruiting a cohort of MEG PhD students. Could you pass this on to any potential candidates please. Best Gareth -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: UKMRCstudentships.pdf Type: application/pdf Size: 90537 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Fri Mar 22 16:00:39 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 22 Mar 2013 16:00:39 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate In-Reply-To: References: Message-ID: <514C7217.6050609@donders.ru.nl> Dear Tadeusz, does it work when you leave out cfg.downsample or with another interpolation method? Best, Jörn On 3/21/2013 7:23 PM, T.W. Kononowicz wrote: > Dear FieldTrip users, > > I am trying to do some source reconstruction on ERF data (version: > fieldtrip-20130320). Everything seems to work quite well up to > ft_sourceinterpolate. > > > cfg = []; > > cfg.method = 'mne'; > > cfg.grid = grid; > > cfg.vol = template_vol; > > cfg.grad = grad; > > cfg.projectnoise = 'yes'; > > cfg.reducerank = 'no'; > > cfg.mne.lambda = 1e8; > > repr2_mne = ft_sourceanalysis(cfg, repr2_cov); > > > The repr2_mne structure looks as follows: > >> repr2_mne > repr2_mne = > dim: [15 15 14] > time: [1x1751 double] > pos: [3150x3 double] > inside: [1x1613 double] > outside: [1x1537 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > >> repr2_mne.avg > ans = > mom: {1x3150 cell} > pow: [3150x1751 double] > noisecov: {1x3150 cell} > > > As the next step I call the ft_sourceinterpolate: > > cfg=[]; > > cfg.interpmethod='linear'; > > cfg.parameter='avg.pow'; > > cfg.downsample = 2; > > cfg.feedback='yes'; > > repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); > > > Then I get the following display message. > > the input is source data with 3150 positions on a [15 15 14] grid > > the input is volume data with dimensions [91 109 91] > > updating homogenous coordinate transformation matrix > > downsampling anatomy > > downsampling inside > > the call to "ft_volumedownsample" took 0 seconds and required the > additional allocation of an estimated 0 MB > > selecting subvolume of 34.7% > > reslicing and interpolating avg.pow > > > After that the code crashes and I get the error: > > > ??? Error using ==> interpn at 155 > > Wrong number of input arguments or some dimension of V is less than 2. > > > Error in ==> ft_sourceinterpolate>my_interpn at 494 > > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > > Error in ==> ft_sourceinterpolate at 397 > > av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), > cfg.interpmethod, > > cfg.feedback); > > > Just before crush in line 397 of ft_sourceinterpolate: av( sel) = > my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, > cfg.feedback); argument's size are: > > size(fv) > ans = > 3150 1751 > > ax, ay, az, are: > > size(ay) > > ans = > > 46 55 46 > > > size(sel) > > ans = > > 116380 1 > > > I found one similar post on the list, however its not helpful in that > case. Does anyone can spot what I'm missing here? > > > Thank you in advance for you help, > > > Tadeusz W. Kononowicz > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.w.kononowicz at rug.nl Sat Mar 23 12:16:40 2013 From: t.w.kononowicz at rug.nl (T.W. Kononowicz) Date: Sat, 23 Mar 2013 12:16:40 +0100 Subject: [FieldTrip] fieldtrip Digest, Vol 28, Issue 46 In-Reply-To: Message-ID: Dear Jorn, After leaving out cfg.downsample all interpolation methods result in the same error. Tadeusz From: Reply-To: Date: Saturday, March 23, 2013 12:00 PM To: Subject: fieldtrip Digest, Vol 28, Issue 46 > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: Problem with interpn function in ft_sourceinterpolate > (J?rn M. Horschig) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 22 Mar 2013 16:00:39 +0100 > From: "J?rn M. Horschig" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with interpn function in > ft_sourceinterpolate > Message-ID: <514C7217.6050609 at donders.ru.nl> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Dear Tadeusz, > > does it work when you leave out cfg.downsample or with another > interpolation method? > > Best, > J?rn > > > On 3/21/2013 7:23 PM, T.W. Kononowicz wrote: >> Dear FieldTrip users, >> >> I am trying to do some source reconstruction on ERF data (version: >> fieldtrip-20130320). Everything seems to work quite well up to >> ft_sourceinterpolate. >> >> >> cfg = []; >> >> cfg.method = 'mne'; >> >> cfg.grid = grid; >> >> cfg.vol = template_vol; >> >> cfg.grad = grad; >> >> cfg.projectnoise = 'yes'; >> >> cfg.reducerank = 'no'; >> >> cfg.mne.lambda = 1e8; >> >> repr2_mne = ft_sourceanalysis(cfg, repr2_cov); >> >> >> The repr2_mne structure looks as follows: >>>> >> repr2_mne >> repr2_mne = >> dim: [15 15 14] >> time: [1x1751 double] >> pos: [3150x3 double] >> inside: [1x1613 double] >> outside: [1x1537 double] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >>>> >> repr2_mne.avg >> ans = >> mom: {1x3150 cell} >> pow: [3150x1751 double] >> noisecov: {1x3150 cell} >> >> >> As the next step I call the ft_sourceinterpolate: >> >> cfg=[]; >> >> cfg.interpmethod='linear'; >> >> cfg.parameter='avg.pow'; >> >> cfg.downsample = 2; >> >> cfg.feedback='yes'; >> >> repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); >> >> >> Then I get the following display message. >> >> the input is source data with 3150 positions on a [15 15 14] grid >> >> the input is volume data with dimensions [91 109 91] >> >> updating homogenous coordinate transformation matrix >> >> downsampling anatomy >> >> downsampling inside >> >> the call to "ft_volumedownsample" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> >> selecting subvolume of 34.7% >> >> reslicing and interpolating avg.pow >> >> >> After that the code crashes and I get the error: >> >> >> ??? Error using ==> interpn at 155 >> >> Wrong number of input arguments or some dimension of V is less than 2. >> >> >> Error in ==> ft_sourceinterpolate>my_interpn at 494 >> >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >> >> >> Error in ==> ft_sourceinterpolate at 397 >> >> av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), >> cfg.interpmethod, >> >> cfg.feedback); >> >> >> Just before crush in line 397 of ft_sourceinterpolate: av( sel) = >> my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, >> cfg.feedback); argument's size are: >> >> size(fv) >> ans = >> 3150 1751 >> >> ax, ay, az, are: >> >> size(ay) >> >> ans = >> >> 46 55 46 >> >> >> size(sel) >> >> ans = >> >> 116380 1 >> >> >> I found one similar post on the list, however its not helpful in that >> case. Does anyone can spot what I'm missing here? >> >> >> Thank you in advance for you help, >> >> >> Tadeusz W. Kononowicz >> >> >> >> _______________________________________________ >> 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 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > a/attachment-0001.html> > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 28, Issue 46 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Mar 23 14:33:44 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 23 Mar 2013 14:33:44 +0100 Subject: [FieldTrip] Problem with interpn function in ft_sourceinterpolate In-Reply-To: References: Message-ID: hi tadeusz, I believe that interpolation from a 3D grid onto another 3D grid is not supported when the input contains multiple time points. Best Jan-Mathijs On Mar 21, 2013, at 7:23 PM, T.W. Kononowicz wrote: > Dear FieldTrip users, > > I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. > > > cfg = []; > cfg.method = 'mne'; > cfg.grid = grid; > cfg.vol = template_vol; > cfg.grad = grad; > cfg.projectnoise = 'yes'; > cfg.reducerank = 'no'; > cfg.mne.lambda = 1e8; > repr2_mne = ft_sourceanalysis(cfg, repr2_cov); > > The repr2_mne structure looks as follows: > >> repr2_mne > repr2_mne = > dim: [15 15 14] > time: [1x1751 double] > pos: [3150x3 double] > inside: [1x1613 double] > outside: [1x1537 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > >> repr2_mne.avg > ans = > mom: {1x3150 cell} > pow: [3150x1751 double] > noisecov: {1x3150 cell} > > > As the next step I call the ft_sourceinterpolate: > cfg=[]; > cfg.interpmethod='linear'; > cfg.parameter='avg.pow'; > cfg.downsample = 2; > cfg.feedback='yes'; > repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template); > > Then I get the following display message. > the input is source data with 3150 positions on a [15 15 14] grid > the input is volume data with dimensions [91 109 91] > updating homogenous coordinate transformation matrix > downsampling anatomy > downsampling inside > the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB > selecting subvolume of 34.7% > reslicing and interpolating avg.pow > > After that the code crashes and I get the error: > > ??? Error using ==> interpn at 155 > Wrong number of input arguments or some dimension of V is less than 2. > > Error in ==> ft_sourceinterpolate>my_interpn at 494 > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > Error in ==> ft_sourceinterpolate at 397 > av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, > cfg.feedback); > > > Just before crush in line 397 of ft_sourceinterpolate: av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are: > size(fv) > ans = > 3150 1751 > ax, ay, az, are: > size(ay) > ans = > 46 55 46 > > size(sel) > ans = > 116380 1 > > > > I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here? > > Thank you in advance for you help, > > Tadeusz W. Kononowicz > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.koulouri84 at googlemail.com Sun Mar 24 22:49:11 2013 From: a.koulouri84 at googlemail.com (alexandra koulouri) Date: Sun, 24 Mar 2013 21:49:11 +0000 Subject: [FieldTrip] problem use OpenMEEG Message-ID: Hi, I would like to run the test example for the OpenMEEG. I followed the instructions and I installed the OpenMEEG.exe (Windows 8) However, when I wrote: system ('om_assemble' ) I receive this: 'om_assemble' is not recognized as an internal or external command, operable program or batch file. During the installation, I selected the option add path to windows for all users and there was the following warning: Warning! PATH too long installer unable to modify PATH! I am guessing that's the reason why it doesn't work and probably I need to change the path manually. But I don't know what I need to do. Any suggestions? many thanks, Alexandra -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhharsimrat at gmail.com Mon Mar 25 17:47:45 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 25 Mar 2013 16:47:45 +0000 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: <514A1445.50007@berkeley.edu> Message-ID: Hi All I think I am missing something with ft_selectdata. I investigated a bit more while redoing the analysis with new version of fieldtrip. I have 4 class data but i am just doing classification (multivariate analysis) between the first two classes with 13 and 20 trials each. After the ft_freqanalysis - all the trials are contained in tf - and tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have one channel as I removed others. When I use tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); to get trials for only the first class I get label: {32x1 cell} dimord: 'rpt_chan_freq_time' freq: [10.5000 12.5000 14.5000] time: [0.3000 0.4000 0.5000 0.6000] powspctrm: [4-D double] cumtapcnt: [13x3 double] cfg: [1x1 struct] Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as tf.powspctrm Similarly, for trials of class 2 tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); Again, the size of tf2 is same as tf1 which is same as tf The only difference in the structure is tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. The first question is- How does ft_freqstatistics handle tf1.cumtapcnt, when I use stat = ft_freqstatistics(cfg,tf1,tf2) Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? This only works if I design the label as cfg. design = [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' its size is 73*2 =146 But my total relevant trials are just 13 (class 1) + 20(class2) = 33 for both classes I suspect I making a mistake somewhere as in ideal case I should be designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); 2*ones(size(tf2.cumtapcnt,1),1)]' size(cg.design) should be 33 and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 3 4] So ft_freqstatistics should be handling 33 trials - with 13 from first class, 20 from other class. But now it has full 146 trials even after doing ft_selectdata. I will be very grateful for any help. Best regards Harsimrat On 21 March 2013 08:34, Eelke Spaak wrote: > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > > subjects and subsequently used ft_freqstatistics. However, the channel > order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, thus the > > repaired channels were NOT appended to the end of the data. So apparently > > ft_channelrepair not always appends the repaired channels at the end. I > > suppose this is good news for me, meaning that the bug did not affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is indeed > changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will not have > >> had any effect. However, one important case in which channel ordering > >> *will* be different is when one does ft_channelrepair on a data set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the repaired > >> data sets to ft_freqstatistics, there is a good chance the results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might have > caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Mar 25 18:07:33 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 25 Mar 2013 18:07:33 +0100 Subject: [FieldTrip] IMPORTANT: Bug in ft_freqstatistics In-Reply-To: References: <514A1445.50007@berkeley.edu> Message-ID: Hi Harsimrat, Do you believe this is related to the bug I described? (If not, it's better to send an e-mail with a different subject line, to avoid confusion.) Cheers, Eelke On 25 March 2013 17:47, Harsimrat Singh wrote: > Hi All > > I think I am missing something with ft_selectdata. I investigated a bit more > while redoing the analysis with new version of fieldtrip. > > I have 4 class data but i am just doing classification (multivariate > analysis) between the first two classes with 13 and 20 trials each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have > one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > But my total relevant trials are just 13 (class 1) + 20(class2) = 33 for > both classes > I suspect I making a mistake somewhere as in ideal case I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 > 3 4] > > So ft_freqstatistics should be handling 33 trials - with 13 from first > class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > > > On 21 March 2013 08:34, Eelke Spaak wrote: >> >> Hi Ingrid, >> >> Thanks for your question; it made me realize that my e-mail was not >> clear enough. In your case, when you repaired channels that were still >> present in the data, the output channel order of ft_channelrepair will >> be the same as the input channel order. >> >> The problem only occurs if you use ft_channelrepair to repair >> *missing* channels, so e.g. channels switched off during acquisition >> or that were discarded during preprocessing. >> >> Groeten, >> Eelke >> >> On 20 March 2013 20:55, Ingrid Nieuwenhuis >> wrote: >> > Hi Eelke, >> > >> > Thanks for reporting. I did do ft_channelrepair on my EEG data for some >> > subjects and subsequently used ft_freqstatistics. However, the channel >> > order >> > is indentical in all my subjects in the freq. >> > >> > I repaired bad channels using the default setting (method='nearest'). >> > The >> > bad channels were included in the input data to ft_channelrepair (so >> > they >> > were not missing). I just checked, and in data_out after >> > ft_channelrepair, >> > the order of the labels of the data is identical to the data_in, thus >> > the >> > repaired channels were NOT appended to the end of the data. So >> > apparently >> > ft_channelrepair not always appends the repaired channels at the end. I >> > suppose this is good news for me, meaning that the bug did not affect >> > me, >> > since the channels were ordered identically when calling >> > ft_freqstatistics. >> > Do you agree, or am I missing something? And for others that used >> > ft_channelrepair, might be worth checking if the ordering is indeed >> > changed >> > after calling it, because it appears not always to be the case. >> > >> > Thanks, >> > Ingrid >> > >> > >> > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> >> >> Dear FieldTrip community, >> >> >> >> Short version: if you did ft_freqstatistics across subjects with a >> >> different channel ordering across data sets (which is the case if you >> >> use ft_channelrepair), your results might have been erroneous. Read >> >> the following carefully. >> >> >> >> Yesterday, we discovered a possibly severe bug in a utility function >> >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> >> entails that ft_selectdata_old assumes that the channels in all data >> >> input arguments are ordered identically, and does not take into >> >> account the order of the data.label field. This means that when >> >> several data input arguments with different channel orderings are >> >> passed to ft_selectdata_old, the resulting output structure (with a >> >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> >> channel X might end up in another channel Y). Importantly, the same >> >> thus holds for ft_freqstatistics: when doing statistics across >> >> subjects, if the different subjects' data sets have different channel >> >> orderings, the resulting statistics will be wrong. >> >> >> >> We expect that in many cases, the channel ordering across different >> >> data sets will be identical, and in those cases this bug will not have >> >> had any effect. However, one important case in which channel ordering >> >> *will* be different is when one does ft_channelrepair on a data set, >> >> since this function appends the repaired channels to the end of the >> >> data. So, if you have done ft_channelrepair on only a subset of your >> >> subjects' data, and/or used ft_channelrepair to repair different >> >> channels in different subjects, and subsequently passed the repaired >> >> data sets to ft_freqstatistics, there is a good chance the results you >> >> got were wrong. >> >> >> >> Most likely, this bug was introduced with revision 4101, in september >> >> 2011, so it has been in the code for quite a while. Note that >> >> ft_channelrepair only supports repairing missing channels since >> >> revision 5216 (february 2012), and that this was advised against until >> >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> >> was implemented. >> >> >> >> The fix has been implemented and is now available from the FTP server >> >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> >> available on the /home/common/ version of FieldTrip). Note that >> >> ft_selectdata_old still does not work correctly, this is something we >> >> will fix in the near future (ft_selectdata_old is deprecated). We >> >> fixed the behaviour of ft_appendfreq (the preferred replacement >> >> function for ft_selectdata_old when appending freq structures) and >> >> changed ft_freqstatistics to use this function instead. >> >> >> >> The other statistics functions, ft_timelockstatistics and >> >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> >> you to upgrade to the latest version of FieldTrip. If the situation >> >> described above applies to you, you will need to redo your >> >> channel-level (time-)frequency statistics analyses. >> >> >> >> Details on the bug (and a test script) can be found here: >> >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> >> problems related to the bug, please post them there. >> >> >> >> We sincerely apologise for this bug and any trouble it might have >> >> caused. >> >> >> >> Best, >> >> On behalf of the FT core development team, >> >> >> >> Eelke >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > -- >> > Ingrid Nieuwenhuis PhD >> > Postdoctoral Fellow >> > Sleep and Neuroimaging Laboratory >> > Department of Psychology >> > University of California, Berkeley >> > California 94720-1650 >> > Tolman Hall, room 5305 >> > >> > >> > _______________________________________________ >> > 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 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From singhharsimrat at gmail.com Mon Mar 25 18:35:42 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Mon, 25 Mar 2013 17:35:42 +0000 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems Message-ID: Hi All I think I have a problem with ft_selectdata. Data Background: I have 4 class data but i am just doing classification (multivariate analysis) between the first two classes with 13 and 20 trials each. After the ft_freqanalysis - all the trials are contained in tf - and tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have one channel as I removed others. When I use tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); to get trials for only the first class I get label: {32x1 cell} dimord: 'rpt_chan_freq_time' freq: [10.5000 12.5000 14.5000] time: [0.3000 0.4000 0.5000 0.6000] powspctrm: [4-D double] cumtapcnt: [13x3 double] cfg: [1x1 struct] Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as tf.powspctrm Similarly, for trials of class 2 tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); Again, the size of tf2 is same as tf1 which is same as tf The only difference in the structure is tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. The first question is- How does ft_freqstatistics handle tf1.cumtapcnt, when I use stat = ft_freqstatistics(cfg,tf1,tf2) Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of tf1? This only works if I design the label as cfg. design = [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' its size is 73*2 =146 Problem: My total relevant trials are just 13 (class 1) + 20(class2) = 33 for both classes and not 146. I suspect I making a mistake somewhere as in ideal case, I should be designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); 2*ones(size(tf2.cumtapcnt,1),1)]' size(cg.design) should be 33 and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size [20 1 3 4] So after doing ft_selectdata, ft_freqstatistics should be handling 33 trials - with 13 from first class, 20 from other class. But now it has full 146 trials even after doing ft_selectdata. I will be very grateful for any help. Best regards Harsimrat On 21 March 2013 08:34, Eelke Spaak wrote: > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data for some > > subjects and subsequently used ft_freqstatistics. However, the channel > order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, thus the > > repaired channels were NOT appended to the end of the data. So apparently > > ft_channelrepair not always appends the repaired channels at the end. I > > suppose this is good news for me, meaning that the bug did not affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is indeed > changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will not have > >> had any effect. However, one important case in which channel ordering > >> *will* be different is when one does ft_channelrepair on a data set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the repaired > >> data sets to ft_freqstatistics, there is a good chance the results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might have > caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Mar 26 08:50:47 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 26 Mar 2013 08:50:47 +0100 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems In-Reply-To: References: Message-ID: <51515357.8090908@donders.ru.nl> Dear Harsimrat, Actually, both cumtapcnt and powspctrm should be subselected. The problem most likely comes from the fact that your data has 32 labels but in powspctrm only one channel left (dimord is rpt_chan_freq_time, dimension of powspctrm is 73 x 1 x 2 x 3, but you have 32 labels). Whatever you did to your data, you made it inconsistent. A way to solve this is to make the label fields have the sime size as powspctrm. A better way would be to find out what made them inconsistent. Not sure about freq and time here, because you mention that these dimension are alright for your tf matrix. That should solve it. ft_selectdata works with all our test data. If not, let us know or send me a snippet of your data together with some code to reproduce this error and I can have a more thorough look. Best, Jörn On 3/25/2013 6:35 PM, Harsimrat Singh wrote: > Hi All > > I think I have a problem with ft_selectdata. > > Data Background: I have 4 class data but i am just doing > classification (multivariate analysis) between the first two classes > with 13 and 20 trials each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I > have one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of > tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > Problem: > My total relevant trials are just 13 (class 1) + 20(class2) = 33 for > both classes and not 146. > I suspect I making a mistake somewhere as in ideal case, I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size > [20 1 3 4] > > So after doing ft_selectdata, ft_freqstatistics should be handling 33 > trials - with 13 from first class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > On 21 March 2013 08:34, Eelke Spaak > wrote: > > Hi Ingrid, > > Thanks for your question; it made me realize that my e-mail was not > clear enough. In your case, when you repaired channels that were still > present in the data, the output channel order of ft_channelrepair will > be the same as the input channel order. > > The problem only occurs if you use ft_channelrepair to repair > *missing* channels, so e.g. channels switched off during acquisition > or that were discarded during preprocessing. > > Groeten, > Eelke > > On 20 March 2013 20:55, Ingrid Nieuwenhuis > > wrote: > > Hi Eelke, > > > > Thanks for reporting. I did do ft_channelrepair on my EEG data > for some > > subjects and subsequently used ft_freqstatistics. However, the > channel order > > is indentical in all my subjects in the freq. > > > > I repaired bad channels using the default setting > (method='nearest'). The > > bad channels were included in the input data to ft_channelrepair > (so they > > were not missing). I just checked, and in data_out after > ft_channelrepair, > > the order of the labels of the data is identical to the data_in, > thus the > > repaired channels were NOT appended to the end of the data. So > apparently > > ft_channelrepair not always appends the repaired channels at the > end. I > > suppose this is good news for me, meaning that the bug did not > affect me, > > since the channels were ordered identically when calling > ft_freqstatistics. > > Do you agree, or am I missing something? And for others that used > > ft_channelrepair, might be worth checking if the ordering is > indeed changed > > after calling it, because it appears not always to be the case. > > > > Thanks, > > Ingrid > > > > > > On 3/20/2013 2:01 AM, Eelke Spaak wrote: > >> > >> Dear FieldTrip community, > >> > >> Short version: if you did ft_freqstatistics across subjects with a > >> different channel ordering across data sets (which is the case > if you > >> use ft_channelrepair), your results might have been erroneous. Read > >> the following carefully. > >> > >> Yesterday, we discovered a possibly severe bug in a utility > function > >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug > >> entails that ft_selectdata_old assumes that the channels in all > data > >> input arguments are ordered identically, and does not take into > >> account the order of the data.label field. This means that when > >> several data input arguments with different channel orderings are > >> passed to ft_selectdata_old, the resulting output structure (with a > >> newly added 'rpt' dimension) will contain wrong data (i.e. data for > >> channel X might end up in another channel Y). Importantly, the same > >> thus holds for ft_freqstatistics: when doing statistics across > >> subjects, if the different subjects' data sets have different > channel > >> orderings, the resulting statistics will be wrong. > >> > >> We expect that in many cases, the channel ordering across different > >> data sets will be identical, and in those cases this bug will > not have > >> had any effect. However, one important case in which channel > ordering > >> *will* be different is when one does ft_channelrepair on a data > set, > >> since this function appends the repaired channels to the end of the > >> data. So, if you have done ft_channelrepair on only a subset of > your > >> subjects' data, and/or used ft_channelrepair to repair different > >> channels in different subjects, and subsequently passed the > repaired > >> data sets to ft_freqstatistics, there is a good chance the > results you > >> got were wrong. > >> > >> Most likely, this bug was introduced with revision 4101, in > september > >> 2011, so it has been in the code for quite a while. Note that > >> ft_channelrepair only supports repairing missing channels since > >> revision 5216 (february 2012), and that this was advised > against until > >> revision 6100 (june 2012), when the algorithm for doing so sensibly > >> was implemented. > >> > >> The fix has been implemented and is now available from the FTP > server > >> as of fieldtrip-20130319 (Donders users: the fix is automatically > >> available on the /home/common/ version of FieldTrip). Note that > >> ft_selectdata_old still does not work correctly, this is > something we > >> will fix in the near future (ft_selectdata_old is deprecated). We > >> fixed the behaviour of ft_appendfreq (the preferred replacement > >> function for ft_selectdata_old when appending freq structures) and > >> changed ft_freqstatistics to use this function instead. > >> > >> The other statistics functions, ft_timelockstatistics and > >> ft_sourcestatistics, were not affected by this bug. We strongly > advise > >> you to upgrade to the latest version of FieldTrip. If the situation > >> described above applies to you, you will need to redo your > >> channel-level (time-)frequency statistics analyses. > >> > >> Details on the bug (and a test script) can be found here: > >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any > >> problems related to the bug, please post them there. > >> > >> We sincerely apologise for this bug and any trouble it might > have caused. > >> > >> Best, > >> On behalf of the FT core development team, > >> > >> Eelke > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Ingrid Nieuwenhuis PhD > > Postdoctoral Fellow > > Sleep and Neuroimaging Laboratory > > Department of Psychology > > University of California, Berkeley > > California 94720-1650 > > Tolman Hall, room 5305 > > > > > > _______________________________________________ > > 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 > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Tue Mar 26 19:24:51 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Tue, 26 Mar 2013 19:24:51 +0100 Subject: [FieldTrip] problem use OpenMEEG In-Reply-To: References: Message-ID: hi Alexandra, can you try to run system ('om_assemble' ) from the folder where you installed OpenMEEG. FYI that's the trick Brainstorm uses to run OpenMEEG, it changes the current directory when calling the commands. hope this helps, Alex On Sun, Mar 24, 2013 at 10:49 PM, alexandra koulouri wrote: > Hi, > > I would like to run the test example for the OpenMEEG. > I followed the instructions and I installed the OpenMEEG.exe (Windows 8) > > However, when I wrote: > system ('om_assemble' ) > I receive this: > 'om_assemble' is not recognized as an internal or external command, > operable program or batch file. > > During the installation, I selected the option add path to windows for all > users > and there was the following warning: > Warning! PATH too long installer unable to modify PATH! > > I am guessing that's the reason why it doesn't work and probably I need to > change the path manually. > But I don't know what I need to do. > Any suggestions? > > many thanks, > Alexandra > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From candoosy at telus.net Wed Mar 27 00:24:40 2013 From: candoosy at telus.net (Jim McKay) Date: Tue, 26 Mar 2013 16:24:40 -0700 Subject: [FieldTrip] Calculating goodness of fit Message-ID: <51522E38.8040309@telus.net> Hello Fieldtrippers, I am trying to figure out how to calculate the goodness of fit (gof) after a dipole fit on MEG data. The equation for gof has two input variables, the measured data vector and the model data vector from the EC dipole fit. The measured data vector is easy, but I am confused which vector to use for the model data, which is a vector of length (1:Num_sensors). If dip1 is the output from the ft_dipolefitting function, candidates are: dip1.Vdata - perhaps this is the measured data? dip1.Vmodel - sounds promising? dip1.dip.pot - or maybe this? Can someone please clarify what vector to use? Cheers, Jim -- Jim McKay Candoo Systems Inc. - Magnetic field & vibration sensors, systems, and site surveys Tel. 778-840-0361 jim.mckay at candoosys.com www.candoosys.com From singhharsimrat at gmail.com Wed Mar 27 13:54:44 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 27 Mar 2013 12:54:44 +0000 Subject: [FieldTrip] ft_selectdata, ft_freqstatistics problems In-Reply-To: <51515357.8090908@donders.ru.nl> References: <51515357.8090908@donders.ru.nl> Message-ID: Thanks for your help Jorn It now works ok. Best regards Harsimrat On 26 March 2013 07:50, "Jörn M. Horschig" wrote: > Dear Harsimrat, > > Actually, both cumtapcnt and powspctrm should be subselected. The problem > most likely comes from the fact that your data has 32 labels but in > powspctrm only one channel left (dimord is rpt_chan_freq_time, dimension of > powspctrm is 73 x 1 x 2 x 3, but you have 32 labels). Whatever you did to > your data, you made it inconsistent. A way to solve this is to make the > label fields have the sime size as powspctrm. A better way would be to find > out what made them inconsistent. Not sure about freq and time here, because > you mention that these dimension are alright for your tf matrix. > That should solve it. ft_selectdata works with all our test data. If not, > let us know or send me a snippet of your data together with some code to > reproduce this error and I can have a more thorough look. > > Best, > Jörn > > > > On 3/25/2013 6:35 PM, Harsimrat Singh wrote: > > Hi All > > I think I have a problem with ft_selectdata. > > Data Background: I have 4 class data but i am just doing classification > (multivariate analysis) between the first two classes with 13 and 20 trials > each. > After the ft_freqanalysis - all the trials are contained in tf - and > tf.powsctrm is 4D (73*1*3*4) - [trials, channel, freq, time] - Here, I have > one channel as I removed others. > When I use > tf1 = ft_selectdata(tf, 'rpt', data1.trlvec(1:end)); > to get trials for only the first class > I get > label: {32x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [10.5000 12.5000 14.5000] > time: [0.3000 0.4000 0.5000 0.6000] > powspctrm: [4-D double] > cumtapcnt: [13x3 double] > cfg: [1x1 struct] > Now, the size of tf1.powspctrm is (73, 1, 2, 3) which is same as > tf.powspctrm > Similarly, for trials of class 2 > tf2 = ft_selectdata(tf, 'rpt', data2.trlvec(1:end)); > Again, the size of tf2 is same as tf1 which is same as tf > The only difference in the structure is > tf2.cumtapcnt which is 20 for tf2, 13 for tf1 and 73 for tf. > > The first question is- > How does ft_freqstatistics handle tf1.cumtapcnt, when I use > stat = ft_freqstatistics(cfg,tf1,tf2) > Is tf1. cumtapcnt telling the ft_freqstatistics which trials to use of > tf1? > This only works if I design the label as > cfg. design = > [ones(size(tf1.powspctrm,1),1);2*ones(size(tf2.powspctrm,1),1)]' > its size is 73*2 =146 > > Problem: > My total relevant trials are just 13 (class 1) + 20(class2) = 33 for both > classes and not 146. > I suspect I making a mistake somewhere as in ideal case, I should be > designing cgf.design = [ones(size(tf1.cumtapcnt,1),1); > 2*ones(size(tf2.cumtapcnt,1),1)]' > size(cg.design) should be 33 > and tf1.powspctrm should have size [13 1 3 4] and tf2 should have size > [20 1 3 4] > > So after doing ft_selectdata, ft_freqstatistics should be handling 33 > trials - with 13 from first class, 20 from other class. > But now it has full 146 trials even after doing ft_selectdata. > I will be very grateful for any help. > > Best regards > Harsimrat > > On 21 March 2013 08:34, Eelke Spaak wrote: > >> Hi Ingrid, >> >> Thanks for your question; it made me realize that my e-mail was not >> clear enough. In your case, when you repaired channels that were still >> present in the data, the output channel order of ft_channelrepair will >> be the same as the input channel order. >> >> The problem only occurs if you use ft_channelrepair to repair >> *missing* channels, so e.g. channels switched off during acquisition >> or that were discarded during preprocessing. >> >> Groeten, >> Eelke >> >> On 20 March 2013 20:55, Ingrid Nieuwenhuis >> wrote: >> > Hi Eelke, >> > >> > Thanks for reporting. I did do ft_channelrepair on my EEG data for some >> > subjects and subsequently used ft_freqstatistics. However, the channel >> order >> > is indentical in all my subjects in the freq. >> > >> > I repaired bad channels using the default setting (method='nearest'). >> The >> > bad channels were included in the input data to ft_channelrepair (so >> they >> > were not missing). I just checked, and in data_out after >> ft_channelrepair, >> > the order of the labels of the data is identical to the data_in, thus >> the >> > repaired channels were NOT appended to the end of the data. So >> apparently >> > ft_channelrepair not always appends the repaired channels at the end. I >> > suppose this is good news for me, meaning that the bug did not affect >> me, >> > since the channels were ordered identically when calling >> ft_freqstatistics. >> > Do you agree, or am I missing something? And for others that used >> > ft_channelrepair, might be worth checking if the ordering is indeed >> changed >> > after calling it, because it appears not always to be the case. >> > >> > Thanks, >> > Ingrid >> > >> > >> > On 3/20/2013 2:01 AM, Eelke Spaak wrote: >> >> >> >> Dear FieldTrip community, >> >> >> >> Short version: if you did ft_freqstatistics across subjects with a >> >> different channel ordering across data sets (which is the case if you >> >> use ft_channelrepair), your results might have been erroneous. Read >> >> the following carefully. >> >> >> >> Yesterday, we discovered a possibly severe bug in a utility function >> >> (ft_selectdata_old) which was used by ft_freqstatistics. The bug >> >> entails that ft_selectdata_old assumes that the channels in all data >> >> input arguments are ordered identically, and does not take into >> >> account the order of the data.label field. This means that when >> >> several data input arguments with different channel orderings are >> >> passed to ft_selectdata_old, the resulting output structure (with a >> >> newly added 'rpt' dimension) will contain wrong data (i.e. data for >> >> channel X might end up in another channel Y). Importantly, the same >> >> thus holds for ft_freqstatistics: when doing statistics across >> >> subjects, if the different subjects' data sets have different channel >> >> orderings, the resulting statistics will be wrong. >> >> >> >> We expect that in many cases, the channel ordering across different >> >> data sets will be identical, and in those cases this bug will not have >> >> had any effect. However, one important case in which channel ordering >> >> *will* be different is when one does ft_channelrepair on a data set, >> >> since this function appends the repaired channels to the end of the >> >> data. So, if you have done ft_channelrepair on only a subset of your >> >> subjects' data, and/or used ft_channelrepair to repair different >> >> channels in different subjects, and subsequently passed the repaired >> >> data sets to ft_freqstatistics, there is a good chance the results you >> >> got were wrong. >> >> >> >> Most likely, this bug was introduced with revision 4101, in september >> >> 2011, so it has been in the code for quite a while. Note that >> >> ft_channelrepair only supports repairing missing channels since >> >> revision 5216 (february 2012), and that this was advised against until >> >> revision 6100 (june 2012), when the algorithm for doing so sensibly >> >> was implemented. >> >> >> >> The fix has been implemented and is now available from the FTP server >> >> as of fieldtrip-20130319 (Donders users: the fix is automatically >> >> available on the /home/common/ version of FieldTrip). Note that >> >> ft_selectdata_old still does not work correctly, this is something we >> >> will fix in the near future (ft_selectdata_old is deprecated). We >> >> fixed the behaviour of ft_appendfreq (the preferred replacement >> >> function for ft_selectdata_old when appending freq structures) and >> >> changed ft_freqstatistics to use this function instead. >> >> >> >> The other statistics functions, ft_timelockstatistics and >> >> ft_sourcestatistics, were not affected by this bug. We strongly advise >> >> you to upgrade to the latest version of FieldTrip. If the situation >> >> described above applies to you, you will need to redo your >> >> channel-level (time-)frequency statistics analyses. >> >> >> >> Details on the bug (and a test script) can be found here: >> >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=2069 If you find any >> >> problems related to the bug, please post them there. >> >> >> >> We sincerely apologise for this bug and any trouble it might have >> caused. >> >> >> >> Best, >> >> On behalf of the FT core development team, >> >> >> >> Eelke >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > -- >> > Ingrid Nieuwenhuis PhD >> > Postdoctoral Fellow >> > Sleep and Neuroimaging Laboratory >> > Department of Psychology >> > University of California, Berkeley >> > California 94720-1650 >> > Tolman Hall, room 5305 >> > >> > >> > _______________________________________________ >> > 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 >> > > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricardoojm at gmail.com Wed Mar 27 17:10:05 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Wed, 27 Mar 2013 13:10:05 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel Message-ID: Dear all I am creating a BEM model for eeg, following the appropriate tutorial, but I have a problem when preparing the headmodel. The output I have from the ft_prepare_headmodel command does not contain the "mat", and so, when I try to generate the leadfield, it returns an error message due to non existent "mat". I saw that other users had similar problem, but I haven't found a solution though. So, what is wrong with my script? Thanks a lot in advance! Best, Ricardo load standard_mri.mat mri_orig=mri; disp(mri) % Segmenting the data cfg = []; cfg.output= {'scalp','skull','brain'}; segmentedmri = ft_volumesegment(cfg, mri_orig); disp(segmentedmri) save segmentedmri segmentedmri % MESH cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 1000]; bnd=ft_prepare_mesh(cfg,segmentedmri); disp(bnd(1)) % Head Model = variavel vol cfg = []; cfg.method ='bem_dipoli'; %dipoli singlesphere vol = ft_prepare_headmodel(cfg, segmentedmri); >> disp(vol) bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] skin_surface: 1 source: 3 type: 'dipoli' unit: 'mm' cfg: [1x1 struct] -------------- next part -------------- An HTML attachment was scrubbed... URL: From cas243 at georgetown.edu Wed Mar 27 20:30:15 2013 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Wed, 27 Mar 2013 15:30:15 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab Message-ID: Dear FieldTrip Community, I'd like to better understand the requirement that the calculation of coherence be averaged over > 1 trials, a topic previously discussed on the FieldTrip discussion site (e.g. http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). I worked through the calculation of coherence for n=1 trials at two distinct channels manually (dividing the cross-spectrum by the mean of the power spectra), and indeed the value resolves to 1 as others have previously said it would (where the power spectra and cross spectrum were estimated with the multitaper method). However, I'm still confused because the Matlab function mscohere returns coherence values between 0 and 1 (less than 1) at each calculated frequency for an input of two single time series X and Y, e.g. two single time courses (from the same trial) at two distinct channels. I suspect this may be related to the method for estimating the power/cross spectral density in mscohere (Welch's averaged modified periodogram method) because if I estimate the cross-spectrum and power spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated option), then the coherence estimates are between 0 and 1 (not 1). Can someone please help me to understand this -- why would coherence be 1 using the multitaper method but not using Welch's method? I'd like to understand if coherence is fundamentally required to be estimated over multiple trials (at two distinct channels), or if the requirement for multiple trials is related to the method of calculating the spectra, and if so why that is the case. Thanks immensely, Clara From ith at deakin.edu.au Thu Mar 28 01:04:34 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Thu, 28 Mar 2013 00:04:34 +0000 Subject: [FieldTrip] Beamformer for ERP data Message-ID: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I am trying to do a LCMV beamformer analysis using the ft_sourceanalysis for a ERP data set. Finally I intend to extract the source waveforms using virtual electrodes. But as we can only do meaningful source localisation for a small time interval say (50ms), how can I construct the source time course for a longer post stimulus period (say 500ms)after doing beamforming for shorter (50ms) time intervals? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Mobile : +61430321972 Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From am236 at georgetown.edu Thu Mar 28 02:36:09 2013 From: am236 at georgetown.edu (Andrei Medvedev) Date: Wed, 27 Mar 2013 21:36:09 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab In-Reply-To: References: Message-ID: <51539E89.2040001@georgetown.edu> Dear Clara, As previously discussed, coherence, indeed, FUNDAMENTALLY requires to be calculated over several trials, and this maxim does not depend on the way you calculate it. Because, conceptually, coherence is a measure of phase STABILITY in time i.e., how much it changes from trial to trial. If you have just one trial, you cannot say how stable the phase relationship between two signals is: one trial gives you just one measurement of phase difference (at least, if you use a window-based spectral analysis such as FFT, wavelet, tapers etc; the alternative methods based on instantaneous phase such as Hilbert transform are beyond this discussion at this point). And this is why your manual estimate of coherence on a single trial gives you 1: it should be this way because the cross-spectrum over one trial normalized by the auto-spectra of two signals IDENTICALLY equals 1 (you can simply check it with the formula). Why then does the Matlab mscohere give you values less than 1 even for one trial? It is just because all Matlab spectral functions split your one trial into several sub-segments BY DEFAULT. To check this, you need to take a full control of mscohere (not to use the default values) and explicitly say what windows to use. As an example, you can take two random variables x and y 1000 points long assuming fsample=1000 (1 sec trial). Then calculate coh by two different calls of mscohere: 1) Coh = mscohere(x,y,1000,0,1000,1000); - forcefully take the whole trial without splitting it into smaller parts by default; 2) Coh = mscohere(x,y,500,0,500,1000); - splitting this one trial into two sub-trials 500 points each without overlap. And see what happens. Best, Andrei. On 3/27/2013 3:30 PM, Clara A. Scholl wrote: > Dear FieldTrip Community, > > I'd like to better understand the requirement that the calculation of > coherence be averaged over> 1 trials, a topic previously discussed on > the FieldTrip discussion site (e.g. > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). > > I worked through the calculation of coherence for n=1 trials at two > distinct channels manually (dividing the cross-spectrum by the mean of > the power spectra), and indeed the value resolves to 1 as others have > previously said it would (where the power spectra and cross spectrum > were estimated with the multitaper method). However, I'm still > confused because the Matlab function mscohere returns coherence values > between 0 and 1 (less than 1) at each calculated frequency for an > input of two single time series X and Y, e.g. two single time courses > (from the same trial) at two distinct channels. > > I suspect this may be related to the method for estimating the > power/cross spectral density in mscohere (Welch's averaged modified > periodogram method) because if I estimate the cross-spectrum and power > spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated > option), then the coherence estimates are between 0 and 1 (not 1). > Can someone please help me to understand this -- why would coherence > be 1 using the multitaper method but not using Welch's method? > > I'd like to understand if coherence is fundamentally required to be > estimated over multiple trials (at two distinct channels), or if the > requirement for multiple trials is related to the method of > calculating the spectra, and if so why that is the case. > > Thanks immensely, > Clara > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stan.vanpelt at fcdonders.ru.nl Thu Mar 28 08:57:23 2013 From: stan.vanpelt at fcdonders.ru.nl (Pelt, S. van (Stan)) Date: Thu, 28 Mar 2013 08:57:23 +0100 (CET) Subject: [FieldTrip] Beamformer for ERP data In-Reply-To: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> Message-ID: <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> Dear Imali, What you could do is the following: 1. determine the source of your activation by beamforming your 50ms time-interval data, or by doing a dipole fit on your ERP. 2. compute spatial filters at that location based on the covariance matrix of the data of the entire epoch you're interested in (e.g., 500ms pre until 500ms post stimulus onset). You could consider first bandpassing this data for the part of the spectrum that you are interested in (e.g. 13-28Hz for beta) . 3. create the virtual waveforms by multiplying the spatial filters with the band-passed data Hope that helps. Best, Stan -- Stan van Pelt, PhD Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstr. 46, D-60528 Frankfurt Phone: +49 (0)69 96769 517 Fax: +49 (0)69 96769 555 www.esi-frankfurt.de ----- Oorspronkelijk bericht ----- > Van: "IMALI THANUJA HETTIARACHCHI" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 28 maart 2013 01:04:34 > Onderwerp: [FieldTrip] Beamformer for ERP data > Dear Fieldtrippers, > I am trying to do a LCMV beamformer analysis using the > ft_sourceanalysis for a ERP data set. Finally I intend to extract the > source waveforms using virtual electrodes. > But as we can only do meaningful source localisation for a small time > interval say (50ms), how can I construct the source time course for a > longer post stimulus period (say 500ms)after doing beamforming for > shorter (50ms) time intervals? > Many thanks in advance > Kind regards > Imali > Imali Thanuja Hettiarachchi > PhD Candidate > Centre for Intelligent Systems research > Deakin University, Geelong 3217, Australia. > Mobile : +61430321972 > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > Description: Description: Description: > cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: From johanna.zumer at gmail.com Thu Mar 28 09:05:59 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 28 Mar 2013 09:05:59 +0100 Subject: [FieldTrip] Beamformer for ERP data In-Reply-To: <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> References: <5A1787011651BC42A4D41856DBC2E0607BFD8C2A@mbox-f-3.du.deakin.edu.au> <1862251443.359840.1364457443043.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Imali, In addition to Stan's good advice, you might also find better results by computing the covariance matrix from the unaveraged timelocked data, rather than the averaged ERP data. Cheers, Johanna 2013/3/28 Pelt, S. van (Stan) > Dear Imali, > > What you could do is the following: > 1. determine the source of your activation by beamforming your 50ms > time-interval data, or by doing a dipole fit on your ERP. > 2. compute spatial filters at that location based on the covariance matrix > of the data of the entire epoch you're interested in (e.g., 500ms pre until > 500ms post stimulus onset). You could consider first bandpassing this data > for the part of the spectrum that you are interested in (e.g. 13-28Hz for > beta). > 3. create the virtual waveforms by multiplying the spatial filters with > the band-passed data > > Hope that helps. > > Best, Stan > > -- > Stan van Pelt, PhD > Postdoctoral Scientist, Ernst Strüngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstr. 46, D-60528 Frankfurt > Phone: +49 (0)69 96769 517 > Fax: +49 (0)69 96769 555 > www.esi-frankfurt.de > > ------------------------------ > > *Van: *"IMALI THANUJA HETTIARACHCHI" > *Aan: *fieldtrip at science.ru.nl > *Verzonden: *Donderdag 28 maart 2013 01:04:34 > *Onderwerp: *[FieldTrip] Beamformer for ERP data > > > Dear Fieldtrippers, > > > > I am trying to do a LCMV beamformer analysis using the ft_sourceanalysis > for a ERP data set. Finally I intend to extract the source waveforms using > virtual electrodes. > > > > But as we can only do meaningful source localisation for a small time > interval say (50ms), how can I construct the source time course for a > longer post stimulus period (say 500ms)after doing beamforming for shorter > (50ms) time intervals? > > > > Many thanks in advance > > > > Kind regards > > Imali > > > > *Imali Thanuja Hettiarachchi* > > PhD Candidate > > Centre for Intelligent Systems research > > Deakin University, Geelong 3217, Australia. > > > > Mobile : +61430321972 > > Email: ith at deakin.edu.au > www.deakin.edu.au/cisr > > > > [image: Description: Description: Description: > cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] > > > > > > > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: not available URL: From jm.horschig at donders.ru.nl Thu Mar 28 09:43:29 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 28 Mar 2013 09:43:29 +0100 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <515402B1.3070700@donders.ru.nl> Hi Ricardo, I assume that you are using the dipoli method? I recently discovered that when the method fails, the error is caught and printed as a normal fprintf message to the command window. Most likely it complained about your segmentation or that something is wrong with the triangulation. I am not sure about the other BEM methods, but you can check the code whether a similar thing is done there. In my limited experience, independent of what BEM method you are using, this is solved by checking the segmentation again and making sure that all boundaries (skull, scalp, brain) are close, i.e. that there are no holes in the brain. Let me know if this is it for you. Best, Jörn On 3/27/2013 5:10 PM, Ricardo Moura wrote: > Dear all > I am creating a BEM model for eeg, following the appropriate tutorial, > but I have a problem when preparing the headmodel. The output I have > from the ft_prepare_headmodel command does not contain the "mat", and > so, when I try to generate the leadfield, it returns an error message > due to non existent "mat". I saw that other users had similar problem, > but I haven't found a solution though. So, what is wrong with my script? > > Thanks a lot in advance! > Best, > Ricardo > > > > > load standard_mri.mat > mri_orig=mri; > disp(mri) > > % Segmenting the data > cfg = []; > cfg.output= {'scalp','skull','brain'}; > segmentedmri = ft_volumesegment(cfg, mri_orig); > disp(segmentedmri) > save segmentedmri segmentedmri > > % MESH > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd=ft_prepare_mesh(cfg,segmentedmri); > disp(bnd(1)) > > % Head Model = variavel vol > cfg = []; > cfg.method ='bem_dipoli'; %dipoli singlesphere > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > >> disp(vol) > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > skin_surface: 1 > source: 3 > type: 'dipoli' > unit: 'mm' > cfg: [1x1 struct] > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From clara.scholl at gmail.com Thu Mar 28 14:12:39 2013 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Thu, 28 Mar 2013 09:12:39 -0400 Subject: [FieldTrip] Coherence in FieldTrip and mscohere in Matlab In-Reply-To: <51539E89.2040001@georgetown.edu> References: <51539E89.2040001@georgetown.edu> Message-ID: Dear Andrei, Thank you for guiding me through my point of confusion, I really appreciate your detailed consideration! Your response finally clarifies the situation for me. Thanks, Clara On Wed, Mar 27, 2013 at 9:36 PM, Andrei Medvedev wrote: > Dear Clara, > > As previously discussed, coherence, indeed, FUNDAMENTALLY requires to be > calculated over several trials, and this maxim does not depend on the way > you calculate it. Because, conceptually, coherence is a measure of phase > STABILITY in time i.e., how much it changes from trial to trial. If you have > just one trial, you cannot say how stable the phase relationship between > two signals is: one trial gives you just one measurement of phase difference > (at least, if you use a window-based spectral analysis such as FFT, wavelet, > tapers etc; the alternative methods based on instantaneous phase such as > Hilbert transform are beyond this discussion at this point). And this is why > your manual estimate of coherence on a single trial gives you 1: it should > be this way because the cross-spectrum over one trial normalized by the > auto-spectra of two signals IDENTICALLY equals 1 (you can simply check it > with the formula). > > Why then does the Matlab mscohere give you values less than 1 even for one > trial? It is just because all Matlab spectral functions split your one trial > into several sub-segments BY DEFAULT. To check this, you need to take a full > control of mscohere (not to use the default values) and explicitly say what > windows to use. > > As an example, you can take two random variables x and y 1000 points long > assuming fsample=1000 (1 sec trial). Then calculate coh by two different > calls of mscohere: > > 1) Coh = mscohere(x,y,1000,0,1000,1000); - forcefully take the whole trial > without splitting it into smaller parts by default; > > 2) Coh = mscohere(x,y,500,0,500,1000); - splitting this one trial into two > sub-trials 500 points each without overlap. > > And see what happens. > > Best, > Andrei. > > > > On 3/27/2013 3:30 PM, Clara A. Scholl wrote: >> >> Dear FieldTrip Community, >> >> I'd like to better understand the requirement that the calculation of >> coherence be averaged over> 1 trials, a topic previously discussed on >> the FieldTrip discussion site (e.g. >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-November/005923.html). >> >> I worked through the calculation of coherence for n=1 trials at two >> distinct channels manually (dividing the cross-spectrum by the mean of >> the power spectra), and indeed the value resolves to 1 as others have >> previously said it would (where the power spectra and cross spectrum >> were estimated with the multitaper method). However, I'm still >> confused because the Matlab function mscohere returns coherence values >> between 0 and 1 (less than 1) at each calculated frequency for an >> input of two single time series X and Y, e.g. two single time courses >> (from the same trial) at two distinct channels. >> >> I suspect this may be related to the method for estimating the >> power/cross spectral density in mscohere (Welch's averaged modified >> periodogram method) because if I estimate the cross-spectrum and power >> spectra in FieldTrip with cfg.method = 'mtmwelch_old' (a deprecated >> option), then the coherence estimates are between 0 and 1 (not 1). >> Can someone please help me to understand this -- why would coherence >> be 1 using the multitaper method but not using Welch's method? >> >> I'd like to understand if coherence is fundamentally required to be >> estimated over multiple trials (at two distinct channels), or if the >> requirement for multiple trials is related to the method of >> calculating the spectra, and if so why that is the case. >> >> Thanks immensely, >> Clara >> _______________________________________________ >> 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 From ricardoojm at gmail.com Thu Mar 28 18:39:37 2013 From: ricardoojm at gmail.com (Ricardo Moura) Date: Thu, 28 Mar 2013 14:39:37 -0300 Subject: [FieldTrip] non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: Hi Jörn, thank you very much for your response! I checked the segmentation and everything seems to be ok (as far as I can say... No error messages were shown during the processing and I checked the generated objects and plots). But I had a strange error while preparing the head model. Somehow the command cannot find the dipoli files, even thought they are really where they should be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue of what it means. And I am running this command on a ubuntu 12.04 32-bit. Do you have any idea of how I can solve it? Thanks once again,Best, Ricardo using the executable "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not found Warning: an error ocurred while running dipoli > In ft_headmodel_dipoli at 201 In ft_prepare_headmodel at 226 Error using fread Invalid file identifier. Use fopen to generate a valid file identifier. Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > In ft_headmodel_dipoli at 209 In ft_prepare_headmodel at 226 On 27 March 2013 13:10, Ricardo Moura wrote: > Dear all > I am creating a BEM model for eeg, following the appropriate tutorial, but > I have a problem when preparing the headmodel. The output I have from the > ft_prepare_headmodel command does not contain the "mat", and so, when I try > to generate the leadfield, it returns an error message due to non existent > "mat". I saw that other users had similar problem, but I haven't found a > solution though. So, what is wrong with my script? > > Thanks a lot in advance! > Best, > Ricardo > > > > > load standard_mri.mat > mri_orig=mri; > disp(mri) > > % Segmenting the data > cfg = []; > cfg.output= {'scalp','skull','brain'}; > segmentedmri = ft_volumesegment(cfg, mri_orig); > disp(segmentedmri) > save segmentedmri segmentedmri > > % MESH > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd=ft_prepare_mesh(cfg,segmentedmri); > disp(bnd(1)) > > % Head Model = variavel vol > cfg = []; > cfg.method ='bem_dipoli'; %dipoli singlesphere > vol = ft_prepare_headmodel(cfg, segmentedmri); > > > >> disp(vol) > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > skin_surface: 1 > source: 3 > type: 'dipoli' > unit: 'mm' > cfg: [1x1 struct] > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gregor.Volberg at psychologie.uni-regensburg.de Fri Mar 29 07:35:16 2013 From: Gregor.Volberg at psychologie.uni-regensburg.de (Gregor Volberg) Date: Fri, 29 Mar 2013 07:35:16 +0100 Subject: [FieldTrip] Antw: Re: non-existent mat in BEM headmodel In-Reply-To: References: Message-ID: <515544340200005700012398@gwsmtp1.uni-regensburg.de> Hi Ricardo, I have two hints that might help. Firstly, the segmentations and the corresponding meshes can not only intersect each other, but it can also happen that the generated meshes are self-intersecting. This can not be seen from the plots of the segmented brain. The probability for intersections is higher, in my experience, with finer mesh resolutions. You could try something like [800 800 600] instead of [3000 2000 1000]. I usually do some trial and error and then check the volumes with om_check_vol(vol), which will report any intersections and self-intersections in the meshes. The openmeeg plugin needs to be installed for that. Secondly, for to the '\tmp\xyz...': Some of the methods for generating headmodels (at least I know for dipoli and openmeeg) write large temporary files to the hard disk. They have a long random name in order to avoid that some other data is overwritten. These files might get very large, some GB, and they are written per default to \tmp. A while ago I had the problem the temporary files got larger than the space that our system administrator allowed for \tmp. The script ran without errors, but the mat in the resulting structure was empty. The solution was to change the file destination folder to something other than \tmp, which needs to be done directly within the code of the called function (there is no cfg-option or so for that). Hope that helps, Gregor -- Dr. rer. nat. Gregor Volberg ( mailto:gregor.volberg at psychologie.uni-regensburg.de ) University of Regensburg Institute for Experimental Psychology 93040 Regensburg, Germany Tel: +49 941 943 3862 Fax: +49 941 943 3233 http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html >>> Ricardo Moura 28.03.2013 18:39 >>> Hi Jörn, thank you very much for your response! I checked the segmentation and everything seems to be ok (as far as I can say... No error messages were shown during the processing and I checked the generated objects and plots). But I had a strange error while preparing the head model. Somehow the command cannot find the dipoli files, even thought they are really where they should be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'") I really have no clue of what it means. And I am running this command on a ubuntu 12.04 32-bit. Do you have any idea of how I can solve it? Thanks once again,Best, Ricardo using the executable "/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli" /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3: /tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: /usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not found Warning: an error ocurred while running dipoli > In ft_headmodel_dipoli at 201 In ft_prepare_headmodel at 226 Error using fread Invalid file identifier. Use fopen to generate a valid file identifier. Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. > In ft_headmodel_dipoli at 209 In ft_prepare_headmodel at 226 On 27 March 2013 13:10, Ricardo Moura wrote: Dear all I am creating a BEM model for eeg, following the appropriate tutorial, but I have a problem when preparing the headmodel. The output I have from the ft_prepare_headmodel command does not contain the "mat", and so, when I try to generate the leadfield, it returns an error message due to non existent "mat". I saw that other users had similar problem, but I haven't found a solution though. So, what is wrong with my script? Thanks a lot in advance! Best, Ricardo load standard_mri.mat mri_orig=mri; disp(mri) % Segmenting the data cfg = []; cfg.output= {'scalp','skull','brain'}; segmentedmri = ft_volumesegment(cfg, mri_orig); disp(segmentedmri) save segmentedmri segmentedmri % MESH cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 ( tel:%5B3000%202000 ) 1000]; bnd=ft_prepare_mesh(cfg,segmentedmri); disp(bnd(1)) % Head Model = variavel vol cfg = []; cfg.method ='bem_dipoli'; %dipoli singlesphere vol = ft_prepare_headmodel(cfg, segmentedmri); >> disp(vol) bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] skin_surface: 1 source: 3 type: 'dipoli' unit: 'mm' cfg: [1x1 struct] -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Sat Mar 30 15:07:44 2013 From: mengtongxiao at gmail.com (=?GB2312?B?s8LRqQ==?=) Date: Sat, 30 Mar 2013 22:07:44 +0800 Subject: [FieldTrip] can do i use this tool do power envelope correlation Message-ID: Dear all, I see the ft_connectivityanalys could do 'powcorr',I would like to confirm whether is power envelope correlation. thanks, best xiao. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Sat Mar 30 15:28:59 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 30 Mar 2013 15:28:59 +0100 Subject: [FieldTrip] can do i use this tool do power envelope correlation In-Reply-To: References: Message-ID: Dear Xiao, Indeed, ft_connectivityanalysis with cfg.method='powcorr' computes power envelope (i.e. amplitude envelope squared) correlation. Best, Eelke On 30 March 2013 15:07, 陈雪 wrote: > Dear all, > > I see the ft_connectivityanalys could do 'powcorr',I would like to confirm > whether is power envelope correlation. > > thanks, > best > > xiao. > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip