View Full Version : Rotated sensor locations
January 2nd, 2007, 02:47
After importing raw data and sensor locations I have come upon a problem. When loading the sensors locations in the surface manager together with the Phantom tessalations they look nicely aligned. When displaying the EEG activity on the tessalated brain, the locations are rotated about 90 degrees though. While overlaying the data on the 3d sensor cap show all sensors (by displaying labels) to be positioned fine, overlaying the data on the 2d sensor map or on the tessalated surfaces they are clearly (checking the labels or the activity, respectively) rotated. The nose points upwards on the 2d sensor map but the electrode positions are oriented to the left. Since loading the sensors in the surface manager shows them nicely aligned i dont know where to start looking.
Any help on this one would be greatly appreciated, if i can supply any helpful screenshots or files please let me know.
January 9th, 2007, 03:48
When in Neuromag referentials, overlaying the data (Data Viewer --> Data Viewing) in anything but the 2D layout the X and Y of the sensorpositions need to we swapped (at least with my data). The 2D layout is always swapped in respect to all the other overlays. I dont know if this i a bug or not but wanted to let you know anyway.
P.s. In Neuromag the option of swapping is offered, in the CTF referential it is not.
January 9th, 2007, 08:09
Thanks for reporting.
BST was essentially developped using CTF test run data. Hence it is not too robust as far as visualization in other referentials is concerned. At least to this date: we're making efforts to remove little bugs like the ones you've been identifying. We should be done soon !
January 9th, 2007, 08:57
Again, thanks a lot!
What exacly is the difference between the CTF and the neuromag referential? I just print x, y, z, positions in three columns to a .txt file and import them via the raw format. Looks like (because i need the x-y swapping) i should be using y x z positions though. I will be using the CTF from now on and will keep you posted.
Actually - forgive me for being too forward maybe - but what if you would extend the surface manager gui with an option to transform the sensor locations by hand: swapping, flipping, stretching, turning and going from spherical to ellipsoid parameters. It would give enough freedom to fit the electrode positions of any EEG cap to any tessalated scalp, at least to a very reasonable degree.
January 10th, 2007, 02:26
As for the coordinate systems in BST, have a look at the online doc: here (http://neuroimage.usc.edu/brainstorm/GUI_CoordinateSystem.htm).
January 12th, 2007, 04:10
I now did everything in CTF (the document cleared up all my questions) and it looks kinda neat!
I added the three fiducial points as EEG sensorpositions and use them to align with the tesselated surfaces and MR scans.
The alignment is a bit off though when looking at the positions of my EEG cap's fiducial points on the fiducial points added in the BS alignment GUI. The nasion overlaps nicely, but the auricular points do not match at all (on neither side). I've included a picture and the channelspositions matlab file for reference hoping it wil be of any help. Please note that the left and right fiducial points included in the channellist have to be switched when aligning as i still need to flip the Y-axis (Y to -Y).
January 12th, 2007, 04:12
and the channelfile,
January 12th, 2007, 05:20
thanks for the detailed reports! Don't expect that the fiducials match right from the start. these are labels than you need to pair together (one for the phantom, one from yoru channels) using the Align tool from form the surface manager. Once you are done pairing fiducials and as many electrodes as possible, then BST will warp the phantom anatomy to your channels, taking these pairs as control points.
Please try the full monty and see what happens. You might be facing some aweful distorsions but then you need to add/remove pairs and relaunch the warping you get something reasonable.
It's a bit tedious, but this is the price to pay to get at least 'some' anatomy for the subjects in the experiment.
May 4th, 2007, 10:37
Dear Stephen and Sylvain,
How do I enter EEG sensor positions? The tutorial is easy to follow but it only focusses on MEG, whose sensor positions are already predefined. And can sensor positions be user-modified?
Secondly, I have a suggestion. Sylvain, could you modify BrainStorm to import data from MATLAB variables, or could you show me how to do that?
Thanks and regards,
May 5th, 2007, 00:30
Ofcourse you can import you own channel positions. How to do that depends a bit on your data. If you're working the tutorial i would suggest you try the demo EEG set (EGI-something) you can download somewhere from the BS site. If i remember correctly you can import that data in RAW format. Channel positions are then read from a simple textfile with XYZ coordinates. Ofcourse if your own dataformat (what do you use?) is supported you can easily import your data+channelinformation via the Data Manager window.
For myself, i had to convert my data (from Brain Vision Analyser) to raw format and made a separate channelposition textfile. Because we use a custom cap (32+16 electrodes not in the 10-20 methode) i was lucky to be able to measure the positions with a Neuronav apparatus. If you use a standard 10-20 cap it shouldnt be that much of a problem getting your electrodepositions in a textfile though (you could try using the EEGlabs matlab toolbox - it can import most datafiles and export electrodepositions in an XYZ fashion to a textfile).
I hope this helps. Maybe i could say more if you could tell me exactly where your data is from.
May 7th, 2007, 01:44
For the Matlab-variable import, this is very easy to write your own data into the file formats read by BST. Just have a look at the files from the tutorial data and mimic their structure.
To help you with this, there is a bunch of m files which summarize the main BST file structures: check inside all the files with help_data_XXX.m
May 12th, 2007, 13:01
Hi stephenwhitmarsh and Sylvain,
Would you know the link to the EEG demo tutorial? I've spent the last hour looking for at at the BS webvsite and can't find it. Please help.
May 14th, 2007, 23:39
Hi Stephen and Sylvain,
My EEG data is in a text file. A standard 19-electrode 10-20 EEG cap was used. All I have is the text file with values for each channel.
I have still not found the EEG demo set so I am using the MEG demo set and tutorial and trying to adapt it to EEG. I have the following questions:
1. How do I modify the Mixed_brainstormstudy.mat for my EEG data? In fact, is this file necessary at all, and if not, how do I avoid using it? (It seems to simply state the title of the data, etc, while not offering any really useful data.)
2. The Mixed_channel_locations.txt file seems to have six coordinates for each sensor instead of the usual three (x, y, and z position). What do the six coordinates mean? Why six instead of three?
3. Do I need reference weights for EEG? What do they signify?
4. What is the importance of the Mixed_data_Trial1_time files?
Please help me.
Thanks and regards,
May 15th, 2007, 01:42
sorry for being late in responding. The EEG test run dataset is located in the Phantom Study (http://neuroimage.usc.edu/brainstorm/TutorialPhantomStudy.htm) section of the tutorial; and more explicitely here (http://neuroimage.usc.edu/brainstorm/tutorial/Data/EGIdemo.zip).
LEt me know if you need further help.
May 18th, 2007, 00:30
Thanks a lot, Sylvain.
I have gone through the EGI tutorial and it is very helpful. I think I now know how to enter my own electrode positions: by modifying the .sfp file or creating my own.
I do have some questions:
1. While trying to warp the Montreal Phantom to the electrodes, my electrodes seemed to be inside the head model, instead of the other way round. I have illustrated this in the attached document. Could you show me how to remedy that?
2. What program can I use to view the .raw files? Notepad does not to work and my computer (surprisingly) does not have Wordpad.
3. Like I said before, my data is in text files. It is eay to let MATLAB read text files. However, I would like to know how to convert those MATLAB variables into .raw filesor EGI format. I've checked the help_data_raw.m file but it is not too helpful.
Thanks and regards.
May 18th, 2007, 11:41
regarding your first question: please make sure your electrodes are 'aligned' with the template reference system. In order to do that, you need to know where the nasion and left/right ears are wrt to your electrode locations.
Details on the raw file format are provided at http://neuroimage.usc.edu/brainstorm/mFileHelp/5Toolbox/help_data_raw.html. Let me know what information you are missing from here.
September 24th, 2008, 07:32
For myself, i had to convert my datato raw format and made a separate channelposition textfile.
How exactly did you do the conversion??
I have a txt file with eeg values (32 electrodes) and i want to import it in brainstorm.
How can i do this please?
How are the values written in the raw file?