[FieldTrip] [EXT] Re: Units for dipole moment retrieved through ft_dipolefitting
Nunez Ponasso, Guillermo
gcnunez at wpi.edu
Thu May 16 15:18:36 CEST 2024
Thank you Jan Mathijs,
Converting to SI units solved the issue. Apparently, the output was mA mm as suspected!
Best,
Guillermo
________________________________
De: fieldtrip <fieldtrip-bounces at science.ru.nl> en nombre de Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip at science.ru.nl>
Enviado: miércoles, 15 de mayo de 2024 3:18
Para: FieldTrip discussion list <fieldtrip at science.ru.nl>
Cc: Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl>
Asunto: [EXT] Re: [FieldTrip] Units for dipole moment retrieved through ft_dipolefitting
Hi Guillermo,
The correct dealing with, and interpretation of physical units is a continued challenge indeed.
Wherever possible (at least for the metric units for geometrical objects) FieldTrip tries to ensure that they are equal before any relevant computations (e.g. convert if needed the metric units of the headmodel, if it’s different from the position information of the electrodes). I am not sure about the exact logic of which object has ‘precedence’ in determining the final units. If you want to be as sure as possible about the interpretation of the outcome units, I recommend to convert everything explicitly into SI-units:
all geometries in ‘m’ -> ft_convert_units(object, ‘m’) will do the trick (for elec and the position information in the headmodel)
and all functional data in ‘V’ (for the elec structure this requires a chanunit cell-array Nx1 with ‘V’, and for the functional data this might require an explicit scaling of ElectrodeVoltages).
the tricky bit will be the units of the transfer matrices in your head_model (because this is what I assume you pre-computed with your own forward solver), but that’s out of the scope of the fieldtrip code. I guess that if you know that the units there are also SI (i.e. only involving A,V,m) then you should be all set.
Basically, the long story short is that the low level ft_compute_leadfield computes the leadfield with units V/Am under the assumption that the input data is expressed in V’s and A’s and m’s.
Hope this helps,
JM
On 15 May 2024, at 04:07, Nunez Ponasso, Guillermo via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:
Dear FieldTrip community,
I am using the function ft_dipolefitting to retrieve the dipole position and moment from simulated EEG readings using my own forward solver (so I know the true solution).
First I created the raw data as follows:
raw = [];
raw.datatype = 'raw';
raw.time={zeros(1,Ntime_samples)};
raw.iseeg='yes';
raw.label=labels;
raw.chanunit='V';
raw.senstype='eeg';
raw.trial = {repmat(ElectrodeVoltages,1,Ntime_samples)};
for i = 0:(Ntime_samples-1)
raw.time{1}(i+1)=i/Ntime_samples;
end
if ft_datatype(raw,'raw')
disp("Raw data created succesfully.")
end
Where ElectrodeVoltages is an N_electrodes x 1 vector with values in Volts (V).
After this is done I do the following:
disp("Dipole fit with real initial value")
cfg = [];
cfg.numdipoles = 1;
cfg.gridsearch = 'no';
cfg.headmodel = head_model;
cfg.dip.pos = dip0.dip.pos;
cfg.elec=elec;
dip = ft_dipolefitting(cfg, raw);
disp("Dipole fit completed!")
Here, dip0.dip is the original dipole, for which I have the position dip0.dip.pos and moment information dip0.dip.mom. In other words, I do a dipole fit with the true dipole position as the intial position. The head model is a 3-layer model with millimeter units (mm).
Here is the structure that I get for dip.dip:
>> dip.dip
ans =
struct with fields:
pos: [-16.4780 -12.0334 47.4920]
mom: [3×10 double]
pot: [256×10 double]
rv: [1.2740e-04 1.2740e-04 1.2740e-04 1.2740e-04 1.2740e-04 1.2740e-04 1.2740e-04 1.2740e-04 … ]
unit: 'mm'
The distance and orientation of the fitted dipole are very close to the distance and orientation of the original dipole.
Now, the issue is that the moment of my original dipole is Ampere times meter (A m). But I don't know how I should interpret the output dipole moment. The only clue is the field dip.dip.unit ('mm').
If the units are Amperes times millimeters (A mm), then the difference between both dipole moments is very large. However, if the units are milli Amperes times millimeter (mA m), then we have very good agreement.
How can I know what are the units of the output?
Thank you!
Guillermo Nunez Ponasso
Post-doc, Electrical Engineering. WPI
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240516/8c6f152d/attachment.htm>
More information about the fieldtrip
mailing list