Goal: clean up code of sourceanalysis, sourcedescriptives, freqdescriptives.
bookkeeping of the data is quite complicated. Identify commonalities and differences between different inputs (time-domain data vs. frequency-domain data), and the different methods (pcc vs. dics initially, also lcmv eventually). For this, a more consistent representation of the data from the input side is required. Candidate function to take care of this will be checkdata. After calling checkdata, the input data will be converted into something containing a covariance/csd, and potentially trial-data (timelocked or fourier coefficients). This will make prepare_freq_matrices superfluous eventually.
the output structure should become more fieldtrippish: i.e. contain a dimord. Get rid of the .avg and .trial fields (also for sourcedescriptives). Check the consequences with respect to avgA and avgB fields. If source is to describe a 3D-volume with inside voxels, allow for (sparse) cell-arrays; let dimensionality of cell-array prevail over dimensionality of the individual cells. If the source is to describe a list of positions (all insides) a matricial representation is more efficient.
from previous changes the data representation will be much less complicated, allowing for a cleaner implementation.
identify commonalities in required functionality. With more consistent data representations sharing of common code will be the goal.
if necessary, sacrifice backward compatibility but try to limit this as much as possible.
Follow up jan 29 2010:
Detailed plan for tackling the cleaning up of the source-structure format will be as follows:
dimord, e.g:
> source.pow [NxnFreqxnTime] / source.powdimord = 'pos_freq_time'
> source.pow [nRptxNxnFreq] / source.powdimord = 'nrpt_pos_freq'
> source.leadfield {N,1}[nChanx3] / source.leadfielddimord = '{pos}_chan_ori'
> source.csd {N,1}[3x3] / source.csddimord = '{pos}_ori_ori'
possibly rely on the old-style source format.
Back to top