nabusch / Elektro-Pipe

A collection of code for a processing pipeline for elektrenkephalography data.
3 stars 2 forks source link

matfile() compatible output for single-trial TF #9

Open wanjam opened 6 years ago

wanjam commented 6 years ago

When storing single-trial TF data with design_runtf.m, a subfolder with one file per subject is created. For a 2x2x2 design, this file's content looks approximately like this:

TF(1,1,1).pow = 3D matrix
TF(1,1,1).itc = 3D matrix
TF(1,1,1).single.pow = 4D matrix
TF(1,1,1).single.itc = 4D matrix
TF(1,1,1).times
etc...

For an experiment with many trials*channels*frequencies*timepoints, each of these matrices can be huge. One way to avoid overloading RAM during subsequent analysis would be to use Matlab's matfile() function, to load only those parts of the file necessary (e.g., TF(1,1,1).single.pow(20,:,:,:)). However, that's not possible because matfile only allows ()-indexing. Producing single files per cell in the designmatrix would be the obvious solution but would create a horrible mess of files (in a 2x2x2 design with 50 subjects, that'd be 1350 files...).

wanjam commented 6 years ago

The change made in 9b005d9 could be more elegant (as mentioned in the code). We most likely need to change these lines along with a matfile() friendly implementation anyway. So no elegant version for now.