Hi Don,
thanks for sharing your experiences with us.
On 11 Nov 2008, at 23:12, Rojas Don wrote:
> I notice that there are a
> number of errors with respect to the channels and other aspects of
> the spm8
> converted files. For example, in the 4D headframe, +x is anterior
> and +y is
> left.
The reading functions in the fileio toolbox (used in spm and
fieldtrip) does not change the representation of geometrical "objects"
in the data (i.e. anything that is epressed in meters, inches or
whatever distance measure). Not changing here means that the units
remain the same as the ones used in the datafile, and that the
coordinate system remains the same. SPM and FieldTrip have different
expectations w.r.t the coordinate systems, and any coordinate system
changes that are needed are dealt with outside of the reading functions.
We do try to indicate the unit in the structure, like this
>> gradiometers = read_sens('Subject01.ds')
gradiometers =
pnt: [356x3 double]
ori: [356x3 double]
tra: [184x356 double]
label: {184x1 cell}
unit: 'cm' <----------- HERE
balance: [1x1 struct]
and when needed, the units will be automatically converted between mm,
cm or m.
There is no indication of the coordinate system in the matlab
representation of the data, because too often the coordinate system is
implicit in the file and not explicit. I.e. different labs have
different conventions about where to place head localization coils. As
far as the reading functions are concerned, the user should ensure
that the coordinate systems match. At the higher level of the user
application (e.g. SPM or FieldTrip), functions are provided that help
the user in coregistring the different geometrical objects
(electrodes, gradiometers, anatomical MRI, dipole locations, volume
conductor, ...).
> So, in my own converter function, which I'm glad to forward if anyone
> is interested, the x and y from the 4D are swapped and the 4D +y
> becomes -y
> before the swap (all assuming that spm represents +y anterior and +x
> right,
> which is how I read the coordinates from the EEG templates and example
> files. I am using Eugene Kronberg's pdf4D object to perform the
> reading
> from the 4D raw files. I believe that his code has been incorporated
> into
> Fieldtrip, but I'll need to dig into the convert code in spm8 to see
> what's
> going on. I'm not a Fieldtrip user myself, so I cannot say for
> certain how
> it incorporates Eugene's code.
I suggest that you have a look at the fileio code here
ftp://ftp.fcdonders.nl/pub/fieldtrip/modules
and here
http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:development:fileio
Note that I'll soon have to move the fieldtrip wiki over to another
server (the www2 machien will be decommissioned), so the deep-link
will not work any more. The documentation will remain avaialble
through http://www.ru.nl/neuroimaging/fieldtrip.
The documentation on the wiki only explains the read_header, read_data
and read_event function. However, by now we also have added generic
readers for
- headshape and fiducial information (read_headshape)
- sensor information such as magnetometers/gradiometers (read_sens)
- volume conduction models (read_vol)
there is also a general function that determines the type of channel
(e.g. eeg/meg/refchan/trigger/adc/dac). Sofar that "chantype" function
does not have support for 4D data, but that would be very usefull.
I hope this clarifies it a bit. Sofar Jan-Mathijs (Glasgow) has been
the main contributor of the 4D/BTi reading functions in fileio, and
they are now the main 4D user of fieldtrip+fileio with their 248
channel 4D system. Other people (a.o. from Konstanz) have been using
fieldtrip as well, but probably not as intense as in Glasgow.
best regards,
Robert
|