Inconsistencies with channel locations

Post Reply
akirkland
Posts: 3
Joined: Mon Oct 01, 2018 12:44 pm

Inconsistencies with channel locations

Post by akirkland »

Hi there,

I'm currently trying to make a .ced file for 128 electrodes. I have the excel file with the channel location information you provide, but looking at the .ced file I have for the 16 channel cap and comparing it to the location info in that excel document....yields utter confusion. I've seen some iteration of this come up various times after searching the forums, so hopefully I can provide a sufficiently detailed description of what exactly I'm looking for so that this can finally be sorted out.

The .ced file for the 16 channel biosemi cap contains the channel number and label and lists theta, radius, x, y, z, sph_theta, sph_phi and sp_radius (with the last three, I assume, being inclination, azimuth and radius respectively in the spherical coordinate system). So apparently these are the things I need to have for EEGLAB to read the file correctly.

Now, I have seemingly similar information in the excel file you provide. One can input head radius and get Cartesian coordinates for each electrode. You also give spherical coordinates for the electrodes. In theory, one should be able to generate a .ced file very easily with this information. But a few things baffle me.
  • The inclination and azimuth you provide in the excel file seem to bear no relation to sph_theta (or plain "theta" which as far as I can tell seems to just be - sph_theta) and sph_phi in the .ced file. For example, in the excel file, you give the inclination and azimuth of Fp1 as -92 and -72, but in the .ced file, sph_theta and sph_phi are 18 and -2. C3 has an inclination and azimuth of -46 and 0 in the excel file and sph_theta and sph_phi are 90 and 44 in the corresponding .ced file for the same cap. I looked for some sort of consistent relationship between these two different sets of values so that I could somehow convert them, but there doesn’t seem to be one. If there is, can you please clarify what it is?
  • shp_radius in the .ced file is just given as 1. I thought that perhaps in the .ced file, everything was calculated based on a cap with a radius of 1 mm so that this information could be used to extrapolate channel locations for various cap sizes, and in fact, when I set the cap radius to 1 mm in your excel file, the spherical radius and value of X are the same in that file as it is in the .ced file...but the other coordinates are not. I suppose because the theta and phi you give are different from the ones in the .ced file and am assuming that if theta and phi matched up, the rest of the coordinates would too when radius is set to 1?
  • sph_radius makes sense to me, but I have no idea what just plain “radius” in the .ced file is supposed to be, so some insight there would be helpful as well. In the .ced file I have for the 16 channel cap, radius is 0 for Cz, 0.256 for C3, C4, Fz and Pz, 0.333 for F3, F4, P3 and P4, and 0.511 for T7, T8, the Fps and the Os. Any idea what this might represent and more importantly, how to derive it from your excel file?
As it is, there is no way that I can see to get from the excel file you provide to something that’s in the same format as the .ced file because it has different values for inclination and azimuth and because I have no idea what plain “radius” (not sph_radius) in the .ced file is supposed to be. Can you provide any insight whatsoever as to what the relationship is between these two files, and particularly the values of phi and theta given in each of them? How do I convert from the theta and phi values YOU give in the excel file to the ones in the .ced file? Are these for different versions of your caps, or are you determining the reference points for azimuth and inclination differently, or what is going on here?

Thanks

Coen
Site Admin
Posts: 1148
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Inconsistencies with channel locations

Post by Coen »

Quote:

you give the inclination and azimuth of Fp1 as -92 and -72, but in the .ced file, sph_theta and sph_phi are 18 and -2. C3 has an inclination and azimuth of -46 and 0 in the excel file and sph_theta and sph_phi are 90 and 44 in the corresponding .ced file for the same cap.

Comment:

I am not familiar with .ced files, but I notice:

90-72 = 18, 90-92 = -2

90-0 = 90, 90-46 = 44

That should get you on track

Best regards, Coen (BioSemi)

akirkland
Posts: 3
Joined: Mon Oct 01, 2018 12:44 pm

Re: Inconsistencies with channel locations

Post by akirkland »

Thanks for the suggestion. However, that pattern coincidentally holds for those specific ones, but not for the rest of them. Here are all of the values in case you see a pattern that I don't.

Image

Coen
Site Admin
Posts: 1148
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Inconsistencies with channel locations

Post by Coen »

for positive values of inclination:

sph_phi = 90 - inclination
sph_theta = -90 + azimuth

for negative values of inclination:

sph_phi = 90 + inclination
sph_theta = 90 + azimuth

Best regards, Coen (BioSemi)

akirkland
Posts: 3
Joined: Mon Oct 01, 2018 12:44 pm

Re: Inconsistencies with channel locations

Post by akirkland »

Thanks! However, I wanted to get to the bottom of where exactly these differences come from and I think I've done so. :)

I took a look at the documentation for readlocs in eeglab, and I've figured some things out. I'm going to post an illustration of the difference between your coordinate system and the one used by eeglab so that others who need to generate location files will hopefully have an easier time.

You guys seem to have two origin points for azimuth, one at the left ear (T7) for the left hemisphere, one at the right ear (T8) for the right hemisphere. In both cases, anti-clockwise is positive. In eeglab, there's a single origin point. Azimuth is measured from a 0 point at the nose, positive towards the left ear (anticlockwise). That means, for example, that T7 and T8 both have an azimuth of 0 in your system, but in eeglab they have an azimuth of 90 and -90 respectively.

Furthermore, you use theta for inclination and phi for azimuth, whereas eeglab uses phi for inclination and theta for azimuth. These two bits of information explain the discrepancies between the coordinates you give and what needs to be given to eeglab for it to put the channels in the right locations.

Here's a little illustration showing the positions of a couple of electrodes:

Image

Coen
Site Admin
Posts: 1148
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Inconsistencies with channel locations

Post by Coen »

Basically, we use the ISO spherical system (https://en.wikipedia.org/wiki/Spherical ... ate_system) whereas EEGLAB uses coordinates based on the geograpic system (https://en.wikipedia.org/wiki/Geographi ... ate_system). The relation between the two systems is a bijection (one-to-one correspondence).

Best regards, Coen (BioSemi)

Coen
Site Admin
Posts: 1148
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Inconsistencies with channel locations

Post by Coen »

Geographic coordinates (EEGLab) have now been added to the position file, see https://www.biosemi.com/download/Cap_coords_all.xls

Best regards, Coen (BioSemi)

Post Reply