<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p style="margin: 0pt;">
<span>
<span></span>
Hi,
</span>
</p>
<p style="margin: 0pt;">
<span> </span>
</p>
<p style="margin: 0pt;">
<span>I'd like to use the leadfield from the ft_compute_leadfield function to compute the time course of two dipoles, given their location and orientation. So I searched on the mailing list and found a thread from Apr-1 2011 (http://mailman.science.ru.nl/pipermail/fieldtrip/2011-April/003690.html) with a nice explanation. By using this approach it is not very difficult to obtain the waveform of a single dipole, but in my case there are TWO dipoles.</span>
</p>
<p style="margin: 0pt;">
<span> </span>
</p>
<p style="margin: 0pt;">
<span>This works when assuming a single dipole:</span>
</p>
<p style="margin: 0pt;">
<span> </span>
</p>
<p style="margin: 0pt;">
<span>dip.pos = [0 0.5 0];</span>
</p>
<p style="margin: 0pt;">
<span>dip.ori = [1 0 0]; </span>
</p>
<p style="margin: 0pt;">
<span>
lf = ft_compute_leadfield(dip.pos,elec,vol);
<br/>
li = pinv(lf);
<br/>
ori = dip.mom;
<br/>
ori = repmat(ori,length(li),1)';
<br/>
w = dot(li,ori);
<br/>
waveform = dot(D.Data,repmat(w,size(D.Data,2),1)');
</span>
</p>
<p style="margin: 0pt;">
<span> </span>
</p>
<p style="margin: 0pt;">
<span>Is there any way to make this work with a two-dipole-model, so I get the waveforms of both of them? </span>
</p>
<p style="margin: 0pt;">
<span> </span>
</p>
<p style="margin: 0pt;">
<span>Thanks in advance</span>
</p>
<p style="margin: 0pt;">
<span>Max </span>
</p>
<p style="margin: 0px; "></p>
</body>
</html>