Hi Akiko,<div><br></div><div>In addition to Saskia's comment (which is very useful!) remember also that if you create the subject's grid from the warped MNI template grid (explained here <a href="http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid">http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid</a>) then you can keep each subject's source data in a 'source' structure with .pos field and still do group level statistics, without need to convert to 'volume' structure which upsamples the spatial resolution perhaps artificially too high.</div>
<div><br></div><div>Cheers,</div><div>Johanna<br><br><div class="gmail_quote">2012/10/7 Akiko Ikkai <span dir="ltr"><<a href="mailto:akiko.ikkai@gmail.com" target="_blank">akiko.ikkai@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Saskia,<div><br></div><div>Thank you for the quick advise! Removing cfg definitely works well. Each of the group data is now 1.3G (I also used "single" to convert everything into single precision), which is definitely manageable. Computation time has also been reduced to 3 times less now.</div>
<div><br></div><div>Thanks! Akiko <div><div class="h5"><br><br><div class="gmail_quote">On Sun, Oct 7, 2012 at 2:16 PM, Saskia Haegens <span dir="ltr"><<a href="mailto:shaegens@gmail.com" target="_blank">shaegens@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Akiko,<br>
<br>
In my experience with grandavg source structs, sometimes the cfg<br>
(that's attached to the data struct) becomes very large and can<br>
consume a considerable amount of memory. I'm not sure if that's the<br>
case/problem here, but might be worth checking and removing the cfg.<br>
You could even use checkconfig to cleanup your cfg with:<br>
data.cfg = ft_checkconfig(data.cfg, 'checksize', 'yes')<br>
Hope this helps!<br>
<br>
Best,<br>
Saskia<br>
<div><div><br>
On Sun, Oct 7, 2012 at 11:36 AM, Akiko Ikkai <<a href="mailto:akiko.ikkai@gmail.com" target="_blank">akiko.ikkai@gmail.com</a>> wrote:<br>
> Dear Fieldtrip users,<br>
><br>
> I've been trying to run group stats on my EEG source data, which contains 14<br>
> subjects' normalized beamformer data, and having serious swap memory issue<br>
> (not Matlab memory issue, but OS swap memory).<br>
><br>
> I'm trying to contrast 2 conditions (within subject design). Each subject's<br>
> normalized beamformer data (1 condition) is<br>
><br>
> source_lTMI_intNorm =<br>
><br>
> anatomy: [181x217x181 double]<br>
><br>
> inside: [181x217x181 logical]<br>
><br>
> avg: [1x1 struct]<br>
><br>
> transform: [4x4 double]<br>
><br>
> dim: [181 217 181]<br>
><br>
> cfg: [1x1 struct]<br>
><br>
><br>
>>whos<br>
><br>
><br>
><br>
> Name Size Bytes Class Attributes<br>
><br>
> source_lTMI_intNorm 1x1 520114791 struct<br>
><br>
><br>
> therefore, when I open all subjects' data ("data1group" and "data2group"),<br>
> it's huge...<br>
><br>
> Name Size Bytes Class Attributes<br>
><br>
> data1group 1x14 5909429438 cell<br>
><br>
> data2group 1x14 6705652782 cell<br>
><br>
><br>
> data1group & data2group are both 1x14 struct (1 cell/subject). Therefore,<br>
><br>
>>data1group{1}<br>
><br>
> anatomy: [181x217x181 double]<br>
><br>
> inside: [181x217x181 logical]<br>
><br>
> avg: [1x1 struct]<br>
><br>
> transform: [4x4 double]<br>
><br>
> dim: [181 217 181]<br>
><br>
> cfg: [1x1 struct]<br>
><br>
> So, when I try to run<br>
><br>
> cfg=[];<br>
><br>
> cfg.dim = data1group{1}.dim;<br>
><br>
> cfg.method = 'montecarlo';<br>
><br>
> cfg.statistic = 'depsamplesT';<br>
><br>
> cfg.parameter = 'avg.pow';<br>
><br>
> cfg.correctm = 'cluster';<br>
><br>
> cfg.numrandomization = 100;<br>
><br>
> cfg.alpha = 0.05;<br>
><br>
> cfg.tail = 0;<br>
><br>
> nsubj=length(data1group);<br>
><br>
> cfg.design(1,:) = [1:nsubj 1:nsubj];<br>
><br>
> cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2];<br>
><br>
> cfg.uvar = 1;<br>
><br>
> cfg.ivar = 2;<br>
><br>
> stat = ft_sourcestatistics(cfg, data1group{:}, data2group{:});<br>
><br>
> stat.anatomy = data1group{1}.anatomy;<br>
><br>
><br>
> my computer (os 10.6.8, 6G memory) runs out of swap memory (startup<br>
> memory?), which forces me to quit Matlab. I'm running above processes in a<br>
> function, so I'm not running into Matlab memory error.<br>
><br>
> Could someone help me how it could run more efficiently? I guess<br>
> cfg.inputfile is not available for ft_sourcestatistics, so I have to<br>
> eventually load 2 group data in Matlab workspace...?<br>
><br>
> Thank you in advance! Akiko<br>
><br>
> --<br>
> Akiko Ikkai, Ph.D.<br>
> Postdoctoral Fellow<br>
> Department of Psychological and Brain Sciences<br>
> Johns Hopkins University<br>
> Ames Hall, 3400 N. Charles St.<br>
> Baltimore, MD 21218<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><font><span style="font-family:arial,helvetica,sans-serif">Akiko Ikkai, Ph.D. <br>Postdoctoral Fellow<br style="font-family:arial,helvetica,sans-serif"></span></font><font style="font-family:arial,helvetica,sans-serif" face="'PrimaSans BT,Verdana,sans-serif'">Department of
Psychological and Brain Sciences<br>Johns Hopkins University<br>Ames
Hall, 3400 N. Charles St.<br>Baltimore, MD 21218</font><br style="font-family:arial,helvetica,sans-serif"><br><br>
</div></div></div>
<br>_______________________________________________<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" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>