[FieldTrip] Help with inverse model

Oostendorp, T.F. (Thom) thom.oostendorp at donders.ru.nl
Fri May 3 12:02:25 CEST 2024


thank Jan-Mathijs for your addition. I was counting on you…

Cheers,
Thom

On 2 May 2024, at 21:13, Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Thom and Sara,

Thanks to Thom’s cue ("As I don’t know exactly how that program is used within ft_dipolefitting, somebody might feel the need to comment to my answers”) I thought that I should raise to the bait.

The underlying program dipoli is used in FieldTrip as one of the methods to do forward computations, i.e. to estimate the spatial fingerprint (of a potential distribution) due to a dipolar source, defined by its parameters (location [+dipole moment]). As such the dipoli routine is not used for the inverse modelling, i.e. the procedure that is used to create a model that best explains a given data topography (where best explains indeed means the lowest L2 norm of the difference between observation and model). The non-linear search is performed by MATLAB’s optimization tools, which can be defined by the user (low-level options, typically not used by the non-super-duper-expert user) to be @fminsearch, or @fminunc, as is (to be honest) also explicitly mentioned in the help-section of ft_dipolefitting. If you are interested in the gory details of how exactly the minimization is done, you would need to consult the documentation of those functions.
Now, with respect to your question about the ‘area in which it will do the (grid) search’: if you use a gridsearch with a grid that is automagically constructed by a cfg.sourcemodel.resolution (please look up the previous thread where you asked about dipolefitting) option, the boundary of the grid is determined by the inner boundary of the volume conduction model. The non-linear search will not be constrained in space, unless you specify the cfg.dipolefit.checkinside option accordingly.

Best wishes,
Jan-Mathijs




On 2 May 2024, at 10:24, Oostendorp, T.F. (Thom) via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Sara,

As I am the author of the underlying program dipoli that is called by ft_dipolefitting,  I think that I can answer your questions. As I don’t know exactly how that program is used within ft_dipolefitting, somebody might feel the need to comment to my answers.

On 1 May 2024, at 17:01, Sara Cinelli via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hello,
I'm writing you because I would like to better understand the the function for the inverse modeling (ft_dipolefitting). Here are some questions I have:
1. how much is big the grid search that the function can do at the start before the non linear search? For example, if  I specified the location of the source using the cfg.sourcemodel, how big will be the area in which it will do the grid search?

There is no “search grid” in ft_dipolefitting. Dipoli will not just allow a limited number of source locations, it searches the continuous space. There are some limitations: by default, the dipole location is constrained to the compartment in which the initial estimate you provide resides. Dipoli allows some other constraining methods:

Control options:
-d [<value>]  Constrain dipoles to remain at such a distance from the
              interfaces that the variation of 1/r^2 over any triangle
              is less than <value>% (r is the distance from the source
              to the surface). The default value of the criterion is 50%
-f            Normally the sources are constrained to remain in the
              compartment where they are in the initial estimate.
              This options lifts that constraint

The first one served to keep the dipole away from the boundary in order to prevent numerical problems. I’m not sure whether ft_dipolefitting lets you set these options.

aldo, the algorithm which is used here is just the minimization of the L2 norm?

Yes, it is, with the constraints mentioned above.

2. the method for the non linear search is the gradient descent method, is it correct?

No, it is essentially the Marquard method, which combines steepest decent and pseudo-Newton. See T. Oostendorp and A. van Oosterom: Source Parameter Estimation in Inhomogeneous Volume Conductors of Arbitrary Shape. IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. 36. NO. 3. MARCH 1989.


3. I see the possibility to choose between a 'moving' model and a 'regional' one. Is it possible to keep fixed both locations and amplitude, so the algorithm changes only the strength of the dipole?

Actually, the choice is between:
- a moving dipole, i.e. at each sample time a new location is fitted
- stationary dipole location and  free orientation, i.e. the best single position is fitted, but dipole orientation is free at each sample time
- stationary dipole location and stationary orientation, i.e. both location at orientation are fixed in time

I am nog quite sure what you mean with "keep fixed both locations and amplitude, so the algorithm changes only the strength of the dipole”. Fixed amplitude and changing the strength sound opposed to me.

Cheers,
Thom

--
dr. T.F. Oostendorp          東村      205 Dept. of Cognitive Neuroscience
route 200, room 02.282                Donders Center for Medical Neuroscience
phone: +31 24 3614240               Radboud University Medical Center
Kapittelweg 29                              6525 EN Nijmegen, the Netherlands



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ce62a964b46514092871908dc6b582205%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638503273467548153%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=%2BJGzwebItQMCQ1myI08%2FMRlNewR6IcMY31IrAgXlaPY%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ce62a964b46514092871908dc6b582205%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638503273467704407%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=8WOU8Ow2LxLgQ4dRAOJlCAx0tPAchrJwU9QZXKFx8Fc%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ce62a964b46514092871908dc6b582205%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638503273467704407%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=T23EAJQcmSFjxu%2F2Y6lRhsjiW7%2Fgq2YLMijyfvEouAE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

--
dr. T.F. Oostendorp          東村      205 Dept. of Cognitive Neuroscience
route 200, room 02.282                Donders Center for Medical Neuroscience
phone: +31 24 3614240               Radboud University Medical Center
Kapittelweg 29                              6525 EN Nijmegen, the Netherlands



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240503/1c32bf4f/attachment.htm>


More information about the fieldtrip mailing list