Back to the main page.

Bug 1718 - create a lcmv tutorial based on Johanna's SEF data

Reported 2012-09-19 15:01:00 +0200
Modified 2020-10-29 16:02:38 +0100
Product: FieldTrip
Component: documentation
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Jan-Mathijs Schoffelen - 2012-09-19 15:01:12 +0200

look at the other source reconstruction tutorials for inspiration.

Johanna - 2012-09-19 16:16:32 +0200

Hi Arjen, I've put the SEF dataset and my structural MRI (I was the subject in the MEG) on home/common/temp /4arjen. I'm happy to help further if you want to discuss cfg options, etc.

Johanna - 2012-09-19 16:30:30 +0200

see also bug 1393

Arjen Stolk - 2013-01-15 21:34:47 +0100

Hey Johanna, Could you send me these files again (preferably highlighted by e-mail). I missed last call. ;)

Johanna - 2013-01-16 10:06:12 +0100

Hi Arjen, I've just put files up on common/tmp again. I have no idea if they are the same files as what I posted before! but they are indeed the SEF dataset refered to by the title of this bug.

Arjen Stolk - 2014-05-15 14:03:47 +0200

Created the following page: The data used is anonymized and uploaded to the ftp as 'Subject05'. Should be available online soon at: The pipeline runs smooth, to the point the MRI scan is segmented. The result looks awkward, and it needs fixing prior to continuing.

Arjen Stolk - 2014-05-15 14:04:13 +0200

Created attachment 626 segmented mri of subject05

Robert Oostenveld - 2014-05-15 14:16:34 +0200

if possible, I suggest to rename the data to SubjectSEF or so. Otherwise it might be confusing that it is part of Subject01 etc. The MRI seems to be due to intensity inhomogeneity. Correcting for image inhomogeneity is (I think) a standard step in (f)MRI analysis, however, us MEG folks never do it. See It has nice equations ;-)

Arjen Stolk - 2014-05-15 14:47:34 +0200

Thanks, Robert. ft_determine_coordsys showed that the mri was incorrectly realigned (left and right dimensions flipped). After correct realignment, the segmented mri looks as attached below. Subject05 has been renamed to SubjectSEF, and uploaded to the ftp.

Arjen Stolk - 2014-05-15 14:48:08 +0200

Created attachment 627 segmented mri of SubjectSEF

Arjen Stolk - 2014-05-15 15:46:24 +0200 runs todo: play around with source results

Robert Oostenveld - 2014-05-16 09:36:36 +0200

On 15 May 2014, at 22:34, Stolk, A. (Arjen) wrote: de ruggengraat staat er wel zo'n beetje: het enige dat 'nog maar' gedaan moet worden, is een zinnige interpretatie van de source data. wat had je hier precies in gedachten? mocht je zelf met de data willen spelen, de data staat op de ftp en in /home/action/arjsto/bug1718 (de headmodel is al berekend: SubjectSEF_vol.mat). ------------ The data is not perfect (sorry Johanna) as it does not very clearly show the early component. I suggest linking to a publication such as to show how the MN activity is expected to look like. We can also consider using another dataset, such as the one used in the NatMEG tutorials

Robert Oostenveld - 2014-05-16 09:56:47 +0200

I have added a disclaimer to the work-in-progress wiki page and removed the tags, to make clear to accidental visitors that it is not yet finished.

Johanna - 2014-05-16 11:53:12 +0200

It doesn't look like MN data because it wasn't median nerve data! The tactile stimulus was a balloon diaphragm connected to a pneumatic tube, thus a pressure onto the finger. I expect the data to look as in Figures 4a and 5a from

Arjen Stolk - 2014-05-16 12:01:16 +0200

Haha :D

Robert Oostenveld - 2014-05-16 12:28:01 +0200

