Back to the main page.

Bug 1073 - TIP of the Day: "Do you know..." any?

Status CLOSED FIXED
Reported 2011-10-25 14:05:00 +0200
Modified 2019-08-10 11:46:25 +0200
Product: FieldTrip
Component: documentation
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 enhancement
Assigned to: Stephen Whitmarsh
URL:
Tags:
Depends on:
Blocks:
See also:

Stephen Whitmarsh - 2011-10-25 14:05:46 +0200

Dear FT users, developers, bug reporters and fans, For our annual group meeting we will do a grabbelton ('lucky grab'), the idea being to randomily pick questions and practical tips to read out loud and (in case of the former) to answer them together with the group. We are still in desparate need of more *tips* though. Everyone has probably some tips and tricks that would be great to share! Once we have enough we could use these on the FT wiki? So if you have the time this week, please take a moment to think of one (or more) practical tip(s) concerning MEG/EEG analysis, recording etc., FT analysis, Matlab issues, or even other practical tips concerning research in general, Windows/Linux hotkeys, anything really! It can also be fun! Please phrase them in the form of "Did you know ... ?" Thank you!


Robert Oostenveld - 2011-10-26 09:52:46 +0200

Good idea! Here are some small tips - configure MATLAB to use windows keybindings on its Linux version (default is emacs keybindings) - start a VNC server on mentat001 or mentat002 and use "ssh -x `martini` matlab2010b" to start matlab on the best mentat node. - use qsubcellfun to speed up your analysis by distributing the computational load of subjects and/or conditions and/or different settings on the cluster - use cfg.checkconfig='pedantic' in all your fieldtrip functions to ensure that you are using the correct cfg options


Roemer van der Meij - 2011-10-26 11:06:04 +0200

Ooh, fun! - when using single/multiplotTFR, use cfg.maskstyle = 'saturation' to avoid openGL artifacts in matlab when saving to *.eps. - when still having display issues, do a set(gcf, 'renderer', 'zbuffer') to avoid more matlab bugs - when using a statistical mask of 0's and 1' when plotting, transform it to e.g. 0.7's and 1's to get an opacity mask ((mask .* 3) + 0.7). You can also do this when cfg.maskstyle = 'saturation' - when zero-padding data for frequency analysis, pad to a power of 2 to greatly speed up computation (cfg.pad = nextpow2(max(cellfun(@numel,data.time)))) - as a power-user, check for undocumented and unsupported options in the function m-file, just below the normal documentation


Arjen Stolk - 2011-10-26 11:22:00 +0200

Always inspect your absolute powerspectra (see BBM november 24th 2011, yet to come)


Stephen Whitmarsh - 2011-11-01 09:05:06 +0100

Thanks friends! Those are great!


Stephen Whitmarsh - 2011-11-29 12:06:50 +0100

