<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Ludwig,<br>
<br>
On 23.07.2010 02:56, Ludwing Torres wrote:
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite">
  <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>Hi,
I'm
very sorry for using capital letters, please excuse me.<br>
</blockquote>
Never mind, I was not too offended at this, but wanted you to take note
of the fact, that somebody could be :)<br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite">I'm new at fieldtrip, I don't know much about this and I'm
searching for help desperately.<br>
</blockquote>
Then I hope I can help you.<br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite">Well, I am trying to compute a fordward model by now, like
this:<br>
  <br>
V=A*J<br>
  <br>
where:<br>
  <br>
V= a matrix of potentials measured in the scalp surface by each
electrode, for example 32 electrodes or channels and 5 seconds at 256
samples per second, (which is equal to 5*256=1280, which comes to a
32x1280 matrix, one epoch I guess, and one trial, just measure, no
events, <b>please correct me if i'm wrong</b>)<br>
</blockquote>
This sounds quite correct, I think, but AFAIK you won't compute this
directly but use some function like the ft_dipolesimulation function we
talked about last time. This does exactly what you want to do, compute
the electrode scalp potentials due to a given dipole distribution.
Spares you all the stuff you are now to consider.<br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite">J= a matrix of the sources in the brain that produce the
potentials above, with its time course, which are more than the
electrodes placed there.<br>
    Let me understand this: ¿these sources and its time course, are the
same dipole moments?<br>
    If so, ¿The sources (dipoles) have a time component in the three
dimensions in the dipoles?<br>
    Thus, if we consider 128 sources, ¿ are we considering 128 dipoles,
and J matrix would be 128x1280 with the time course?<br>
    or ¿Are we considering 128 sources of 3 dimensions and J matrix
would be of 128x(1280x3)?<br>
</blockquote>
I think it's rather the latter, but see below.<br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite">A= the lead field matrix. I've seen the function
compute_leadfield of FieldTrip, This uses the electrodes positions, the
dipoles (or sources) positions, and the standard volume of sphere and
conductivities to perform the computing of a leadfield matrix that has
dimensions numch x (3xnums)  where numch=nuber of channels or
electrodes (32 in this case)  and  nums=number of sources (in this
case  128)  ¿why is the number of sources multiplied by 3?  ¿ it is
because they compute the leadfield matrix to each of the cartesian
coordinates? and if so, ¿How should I take the J matrix to compute the
fordward model? ¿ should I take this each row having the time course of
the sources, in the order:  row 1:3 dipole n1 (x;y;z) ,  row 4:6 
dipole n2 (x;y;z)  , row 7:9  dipole n3  (x;y;z)  , row 10:12  dipole
n4 (x;y;z)  and so on? ¿ so, I'd have a (128x3)x1280 matrix, (128x3)
rows and 1280 columns, and not like above 128x(1280x3)?<br>
</blockquote>
<br>
Please see the documentation (reference for <a
 href="http://fieldtrip.fcdonders.nl/reference/compute_leadfield">compute_leadfield</a>)<br>
<pre class="code"><i>The forward solution is expressed as the leadfield
  matrix (Nchan*3), where each column corresponds with the potential or field
  distributions on all sensors for one of the x,y,z-orientations of the
  dipole.</i>

</pre>
This appears to be the leadfield for a dipole at a certain position.
You'd multiply the moment of the dipole you are trying to simulate with
the very matrix. At least mathematically I think you'd build the
lf-matrix for an number of dipoles as an (Nchan<tt>X</tt>(Ndip*3))
matrix where every three columns represent the contribution of one
dipole to the surface potential. The first of the three columns is the
contribution of the x-moment of the dipole and same for 2nd and 3rd
column representing the y- respectively z-moment. Note that this is -
by now - only a consideration of time independent dipoles. What the 
lf-matrix does is mapping dipoles to electrodes. Nchan is the number of
electrodes. For your 128 dipole-example (which could make a problem
when fitting) the lf-matrix would be a 32x384-matrix with fixed
positions for the dipoles. Where - as I said before - every row stands
for an electrode and every triple of three cols for the contribution of
one dipole to the electrodes. If you'd want to simulate the dipoles at
a single point in time you'd build a vector <br>
<br>
dip = [d1x d1y d1z d2x d2y d2z ... d128x d128y d128z]'<br>
<br>
where dnx is the x-moment of the n-th dipole and same for y and z. This
would be a column vector or matrix with a single column. If you'd make
a (384x1280)-matrix with the rows being the dipoles and the columns the
temporal change of the dipoles and multiply the lf matrix with this
you'd get a matrix 32x1280 with the rows being the electrodes and the
columns the time course. So the source matrix is not a (128x(1280*3))-
but rather a ((128*3)x1280)-matrix. <br>
<br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite">And, once I have performed the forward model and I compute
the V matrix, <b>¿Which function could I use to perform the inverse
problem, i.e. , could I use a function that allows me recovering or
regain the J matrix from the A and V matrices, and compare the new J
with the old J to see if the inverse problem could be performed well?<br>
  </b></blockquote>
Still I'd recommend the use of the dipolesimulation and dipolefitting
functions rather than using the lf directly. I think this is quite more
flexible. I don't really know how to perform the inverse solution in
this case.
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl"
 type="cite"><b>Please, If you could suggest me some article or book or
paragraph that I can read to clear these doubts, or if you could clear
these to me yourselves, I would be very much thankful to you, please
I'm begging you help please. Sorry for all the possible fouls and lacks
of politeness, sincerely.Thanks for your attention.<br>
  </b></blockquote>
See for example <a
 href="http://www.lemanic-neuroscience.ch/PENSTrainingCenter/articles/EEG-imaging.pdf">Michel
et al.: EEG source imaging</a>. <br>
<br>
Hope this helps.<br>
<br>
Cheers,<br>
Paul<br>
<br>
<pre class="moz-signature" cols="72">--
Paul Czienskowski
Björnsonstr. 25
12163 Berlin

Tel.: (+49)(0)30/221609359
Handy: (+49)(0)1788378772</pre>
</body>
</html>
<p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>