Signal2 format import

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Thu Oct 5 11:05:42 CEST 2006

Hi Gijs and Vladimir,

On 4 Oct 2006, at 20:38, Gijs van Elswijk wrote:
> The "read_ced_son" code has not been tested with non-continuous
> Spike2 files. However, recently a colleague of mine has used the
> Fieldtrip routines to read his non-continuous Spike2 data. It seems
> to work fine. I have not tested any Signal data files (which are
> always non-continuous as far as I know).

The preprocessing function of Fieldtrip always assumes that data is
continuous, i.e. all data samples are numbered as if they were
continuous. The definetrial function has to take care of trial
boundaries, and definetrial (or your own trialfun) should ensure that
the datasegments of interest do not cross trial boundaries. However,
if you use filter padding in preprocessing, then your segments of
interest (i.e. the "trl" matrix from definetrial) are extended on
both sides, and then it may happen that the padded segment extends
over a trial boun. To catch those situations, the read_fcdc_data
function will check whether the requested data extends over trial
boundaries in a discontinuous file (and give an error if it does).

So by default in the case of real non-continuous data, the
read_fcdc_data function should catch situations where it tries to
read data that crosses a trial boundary. However, that will only work
if the header (obtained from read_fcdc_header) correctly specifies it
that the data is trial based. You may want to check that in the
read_ced_con importer.

In some cases, trial-based data can also be interpreted as
continuous, e.g. when you acquire CTF data in pseudo-continuous mode.
The file then contains trials, but there are no holes between them.
In that case, you should use cfg.datatype='continuous' in
preprocessing (and in the artifact detection functions). That option
tells the read_fcdc_data function that it should NOT do the trial
boundary check.


More information about the fieldtrip mailing list