read_fcdc_event

Jan Mathijs Schoffelen Jan.Schoffelen at FCDONDERS.RU.NL
Fri Feb 17 14:56:56 CET 2006


Dear Kambiz,

If you already have 'preprocessed' your data, which I understand from your
statement that you already created new .ds, according to your conditions,
I'd say you do not need to use read_fcdc_event anymore to extract your
epochs of interest.
Am I correct in assuming, that the data you want to read in, is
'trial-based', with all trials of a given condition concatenated in time?
If it is too unpractical to re-create a newDs based on your raw data, then
you have to define your trials in a different way.

-As you have probably seen, you have to specify a trial-matrix in your
configuration. In the case of trial-based data, the header contains this
information:

hdr = read_fcdc_header(headerfile)

the fields:
hdr.Ntrials (or hdr.nTrials, I don't know anymore)
hdr.Nsamples

give the information you need (you also have to know about the offset of
each trial)

for j = 1:hdr.Ntrials
  trl(:,1) = ([1:hdr.Ntrials]'-1)*hdr.Nsamples + 1;
  trl(:,2) = ([1:hdr.Ntrials]')*hdr.Nsamples;
  trl(:,3) = the offset
end

Then you can put this in your configuration and proceed with the analysis.

-Another possibility is writing your own trial-detection function, not using
 read_fcdc_event, you can write your own function and call it when you

 specify cfg.trialfun = 'yourownfunction';

-Still, I would prefer my first suggestion, since the fun thing with
fieldtrip is, that you can really flexibly define your epochs of interest
from a datafile, which has been recorded continuously. One would not need to
make the data 'trial-based' using the ctf-software. That means that you
would have to create the newDs only once, and define your trials within
fieldtrip.

Yours,

Jan-Mathijs



-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Kambiz Tavabi
Sent: Friday, February 17, 2006 2:08 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] read_fcdc_event

Dear Jan,
This is not a practical workaround!  I have already too many datasets
extricated according to conditions from the raw continuous datasets.  What I
am trying to do with fcdc_event is an intermediary step in order to
implement the TF analysis capabilities in FieldTrip.  As I understand
FIELDTRIP was written around the CTF format and considering read_fcdc.... is
a low level operation I don't see why I need to use NewDs to meet a demand
imposed by FIELDTRIP.

Thanks,
Kambiz

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Jan Mathijs Schoffelen
Sent: Friday, February 17, 2006 12:03 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] read_fcdc_event

Dear Kambiz,

As a first guess I would try to explicitly create this virtual 'STIM'
channel, using DataEditor. Subsquently I would create a new dataset using
the command-line program newDs. I recall that it has an option to include
virtual channels in it. I would say, that then you have a dataset which
actually contains a 'STIM' channel, so you can use it on the fieldtrip-files
you have.

Hope this is a sufficient workaround,

Jan-Mathijs

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Kambiz Tavabi
Sent: Friday, February 17, 2006 11:13 AM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] read_fcdc_event

Hi Jan,

When it comes to MATLAB I am a low level kind of guy!

With a break @ line 64
>stim =  read_ctf_meg4(datafile, hdr, 1, hdr.nTrials*hdr.nSamples,
A call to stimindx returns; Empty matrix: 0-by-1.

The data I have has been recorded on a CTF machine with the newest available
software which apparently displays only a virtual channel labeled STIM seen
in the Data Editor.  The virtual STIM channel is a combination of UPPT01 &
UPPT02 parallel ports used for stimulus delivery.  I can send you the dsinfo
for this file if you'd like.

Apparently stimindx is empty; and my dataset consists of a no channel
labeled STIM.  But this is in accordance with current CTF format.  What to
do now?

Thanks,
Kambiz


-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Jan Mathijs Schoffelen
Sent: Friday, February 17, 2006 10:18 AM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] wavelet analysis

Dear Kambiz,

This looks like a pretty low level error to me.

>??? Error using ==> fieldtrip-20060131\private\read_ctf_meg4
>no channels were specified for reading CTF data

>Error in ==> fieldtrip-20060131\private\read_ctf_trigger at 64
>stim =  read_ctf_meg4(datafile, hdr, 1, hdr.nTrials*hdr.nSamples,
stimindx);

It seems as if the variable stimindx has not been defined. Perhaps you could
check that first, by putting a breakpoint at the specified line in
read_ctf_trigger.

Might it be the case that your dataset does not contain a channel with the
label 'STIM'?

Yours, Jan-Mathijs



More information about the fieldtrip mailing list