<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Sara,
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 1 May 2024, at 17:01, Sara Cinelli via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hello, <br class="">
<div class="">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:</div>
<div class="">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?</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>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: </div>
<div><br class="">
</div>
<div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Control options:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">-d [<value>]  Constrain dipoles to remain at such a distance from the</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">              interfaces that the variation of 1/r^2 over any triangle</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">              is less than <value>% (r is the distance from the source</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">              to the surface). The default value of the criterion is 50%</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">-f            Normally the sources are constrained to remain in the</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">              compartment where they are in the initial estimate.</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "DejaVu Sans Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">              This options lifts that constraint</span></div>
</div>
<div><br class="">
</div>
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.</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">aldo, the algorithm which is used here is just the minimization of the L2 norm?</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Yes, it is, with the constraints mentioned above.</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">2. the method for the non linear search is the gradient descent method, is it correct?</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>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.</div>
<div><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">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?</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Actually, the choice is between:</div>
<div>- a moving dipole, i.e. at each sample time a new location is fitted</div>
<div>- stationary dipole location and  free orientation, i.e. the best single position is fitted, but dipole orientation is free at each sample time</div>
<div>
<div>- stationary dipole location and stationary orientation, i.e. both location at orientation are fixed in time</div>
<div><br class="">
</div>
<div>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.</div>
<div><br class="">
</div>
<div>Cheers,</div>
<div>Thom</div>
<div class=""><br class="">
</div>
</div>
</div>
<div class="">
<div>--<br class="">
dr. T.F. Oostendorp          東村      205 Dept. of Cognitive Neuroscience<br class="">
route 200, room 02.282                Donders Center for Medical Neuroscience<br class="">
phone: +31 24 3614240               Radboud University Medical Center<br class="">
Kapittelweg 29                              6525 EN Nijmegen, the Netherlands<br class="">
</div>
<div class=""><br class="">
</div>
<br class="Apple-interchange-newline">
</div>
<br class="">
</div>
</body>
</html>