The purpose of this page is just to serve as todo or scratch pad for the development project and to list and share some ideas.

After making changes to the code and/or documentation, this page should remain on the wiki as a reminder of what was done and how it was done. However, there is no guarantee that this page is updated in the end to reflect the final state of the project

So chances are that this page is considerably outdated and irrelevant. The notes here might not reflect the current state of the code, and you should not use this as serious documentation.

Goal: clean up code of sourceanalysis, sourcedescriptives, freqdescriptives.

  • Ad sourceanalysis:

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.

  • Ad sourceanalysis:

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.

  • Ad sourcedescriptives:

from previous changes the data representation will be much less complicated, allowing for a cleaner implementation.

  • Ad sourcedescriptives/freqdescriptives:

identify commonalities in required functionality. With more consistent data representations sharing of common code will be the goal.

  • Ad everything:

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:

  • Source structure will be defined as follows:
  1. source.pos [Nx3] (or [Nx(3*m)]) positions of dipole locations
  2. source.dim (optional) if the positions represent a 3D volume
  3. source.trial and source.avg (trialA, trialB, avgA, avgB) will not be supported anymore
  4. all voxel-specific data will be stored as a field (not as a subfield), each with its own

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'
  • The following steps have to be taken in this order:
    1. adjust checkdata to be able to make conversion between old-style source data an new-style source data
    2. create new functions 'parallel' to the existing ones, starting from the back of the analysis pipeline to allow for a smooth transition and to enable us to commit code throughout the re-structuring
    3. sourcestatistics (without using statistics_wrapper)
    4. sourcedescriptives
    5. sourcegrandaverage/parameterselection/source2full/source2sparse/volumeXXX)
    6. sourceanalysis
  • Grep all functions which call parameterselection/getsubfield, because they may lead to conflicts since these functions then

possibly rely on the old-style source format.