These where all the tips in the end: Tip: Did you know you can configure MATLAB to use windows keybindings on its Linux version (default is emacs keybindings)? Tip: Did you know that if you start a VNC server on mentat001 or mentat002 using "ssh -x `martini` matlab2010b" you start a matlab on the best mentat node? Tip: Did you know you can use qsubcellfun to speed up your analysis by distributing the computational load of subjects and/or conditions and/or different settings on the cluster? Tip: Did you know you can use cfg.checkconfig='pedantic' in all your fieldtrip functions to ensure that you are using the correct cfg options? Tip: Did you know that when using single/multiplotTFR, you can use cfg.maskstyle = 'saturation' to avoid openGL artifacts in matlab when saving to *.eps.If you still have display issues, do a set(gcf, 'renderer', 'zbuffer') to avoid more matlab bugs? Tip: Did you know that when using a statistical mask of 0's and 1' when plotting, you can transform it to e.g. 0.7's and 1's to get an opacity mask ((mask .* 3) + 0.7). You can also do this when cfg.maskstyle = 'saturation'? Tip: Did you know that when zero-padding data for frequency analysis, you can pad to a power of 2 to greatly speed up computation (cfg.pad = nextpow2(max(cellfun(@numel,data.time))))? Tip: Did you know that as a power-user you can check for undocumented and unsupported options in the function m-file, just below the normal documentation? Tip: Did you know you should always inspect your absolute powerspectra ? Tip: Did you know Inkscape is a powerful (and free) Scalable Vector Graphics (SVG) program to use instead of Adobe Illustrator? Tip: Did you know GIMP is a powerful (and free) program to use instead of Adobe Photoshop? Tip: PubCrawler is a free "alerting" service that scans daily updates to PubMed ( http://pubcrawler.gen.tcd.ie/ ) according to your predefined search parameters? Tip: Did you know that if you want a legal version of Matlab on your personal laptop you can get yourself to the Huygens building, say you work at the Donders and need Matlab. They'll borrow you the proper installation cd and give you online access to the Radboud license server? Tip: Did you know that you can use the mean position of the subject over trials, instead of the initial position, for the source localization later on? (using CTF software) Tip: Did you know that regression/correlation analysis is a nice tool to avoid baseline correction of amplitude values? Requirement: some parametric factor in your design OR a gradual effect in your data; e.g. temporal evolution of alpha-lateralization between cue and target. Tip: Did you know that the brain produces oscillations of a certain AMPLITUDE, not POWER? For some of our analysis relating trial-specific MEG data to trial-specific behavior, amplitudes are the appropriate measure. Tip: Did you know that you can substantially reduce analysis time if you know where your activity of interest comes from? 1) use a localizer, 2) run a beamformer contrast and find voxel of interest, 3) get optimal spatial filter for this voxel, again using beamformer, 4) take real part of this filter and apply it to the time-domain data. 5) (frequency) analyze substatially (size) reduced time-domain data? Tip: Did you know mugs are often in the kitchen of the first floor? Tip: Did you know Leon always is short of trays? Tip: Did you know you: a) have to bring your cups from your office and the labs to the kitchen yourself? b) put them in the dishwasher yourself? c) if you are waiting - e.g. for water to boil - you can put other dishes in the dishwasher? Tip: Did you know testsubjects are allowed to park in front of the Donders (get a card at reception)? Tip: Did you know you can use the mailinglists that are on intranet, and if you want to be on one you can send an email to ADMIN@fcdonders.nl? Tip: Did you know you can use ADMIN@fcdonders.nl instead of only sending it to Tildie, Sandra or Nicole? Tip: Did you know you can use the pigeonhole of the administration - e.g. for informed consent - instead of disturbing them? Tip: Did you know there is a lot of useful info on the knowledge database on intranet? Tip: Did you know information on the sona test subject system is on intranet (reseach --> proefpersonen info)? Tip: Did you know it is very useful in your first year take your time to learn, ask questions in time, and don't become immobile (doormodderen)? Tip: Did you know you can copy-paste between VNC sessions now? Tip: Did you know that if you want to work on your social network, you should have lunch in the library at 12:30 (every day)? Tip: Did you know that a great way to get in shape is to join the runningclub (Monday and Thursday @ 17:00)? Tip: Did you know that if you want to work on your social network, you should join the Friday Afternoon Drink? Tip: Did you know you can test your experiment's response settings and BITSI/Presentation setup using a mini BITSI button box (get at TG) on your desktop computer / laptop? Tip: Did you know it may be more helpful and productive to NOT to work in the weekends? Tip: Did you know that investing in good contact with your colleges pays off when you have questions later on!? Tip: Did you know the TG is not the place to go with specific matlab questions? Tip: Did you know it pays of going to as many meetings as possible in your first year? Tip: Did you know the PHD management course is very good, and the sooner you take it the better? Especially since it addresses the relationship with your supervisor! Tip: Did you know you shouldn't make up your data? Tip: Did you know that the pants and shirts used for the MRI (found in the closet below the stairs) have EM chips in them that interfere with the MEG signal? Tip: Did you know that Sander washes the MEG textiles himself, and that you have to make sure there are clean ones beforehand. You can even wash them yourself! Tip: Did you know that the TG has walk-in hours? Tip: Did you know you should directly copy your data from the labs as its presence is not guaranteed? Tip: Did you know that by doing a baseline correction, you miss out on broad band gamma effects? So best it is best to make contrasts between 2 conditions without baseline correction. Both a prestimulus baseline and the whole trial as its own baseline will make the broad band gamma disappear! Tip: Did you know you can use foam padding when putting subjects in the MEG helmet, it really helps to keep their heads fixed. Do make sure you don't put the foam in between the back/top of the head and the helmet though, as that will reduce the signal; padding should mainly be to the side of subjects' heads? Tip: It is easy to do a proper calibration of the eyetracker in the MEG lab? Diego has written a nice MATLAB/Psychtoolbox script that presents dots to a subject on various locations on the screen, while at the same time sending out triggers to the Bitsi. Eelke has written a MATLAB/FieldTrip script that parses MEG data files containing these triggers, and performs linear regression to create a function that converts measured eyetracker voltages back to visual degrees. (For simple fixation/blink/movement detection, this conversion is usually not needed, by the way.) Tip: Did you know that subjects can make it better through the experiment if you have them close their eyes during the break? Their eyes do not dry out so much over the experiment. Also this makes them relax their muscles, especially in the neck-area. Tip: Did you know you can use Linux' md5sum to check the integrity of (data) files? Question: How can I best manage references, so what reference manager would you advise (Endnote, Zatero, or something else?) Tip: Did you know that when using Linux you can copy text by selecting it and pasting it by clicking the middle (scroll) button of the mouse? Question: How can I get the zlim scale displayed automatically without having to click on it every time I make a plot? Tip: Did you know that everything you ever wanted to know about signal processing (e.g. how does a FFT work) is explained fantastically in The Scientist and Engineer's Guide to Digital Signal Processing by Steven W. Smith, Ph.D., and is free online (www.dspguide.com )?


Roemer van der Meij - 2011-11-29 17:28:03 +0100

Now this I am curious about, who wrote this tip?: ******* Tip: Did you know that by doing a baseline correction, you miss out on broad band gamma effects? So best it is best to make contrasts between 2 conditions without baseline correction. Both a prestimulus baseline and the whole trial as its own baseline will make the broad band gamma disappear! ******* I do not see why either the non-oscillatory or oscillatory broadband gamma would suffer from a broad DC shift when you baseline your raw data, or when you baseline your frequency transformed data.


Stephen Whitmarsh - 2011-11-29 17:52:22 +0100

It was an anonymous contribution ;-) But yes, we did not take it for granted. But as she wasnt there when we did discussed them we couldnt ask for clarification.


