Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units in SCD from ft_scalpcurrentdensity? #2256

Open
NirOfir opened this issue Jun 7, 2023 · 3 comments
Open

Units in SCD from ft_scalpcurrentdensity? #2256

NirOfir opened this issue Jun 7, 2023 · 3 comments
Labels

Comments

@NirOfir
Copy link
Contributor

NirOfir commented Jun 7, 2023

I'm trying to use SCD on an EEG dataset, and I got values much larger (an order of magnitude) than what I expected given the literature. The original data I use is in microvolts, and I'm using the template 10-20 electrode positions file, which is in mm, and according to ft_scalpcurrentdensity I should get V/m^2 in the output in that case. So I started looking into the code to see where the differences might be coming from, and I noticed a couple of differences between the implementation in fieldtrip and that of the CSD toolbox which is what the papers I'm reading used. I'm not too good with following units, so I'm sure I missed something here:

  1. The documentation of the CSD toolbox code (CSD.m specifically) suggests that using the unit sphere electrode positions gives a result in microvolts/m^2, and that these can be converted to, say, microvolts/cm^2 by supplying a relevant constant (not the radius of the head, which is what fieldtrip seems to do in sphsplint line 130). I thought this might be a result of the units they defined their positions to begin with, but since they're only using the angles theta and phi, shouldn't this be independent of the units in which positions were defined?
  2. Fieldtrip multiplies by the conductivity in ft_scalpcurrentdensity line 273. but I couldn't find anything related to conductivity in the CSD toolbox code.

Keitel, Thut & Gross 2017 used ft_scalpcurrentdensity and they report the units as mA/m^3 (figure 4). This might make sense if the output of the SCD in fieldtrip is really V/m^2, which multiplied by S/m does give A/m^3.

Removing the division by the head radius in sphsplint line 130 and the multiplication by the conductivity in ft_scalpcurrentdensity 273 makes the values closer to what I expected, but I doubt that's the right thing to do. Any help here will be greatly appreciated!

Reference papers:
Steinemann, O’Connell & Kelly 2018 figure 4
Kelly & O'Connell 2013 figure 1
Twomey, Kelly & O'Connell 2016 figure 2

@NirOfir
Copy link
Contributor Author

NirOfir commented Jun 8, 2023

Ok, I looked into it a bit more. It looks like some of the confusion is because it is unclear if the function is to return the surface laplacian (in V/(m^2)) or the SCD (in A/(m^3), Perrin et al 1987). The CSD toolbox apparently returns the surface laplacian but calls it a CSD, and the bit by Paul Nunez does say that two terms are sometimes confused. I guess this explains point 2: The fieldtrip code says its returning an output in V/(m^2), supposedly the surface laplacian, but uses the conductivity, which means that the actual output is in A/(length^3), supposedly the SCD.
That still leaves point 1 open: Do we need to scale the laplacian by the radius of the head or keep it as it is?

@robertoostenveld
Copy link
Contributor

Hi @NirOfir ,

thanks for looking into detail in this. I have not used this myself for a long time, but do recall that getting the units right (both in the input and in the code) is challenging.

Did you also look at the other two methods? I can imagine your electrode configuration not being compatible with them. Perhaps it would be good to do a simulation of a radial dipole in a headmodel with a well-defined template electrode set (e.g. 1010) and use that for testing and comparison. Did you check whether there are existing test scripts for this in fieldtrip/test?

PS one thing to do anyway is to improve the help of the function with the information that you already provided above.

@NirOfir
Copy link
Contributor Author

NirOfir commented Jun 11, 2023

Thanks for the suggestions! I didn't find anything in the test folder (a couple of test scripts for unrelated bugs, but nothing that includes comparing a simulation with the output). I'll look into that later. For now, I compared the results of the CSDtoolbox with what FT provides if the conductivity and scaling by radius parts are removed, and they are (nearly) identical:
csdtoolbox and ft
The left plot shows the output of CSDtoolbox, and on the right is the modified FT output. The spatial correlation between the two methods is no less than 0.9322, for all time points and 7 conditions (colors). That doesn't say which toolbox has the correct units, but it does pinpoint the difference I found to the conductivity and radius part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants