4D data files
Robert Oostenveld
r.oostenveld at FCDONDERS.RU.NL
Thu Sep 14 20:45:16 CEST 2006
Dear Sylvia,
On 14 Sep 2006, at 18:27, Silvia Gennari wrote:
> I am trying to get fieldtrip to read 4D data (BTi). I can see in my
> data all the pertinent information.
Sounds good. Are you using ascii files exported with 4D software, or
are you using the original files?
> But the scanner produces several files in which the information is
> distributed.
That is not a problem in itself, as long as you can refer to the
collection of data as a whole. The CTF systems produce a directory
(that has a name ending with *.ds) with a whole bunch of files in
them. In that case we point to it as cfg.dataset="directory_name". In
the case of BrainVision Analyzer EEG data, the data, header and
triggers are in three seperate files, in which only the extension
differs. In that case we use cfg.datafile and cfg.headerfile, each
pointing to the appropriate file. There is even a function that
translates between them, i.e. that sorts out the filenames (see
fieldtrip/private/dataset2files). For the events, most intelligence
is in read_fcdc_event, where it determines on the fly which trigger
file belongs to the dataset/datafile/headerfile.
How many files do you have? Do the files all have the same basename
(i.e. without the extension)? If more than three and if they don't
have similar names, I suggest to put them in a directory and treat it
as in the CTF case. If they have a similar basename, I would put the
intelligence for figuring out the extensions in the low level
functions. If you have two, I would use the datafile/headerfile
specification. Could you upload a zip file with some demo data on
ftp://ftp.fcdonders.nl/pub/incoming (anonymous login, the directory
is write only)?
> The header information as well as the trigger information, sample
> rate and sensor positions is in a different file from the actual
> raw data files. This data files can be read into matlab with no
> problems. But Fieldtrip needs to put this together with the header
> and triggers.
I suggest that you look at the specifications in the documentation in
read_fcdc_data and read_fcdc_header, and that you try to implement a
read_bti_data and read_bti_header function that behave similar. If
that works, I will include them in fieldtrip as low level functions
(i.e. requires a minimal amount of "glue" between fieldtrip and your
functions). Alternatively, you can also implement the read_bti_data
and read_bti_header in any way you like, and I will also be able to
glue them into the read_fcdc_data and read_fcdc_header wrapper
functions.
Important to realise is that the read_fcdc_data/header functions are
rather minimalistic. Most complex stuff is taken care of by the
fieldtrip definetrial and preprocessing functions. There are two
other details that are important, and that is adding support to
read_fcdc_event and writing a private/bti2grad function (see
ctf2grad, yokogawa2grad and fif2grad for examples and see link1
below). Regarding events: I have no idea about how that is arranged
in the bti files, but the end result should look like an event
structure. I suggest that you look through the read_fcdc_event
function and at the documentation at link2.
I hope this helps to get started.
best regards,
Robert
PS the thee read_fcdc_xxx functions directly call the private/
read_xxx functions. Those are functionally equivalent, but more
flexible. For the motivation behind it and otyher details, see link3.
link1 -> http://www2.ru.nl/fcdonders/fieldtrip/doku.php?
id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes
_magnetometers_or_gradiometers_described
link2 -> http://www2.ru.nl/fcdonders/fieldtrip/doku.php?
id=fieldtrip:documentation:frequently_asked_questions#what_is_the_relati
on_between_events_such_as_triggers_and_trials
link3 -> http://www2.ru.nl/fcdonders/fieldtrip/doku.php?
id=fieldtrip:development:read_fcdc_xxx
More information about the fieldtrip
mailing list