<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">P.S., sorry, mixed things up: data in comp_output.trial have 499 samples, while smps has 500 elements (presumably based on sampleinfo). So key question is: why do the output trials after bsscca have 1 fewer sample
than the input trials?<br>
<br>
Best,<br>
Linda <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;color:#1F497D">dr. Linda Drijvers | postdoctoral researcher | https://cosilab.org
<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:#1F497D">Donders Institute for Brain, Cognition and Behaviour, Radboud University, NL<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:#1F497D">www.ru.nl/english/people/drijvers-l/ | https://www.mpi.nl/people/drijvers-linda<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> <b>
On Behalf Of </b>Drijvers, L. (Linda)<br>
<b>Sent:</b> woensdag 6 mei 2020 09:59<br>
<b>To:</b> fieldtrip@science.ru.nl<br>
<b>Subject:</b> [FieldTrip] missing sample after using ft_componentanalysis with method bsscca<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Dear all, <br>
<br>
I’m analysing an EEG dataset using MATLAB 2016a + FieldTrip version 20200409.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to use ft_componentanalysis with cfg.method = ‘bsscca’ (see code):<o:p></o:p></p>
<p class="MsoNormal"><br>
cfg = [];<o:p></o:p></p>
<p class="MsoNormal">cfg.channel = 1:length(data_Aclean.label)-2; <o:p></o:p></p>
<p class="MsoNormal">cfg.method = 'bsscca';<o:p></o:p></p>
<p class="MsoNormal">cfg.cellmode = 'yes';<o:p></o:p></p>
<p class="MsoNormal">comp_output = ft_componentanalysis(cfg, data_Aclean);<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">When I then try to use ft_databrowser with the following code:<o:p></o:p></p>
<p class="MsoNormal"> cfg = [];<o:p></o:p></p>
<p class="MsoNormal"> cfg.channel = [1:10];<o:p></o:p></p>
<p class="MsoNormal"> cfg.viewmode = 'component';<o:p></o:p></p>
<p class="MsoNormal"> cfg.layout = 'customlayout.mat';<o:p></o:p></p>
<p class="MsoNormal"> ft_databrowser(cfg, comp_output);<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I get the following error:<o:p></o:p></p>
<p class="MsoNormal"><br>
Index exceeds matrix dimensions.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Error in ft_fetch_data (line 199)<o:p></o:p></p>
<p class="MsoNormal"> dat(:,ok) = data.trial{utrl}(chanindx,smps);<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Error in ft_databrowser>redraw_cb (line 1630)<o:p></o:p></p>
<p class="MsoNormal"> dat = ft_fetch_data(opt.orgdata, 'header', opt.hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', chanindx,<o:p></o:p></p>
<p class="MsoNormal"> 'allowoverlap', istrue(cfg.allowoverlap));<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Error in ft_databrowser (line 729)<o:p></o:p></p>
<p class="MsoNormal">redraw_cb(h);<br>
<br>
A closer look at the data shows that while fsample for my data is 500, smps is 499 after running ft_componentanalysis with method bsscca. However, I can solve the error above by running ft_databrowser with comp_output = rmfield(comp_output, 'sampleinfo').
<br>
<br>
My question is: what causes this discrepancy in smps (why does this one sample go missing)? Any help would be appreciated.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best wishes,<br>
Linda Drijvers<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt">dr. Linda Drijvers | postdoctoral researcher | https://cosilab.org
<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Donders Institute for Brain, Cognition and Behaviour, Radboud University, NL<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">www.ru.nl/english/people/drijvers-l/ | https://www.mpi.nl/people/drijvers-linda<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>