Arjen Stolk - 2011-11-30 08:19:49 +0100

I guess with broadband gamma effects is meant 'broadband spectral changes'? Secondly, there's some truth in there as power-law scaling effects (the exponent x in P ~ A * f^-x; in a way also broaband) may disappear after baseline correction in some frequency bands. Illustration: spectrum baseline: - spectrum post baseline: \ where, left part is low freq, right part is high freq. Note that when each frequency is normalized by its value during a pretask baseline, this effectively removes the presence of the 1/f^x spectrum. This biases one to where the differences are largest and not to the underlying mechanism (like is done typically in ERPs and well, also frequency-analysis). Therefore, inspecting the absolute spectrum is strongly advised for getting a better feeling. (In reply to comment #7)


Roemer van der Meij - 2011-11-30 12:58:33 +0100

Ah, so we are talking about baselining spectrally resolved data. Even then though, if there are increases in broadband gamma post-stimulus, as in broadband increases in amplitude, it would be observable, also after baselining. That's why it's an increase, and an effect ;). It is not the power-law scaling that defines broadband 'gamma' increases, it is the change in power-law scaling after let's say 80ish Hz, that defines it. Broadband power increases are seen in power spectra by a 'tilting' around such a frequency, with a different X. A nice paper by Kai Miller shows this. (can't remember the year, but you know of I think no Arjen?). After baselining power-spectra, this would still be there. Unless I'm missing something obvious and have a board nailed to my face (which I hope is also an english expression). Regardless of that though, I'm always in favor of inspecting the rawest possible data forms ;).


Arjen Stolk - 2011-11-30 14:50:30 +0100

Basically, the amplitude A in the power-law formula (P ~ A * 1/f^x) reflects presynaptic spike firing rate (non-oscillatory effects - see Miller's papers indeed). The exponent x is indeed known to be different below (1/f^2) and above (1/f^4) the knee at around 80 Hz. The frequency-location of the knee depends on the decay timescale of synaptic influx/efflux processes. These processes namely act as a low-pass filter effectively taking signal energy from 80 Hz and up. Also the loss across the dendritic membrane (decay time of say 100ms) has a low-pass characteristic. This process is the last to cause the 1 over f effects. I just gave a BBM on this topic, too bad you missed it. :) In theory, if only A increases, one should see this at all frequencies, even after ft_freqbaseline. Problematic is in practice that both oscillatory and non-oscillatory sources contribute to your LFP, and thus end up in your powerspectrum. Rhythms, when present, typically have a strong influence and modulations in them are evident. After baselinecorrection and within plotting we typically use a 'minmax' style and focus on a relatively short frequencyrange. It may thus be hard to still see the underlying 'broadband shift'. (In reply to comment #9)


Roemer van der Meij - 2011-11-30 18:46:40 +0100

Oooh, mighty interesting, too bad I missed it! I'm thinking a lot about this sort of stuff nowadays. Still though, I don't see a reason for the tip in question. If we don't see it because you are focusing on small ranges, sure, but that doesn't have anything with baselining. If A increases after post-stimulus, you will see it after baselining. If the specific range is swamped by the usually bigger oscillatory peaks, sure, it would be more difficult to see. Which would be exaggerated more after baselining. But that also holds for the comparing between conditions and basically every other way of inspecting the data. So, still curious :). Sorry for derailing this wonderful 'thread' of yours Stephen :). But, still surprised!


Robert Oostenveld - 2019-08-10 11:46:25 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.