<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif">I received an excellent suggestion and some additional information from Vladimir <span style="white-space: pre-wrap;">Litvak. The NUTMEG programs have sLORETA, swLORETA, and dSPM MATLAB routines that are compatible with the FT
 format.  They also have routines that duplicate those in FT (e.g., min norm, LCMV, beamformers)
</span></font></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif"><span style="white-space: pre-wrap;"><br>
</span></font></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif"><span style="white-space: pre-wrap;">I</span> </font>
<span style="white-space: pre-wrap; font-family: Calibri, sans-serif;">did the following and it appears to work. Any comments welcome.</span></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<span style="white-space: pre-wrap; font-family: Calibri, sans-serif;"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif"><span style="white-space: pre-wrap;">I</span></font><font face="Calibri,sans-serif"><span style="white-space: pre-wrap;"> have fairly simple source inverse problems, eg. simple grand average ERP (and not beamformer, or dynamic
 EEG). The FT leadfield is a struct that has lf{nsources} elements, each element is a [nchannels p] vector, where nchannels is the number of channels, p is the number of dipole orientations, and nsources is the number of source vertices or grid points. The
 NM (NUTMEG) leadfield (Lp) is a matrix, [nchannels p nsources] in size.</span></font></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif"><span style="white-space: pre-wrap;"><br>
</span></font></div>
<div><font face="Calibri,sans-serif" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><span style="white-space: pre-wrap;">The following is not my complete code</span></font><font face="Calibri,sans-serif"><span style="white-space: pre-wrap;">…
 the LF{nsources} references are conceptual, the programming is somewhat different.</span></font></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif"><span style="white-space: pre-wrap;"><br>
</span></font></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<font face="Calibri,sans-serif"><span style="white-space: pre-wrap;">1. Convert the FT LF to the NM Lp. There is a NUTMEG nut_ftgridenutsLpvox which is intended to convert the LF to the Lp. It did not work perfectly, I</span>
</font><span style="font-family: Consolas;">had to adapt it somewhat to make the Lp matrix correctly from the Lf matrix. </span></div>
<div>
<div id="">
<div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">2.  Do the call to one of the subrouties</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">Eg</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">cfg=[];</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">cfg.gamma=.05</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">nmfilter = nut_sLORETA(Lp,data.cov,cfg)</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><span style="white-space: pre-wrap; font-family: Calibri, sans-serif;">3--the output is a [nchannel 3 sources] matrix. I used this, and the data.avg, to create the FT source output
 (e.g., each source.avg.mom{nsources} = inverse[nchannels p]' * data.avg;</span></div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><span style="white-space: pre-wrap; font-family: Calibri, sans-serif;"><br>
</span></div>
<div><span style="font-family: Calibri, sans-serif; white-space: pre-wrap;">I added the source.avg.pow, and
</span></div>
<pre class="bz_comment_text" id="comment_text_2" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: medium; white-space: pre-wrap; width: 50em;">outsource.time=[1:size(outsource.avg.pow,2)];
outsource.inside=grid.inside;
outsource.avg.inside=grid.inside;
outsource.pos=grid.pos;
outsource.avg.pos=grid.pos;
outsource.method='average';
%dim is no of unique values in pos
outsource.dim=[size(unique(grid.pos(:,1)),1) size(unique(grid.pos(:,2)),1) size(unique(grid.pos(:,3)),1)];
</pre>
<pre class="bz_comment_text" id="comment_text_2" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: medium; white-space: pre-wrap; width: 50em;">4—at this point I have a complete “source” struct similar to that created by ft_sourceanalysis, but the mom and pow are generated by the NUT procedure.</pre>
<pre class="bz_comment_text" id="comment_text_2" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: medium; white-space: pre-wrap; width: 50em;"><br></pre>
<pre class="bz_comment_text" id="comment_text_2" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: medium; white-space: pre-wrap; width: 50em;">I suggest someone doing a help or tutorial file for this.  I also invite any suggestions from others.</pre>
<pre class="bz_comment_text" id="comment_text_2" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: medium; white-space: pre-wrap; width: 50em;">John</pre>
<pre class="bz_comment_text" id="comment_text_2" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: medium; white-space: pre-wrap; width: 50em;"><br></pre>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">***********************************************</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">John E. Richards Carolina Distinguished Professor</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">Department of Psychology</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">University of South Carolina</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">Columbia, SC  29208</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">Dept Phone: 803 777 2079</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">Fax: 803 777 9558</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">Email: <a href="mailto:richards-john@sc.edu">richards-john@sc.edu</a></div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">HTTP: jerlab.psych.sc.edu</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;">***********************************************</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"><br>
</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Consolas; font-size: medium;"></div>
</div>
</div>
<link rel="File-List" href="file://localhost/Users/richards/Library/Caches/TemporaryItems/msoclip/0clip_filelist.xml"><link rel="themeData" href="file://localhost/Users/richards/Library/Caches/TemporaryItems/msoclip/0clip_themedata.xml"><style>
<!--
 /* Font Definitions */
@font-face
        {font-family:"MS 明朝";
        mso-font-charset:78;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
        {font-family:"MS 明朝";
        mso-font-charset:78;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:-536870145 1073743103 0 0 415 0;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:-520092929 1073806591 9 0 415 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:Cambria;
        mso-ascii-font-family:Cambria;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:"MS 明朝";
        mso-fareast-theme-font:minor-fareast;
        mso-hansi-font-family:Cambria;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        font-family:Cambria;
        mso-ascii-font-family:Cambria;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:"MS 明朝";
        mso-fareast-theme-font:minor-fareast;
        mso-hansi-font-family:Cambria;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
</body>
</html>