(In reply to Johanna from comment #13) aha, there the monkey comes out of the sleeve! That explains a lot. Yes, with appropriate filtering the data is actually quite similar as the figure 4 in the paper. I had contact with Daniel in Stockholm, and he has granted us the right to reuse their data for our documentation. I think that MN-SEF will be more appropriate for the purpose of the tutorial (which is mainly to look at timing at the source level, for which we would need clear S1 and S2). The NatMEG tutorial dataset consists in total of 4 datasets, all on the same subject. - one MN-SEF with oddball, quite large stimulus artefact - another MN-SEF, no oddball but random ISI, no artefact - visual attention task with grating, i.e. gamma - auditory oddball I'll add Stephen to the CC, so that he can follow.

Arjen Stolk - 2015-10-22 06:14:17 +0200

(In reply to Robert Oostenveld from comment #15) Hej Stephen, Do you happen to have a dataset with clear SEFs laying around somewhere on your Ikea desk? If so, please anonymize and upload, and replace 'SubjectSEF.ds' in .. and another tutorial good to go. Piece of Knäckebröd! Ciao! Arjen

Robert Oostenveld - 2015-10-22 09:33:30 +0200

(In reply to Arjen Stolk from comment #16) Just to inventorise: There was data recorded both for and One of them is formally described and defined with a tag, which is and was used for "stockholm2014q3". The actual data is on the ftp and here roboos@mentat001> pwd /home/common/matlab/fieldtrip/data/ftp/tutorial/natmeg roboos@mentat001> ll total 541820 drwxr-xr-x 2 roboos fieldtrip 4096 Sep 27 2014 beamforming drwxr-xr-x 2 roboos mrphys 24576 Dec 24 2014 dicom -rw-r--r-- 1 roboos mrphys 94638175 Oct 8 2014 drwxr-xr-x 2 roboos fieldtrip 4096 Sep 28 2014 dipolefitting -rw-r--r-- 1 roboos fieldtrip 457940745 Sep 25 2014 oddball1_mc_downsampled.fif drwxr-xr-x 2 roboos fieldtrip 4096 Sep 27 2014 preprocessing drwxr-xr-x 2 roboos fieldtrip 4096 Sep 25 2014 statistics drwxr-xr-x 2 roboos fieldtrip 4096 Sep 27 2014 timefrequency -rw-r--r-- 1 roboos mrphys 950 Oct 7 2014 trialfun_oddball_responselocked.m -rw-r--r-- 1 roboos fieldtrip 983 Oct 7 2014 trialfun_oddball_stimlocked.m The other one for "stockholm" is not formally described yet and not on the ftp. The documentation is on the natmeg wiki as plain html. For starters it would be good to make the naming scheme consistent between storage/ftp and wiki. We now have "natmeg" for one, and "stockholm2014q3" for the other. ... I just updated the wiki.

Robert Oostenveld - 2015-10-22 14:24:53 +0200

(In reply to Robert Oostenveld from comment #17) from the HTML documentation at ----------- The MEG data sets used in this tutorial are two recordings on the same subject during electrical stimulation of the Median Nerve (MN) of the left hand. The reason for the two recordings is that the first recording has a relatively large electrical stimulation artifact, which makes it less suitable for follow-up analysis. The second recording is much cleaner regarding the stimulus artifact, but does not have an experimental manipulation that is of much interest. Hence we will use both. The first experiment is an oddball task. A regular train of standard stimuli was presented with an occasional oddball. The oddball consisted of a missing stimulus, i.e. there is no stimulus presented at the expected time. The subject was instructed to count the number missing stimuli. In this experiment the oddball manipulation serves two purposes. First it ensures that the subject maintains a constant level attention to the stimulation; we know that the amplitude of the cortical responses depends on the level of attention. Second, the presence of oddballs allows us to study the brain activity related to the expectation of the stimuli. In the second experiment only normal stimuli were presented in a regular sequence with an inter-stimulus-interval (ISI) that was randomized between 1.9 and 2.1 seconds. The subject did not have an explicit task. In both cases the MEG signals were recorded with the NatMEG 306 sensor Neuromag Triux system. The Neuromag MEG system has 306 channels located at 102 unique locations in the dewar. Of these, 102 channels are axial magnetometer sensors that measure the magnetic field in the radial direction, i.e. orthogonal to the scalp. The other 2*102 channels are planar gradiometers, which measure the magnetic field gradient tangential to the scalp. The planar gradient MEG data has the advantage that the amplitude typically is the largest directly above a source. and then further down there is filename1 = 'somsen_run2_raw_tsss.fif'; filename2 = 'somstim_raw.fif'; and also Let us continue with dataset 1, which consists of standard stimuli and missing stimuli as oddballs. filename = filename1; ----------- I have both files. and then in there is another dataset ----------- We will work on a dataset of an visual change-detection experiment. Magneto-encephalography (MEG) data was collected using the 306-channel Neuromag Triux MEG system at NatMEG. The subject was instructed to fixate on the screen and press a left- or right-hand button upon a speed change of an inward moving stimulus Each trial started with the presentation of a cue pointing either rightward or leftward, indicating the response hand. Subsequently a fixation cross appeared. After a baseline interval of 1s, an inward moving circular sine-wave grating was presented. After an unpredictable delay, the grating changed speed, after which the subjects had to press a button with the cued hand. In a small fraction of the trials there was no speed change and subjects should not respond. and filename = 'workshop_visual_sss.fif'; ----------- which I also have. From I know that I have the MRI corresponding to the workshop_visual_sss.fif dataset. But I don't know whether that is the same subject as the one for the MN stimulation. I think it is not, but I also think that I do know who the other subject was...

Arjen Stolk - 2015-10-23 19:45:17 +0200

(In reply to Robert Oostenveld from comment #18) Thanks, Robert, for filling in. Stephen, I won't play in your backyard. Could you take this lcmv baby for a spin, and make a stockholm-based sef tutorial out of it?

Jan-Mathijs Schoffelen - 2020-10-29 16:02:22 +0100

I came across this 'bug' while working with Lau on Reading the (long) history of this bug, it seems that there is no genuine interest of the original stakeholders to take this to a higher level. The current version of the tutorial uses SEF data, and is I think OK to serve as a starting point for a tutorial that can be linked to the outside world (currently it is not linked). In light of the above PR I have already created a test function out of the code that has been written for the tutorial. I will close the bug here, there is no need to keep it open.