<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<br><br><b>




  


Hi Paul, Thanks for the answer, I'll put in bold the new entries in this message.</b><br><br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl">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, please correct me if i'm wrong)<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><br>I'll do that. Could you explain me also what an epoch stands for, please?<br><br>
<blockquote cite="mid:BLU144-W2739654609F3488C84B5F3E4A30@phx.gbl">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">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<br>  matrix (Nchan*3), where each column corresponds with the potential or field<br>  distributions on all sensors for one of the x,y,z-orientations of the<br>  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">And, once I have performed the forward model and I compute
the V matrix, ¿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?<b><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">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.<b><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><b>Ok this has been very helpful, I think I still dont understand very well the concept of dipole moment, I'll search more information about this and how to manage the dipole moments as vectors; if you could suggest me some other book to learn about what is a dipole moment (also from the point of view of linear algebra) I'll thank you too, and this will help me think about how to use the dipolefitting function.<br><br>Very Many thanks again.<br></b>
<pre class="ecxmoz-signature">-- <br>Paul Czienskowski<br>Björnsonstr. 25<br>12163 Berlin<br><br>Tel.: (+49)(0)30/221609359<br>Handy: (+49)(0)1788378772</pre>


----------------------------------<BR>
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.<BR>
  http://listserv.surfnet.nl/archives/fieldtrip.html<BR>
  http://www.ru.nl/fcdonders/fieldtrip/<BR>                                         <br /><hr />Connect to the next generation of MSN Messenger   <a href='http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline' target='_new'>Get it now! </a></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>