<div dir="ltr"><div><div><div>Hi Nick,<br>Thanks for advice!<br><br></div>I'm using a server with 256gb of RAM, while the data in 5 runs would be something 12.5gb altogether.<br></div><div>Each run is 2.5gb, dimensions: 91x109x91x350<br>
</div><br>The problem is still there: I've adjusted the code after your reply and ran it immediately, and it is still running.<br></div><br><div><div>
-Dima<br></div><div>
  <br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-06 14:57 GMT+03:00 Nick Oosterhof <span dir="ltr"><<a href="mailto:nikolaas.oosterhof@unitn.it" target="_blank">nikolaas.oosterhof@unitn.it</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On May 6, 2014, at 1:19 PM, Dmitry Smirnov <<a href="mailto:dmi.smirnov07@gmail.com">dmi.smirnov07@gmail.com</a>> wrote:<br>
<br>
> I was wondering, what would be the most optimal solution for loading massive data in PyMVPA.<br>
</div>> [...]<br>
<div class="">> # Trim a number of slices in the end of the file<br>
> def trimImage(filename,cutoff):<br>
>     tmp = nib.load(filename)<br>
>     return nib.Nifti1Image(tmp.get_data()[:,:,:,0:cutoff],tmp.get_affine())<br>
</div>> [...]<br>
<div class="">> fds = fmri_dataset(samples=[trimImage(('run%i/epi.nii' % (r+1)),346) for r in range(runs)],<br>
> targets=targets,<br>
> chunks=selector,<br>
> mask='/triton/becs/scratch/braindata/DSmirnov/HarvardOxford/MNI152_T1_2mm_brain_mask.nii')<br>
<br>
</div>I don't think you would need the trimImage function, and it is possible that using it increases the execution time significantly. You can slice the samples to get the same effect:<br>
<br>
run_ds=[]<br>
for r in range(runs)<br>
  ds=fmri_dataset('run%i/epi.nii' % (r+1),...)<br>
  ds=ds[:cutoff,:]<br>
  run_ds.append(ds)<br>
<br>
all_ds=hstack(run_ds,True)<br>
<br>
Also, are you sure you are not constrained by RAM? How big are the images?<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</blockquote></div><br><br clear="all"><br>-- <br> <br>Dmitry Smirnov (MSc.)<br>PhD Candidate, <a href="http://becs.aalto.fi/bml/" target="_blank">Brain & Mind Laboratory</a><div>BECS, Aalto University School of Science<br>
00076 AALTO, FINLAND<br>mobile: +358 50 3015072<br>email: <a href="mailto:dmitry.smirnov@aalto.fi" target="_blank">dmitry.smirnov@aalto.fi</a></div>
</div>