<div dir="ltr">Hi Jan-Mathijs,<div><br></div><div>Thanks. In fact, I did what you suggest, but this entails a lot (nr. of positions) or creating and clearing a temporary variable. For a reason I do not understand (but which I encountered before), MATLAB seems not able to deal with this, and runs into memory problems. I suspect it is not able to create and clear many variables in a row, so that althought memory load does not seem to increase, it <i>will </i>break with an out-of-memory problem. I therefor started with this approach, but alas, I now understand that it was a wrong turn. </div><div><br></div><div>So, I am in a pickle now, as neither option works...</div><div><br></div><div>Best,</div><div>Stephen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 November 2017 at 14:31, Schoffelen, J.M. (Jan Mathijs) <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Stephen,<br>
<br>
I think that it is currently not possible to pass the output of ft_sourceanalysis to ft_freqanalysis directly, since ft_freqanalysis expects channel-level type data in the input.<br>
The exact details of the computation depend a bit on the amount of RAM you have, and on what exactly you want to achieve.<br>
<br>
If it’s your intention to generate frequency spectra for many dipole locations (e.g. >1000 or so) I would consider the following:<br>
<br>
- compute spatial filters (cfg.keepfilter = ‘yes’);<br>
- use a for-loop across (chunks of) dipole locations to create ‘virtual channel data’, by premultiplying the sensor-level data.trial (loop across trials) with the location specific spatial filter.<br>
- stuff all this into a data-structure that looks like a raw data structure;<br>
- pass this to ft_freqanalysis<br>
<br>
<br>
Alternatively, you could consider using a parcellation approach, if you think it makes sense to reduce the number of spatial locations a bit, although theoretically it should be possible to create a parcellation that consists of just a single dipole per parcel. In this context, you could look into the inner workings of ft_sourceparcellate, which returns a data structure that ft_freqanalysis can work with. Whether ft_sourceparcellate can swallow single trial source data, I am not sure.<br>
<br>
Best wishes,<br>
<br>
JM<br>
<div><div class="h5"><br>
<br>
<br>
> On 16 Nov 2017, at 12:36, Stephen Whitmarsh <<a href="mailto:stephen.whitmarsh@gmail.com">stephen.whitmarsh@gmail.com</a>> wrote:<br>
><br>
> Hi FieldTrippers,<br>
><br>
> I was wondering is there is a recommend/most consistent way to represent trial x pos x time data from an LCMV beamformer, also considering the dimord. In other words:<br>
><br>
> with:<br>
><br>
> data.method = 'singletrial'<br>
><br>
> should I use:<br>
><br>
> data.trial{pos} = [rpt x time]<br>
> data.dimord = '{pos}_rpt_time'<br>
><br>
> or rather:<br>
><br>
> data.trial = {pos x rpt x time}<br>
> data.dimord = 'pos_rpt_time'<br>
><br>
> or something else? The purpose is to then do a frequency analysis (with keeptrials = 'yes').<br>
><br>
> Best,<br>
> Stephen<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a></blockquote></div><br></div>