Missing dim filed after source analysis.

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Thu Oct 2 17:39:32 CEST 2008

Hi Michael,

On 2 Oct 2008, at 16:02, Michael Wibral wrote:
> I am having a little problem with the beamformer (dics) tutorial. If
> I run first sourceanalysis on 'data' like this:
> SourceDataSingleTrial=sourceanalysis(cfg, data)
> applying precomputed filters to single trials (as in the tutorial)
> and then feed SourceDataSingleTrial to sourcestatistics like this:
> SourceStats=sourceanalysis(cfg,SourceDataSingleTrial )
> Then sourcestatistics complains about a missing filed 'dim'.

Are you working wih the latest copy of fieldtirp? If not, please see
whether that fixes the problem.

> I can fix this problem by creating the field SourceStats.dim by hand,

I presume you mean that you add dim to SourceDataSingleTrial and not
to SourceStats?

> giving the voxel conuts in each dimension [voxX voxY voxZ] and the
> code runs. However, the function might also need the number of
> trials or the like ???

The number of trials is determined in the code as
length(SourceDataSingleTrial.trial) and equals size(cfg.design,2).

> Any idea what could be the reason for sourceanalysis not producing
> the dim field?

We recently started cleaning up the representation of source data. In
the FT code there was a possible confusion about sources being
represented as a "random set of points", where each point is specified
by its position, or represented as a nicely arranged 3D volume. In the
latter case you can also specify the position of each voxel, but the
latter case is more conveniently represented using a homogenous
transformation matrix in combination with voxel indices.

This cleanup was realized in the "checkdata" function, which ensures
that the input to each FT function is as what the function expects.
The checkdata function manages backward compatibility of data
structures (i.e. still allowing to work with data that was sitting in
a mat file for a long time, and not requiring to compute the data
every time) and it tries to convert data between different
representations (i.e. volume->source_positions and the other way
around if the positions are arranged in a 3D grid).

I'll try to reproduce the problem and get back to you. For the moment
you can just add the dim field, that won't break anything.

best regards,

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.

More information about the fieldtrip mailing list