<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Elena,<div><br></div><div>At some point we had an implementation for sam in FieldTrip. Apparently, this has been taken out of the release version. I don't know whether this was on purpose, or whether there was a good reason to do so.</div><div>The reason you get an error is that the function is missing. We will look into the missing function issue.</div><div>For the time being, you could try lcmv, which is very similar to sam.</div><div><br></div><div>Best,</div><div><br></div><div>Jan-Mathijs</div><div><br></div><div><br><div><div>On Jun 3, 2011, at 2:57 PM, Elena Orekhova wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div ocsi="0" fpstyle="1"><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; "><div id="divBdy" class="bdyItmPrt" _fallwcm="1"><div><div><div dir="ltr"><font color="black" face="Tahoma" size="2"><span dir="ltr" style="font-size: 10pt; "><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; ">Dear colleagues,</span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; ">Sorry, I posted much on the list recent time. I want to figure out how to run SAM analysis on my data.</span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier"> </font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">When I run<span class="Apple-converted-space"> </span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">'lcmv' beamformer on my averaged dataset</span></font><font face="Courier"><span class="Apple-converted-space"> </span>it works fine:</font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">= [];</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.grad</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">= hdr.grad;</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.method =</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">'lcmv';</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.grid</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">= grid;</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.vol</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">= vol_cm;</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.reducerank=2;</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.keepfilter = 'yes'</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.channel</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">= MAG; %MAG = {'MEG0721', 'MEG0731',... }</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 36pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">source</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">= ft_sourceanalysis(cfg, tlckavg);</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; "> </span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; "> </span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">When I do the same with<span class="Apple-converted-space"> </span></span></font><font face="Courier"> </font><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.method =</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">'sam'</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">option,</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">I get the error:</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">*****************************</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">??? Undefined function or method 'beamformer_sam' for input arguments of type 'struct'.</font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier"> </font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">Error in ==> sourceanalysis at 1158</font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier"> <span class="Apple-converted-space"> </span></font><font face="Courier">dip(i) = beamformer_sam(grid, sens, vol, squeeze(avg(i,:,:)), squeeze(Cy(i,:,:)),</font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier"> <span class="Apple-converted-space"> </span></font><font face="Courier">optarg{:});</font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier"> </font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">Error in ==> ft_sourceanalysis at 11</font></span></font></div><div style="padding-top: 0pt; padding-right: 0pt; padding-bottom: 1pt; padding-left: 0pt; border-top-width: 4px; border-right-width: 4px; border-bottom-width: 3pt; border-left-width: 4px; border-top-style: none; border-right-style: none; border-bottom-style: dotted; border-left-style: none; "><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; padding-top: 0pt; padding-right: 0pt; padding-bottom: 0pt; padding-left: 0pt; border-top-width: 4px; border-right-width: 4px; border-bottom-width: 4px; border-left-width: 4px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">[varargout{1:nargout}] = funhandle(varargin{:});</font></span></font></div></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier"> </font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">Does anybody know how to make the ‘SAM’ option to work?</font><font face="Courier"> </font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier">Does anybody used<span class="Apple-converted-space"> </span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">cfg.method =</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">'sam'</span></font><font face="Courier" size="2"><span style="font-size: 10pt; "> <span class="Apple-converted-space"> </span></span></font><font face="Courier" size="2"><span style="font-size: 10pt; ">option in the Fieldtrip???</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; "> </span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">Regards,</span></font></span></font></div><div style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "><font face="Cambria" size="3"><span style="font-size: 12pt; "><font face="Courier" size="2"><span style="font-size: 10pt; ">Elena</span></font></span></font></div></span></font></div></div></div></div></div>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></span></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dr. J.M. (Jan-Mathijs) Schoffelen </div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: 0031-24-3614793</div></div></span></div></span> </div><br></div></body></html>