Phantom Dipole on VectorView
Masao Matsuhashi
matuhasi at KUHP.KYOTO-U.AC.JP
Tue Nov 6 07:38:53 CET 2007
Dear Fieldtrip users (especialy the Neuromag users),
I want to use Fieldtrip to analyze my Vectorview data.
Fist I tried a phantom recording and performed an ECD analysis, but the
result does not match. Please see the example below. The difference
within 5 mm may be ok, but the y-axis...
Would you please tell me what is wrong?
One concern may be that the Neuromag coordinate frame is different from
CTF coordinate, but this does not matter if I do not try to overlay the
source onto MRI, am I right?
SSP significantly distorts the waveform of this huge field, so I am fine
without it.
Thank you in advance,
Masao
Phantom Dipole #10 at (0.0, -4.86, 2.35)
Estimated position: (-0.598803 -6.67657 2.81002)
Raw data file: Dip10_1000nA_std_03_raw.fif
MATLAB Version 7.5.0.342 (R2007b)
fieldtrip-20071105
=================== Procedure ===============================
sRawFIFF_name='Dip10_1000nA_std_03_raw.fif';
pre=0.05;
post=0.1;
% create trial info
hdr = read_fcdc_header(sRawFIFF_name);
prep=round(pre*hdr.Fs);
postp=round(post*hdr.Fs);
data= read_fcdc_data(sRawFIFF_name,'chanindx',315);
data=reshape(data,numel(data),1);
trig = find(diff(data)>0);
trig = trig(2:end-1);
%read data
cfg = [];
cfg.trl = [trig-prep,trig+postp,repmat(-prep,size(trig))];
cfg.dataset = sRawFIFF_name;
cfg.datatype = 'continuous';
cfg.blc = 'yes';
cfg.blcwindow = [-pre 0];
cfg.channel = 'all'; % 'MEG' does not work
data = preprocessing(cfg);
% average
cfg = [];
avg = timelockanalysis(cfg, data);
% show waveform
figure
plot(1000*avg.time, avg.avg) % convert time to ms
xlabel('time (ms)')
ylabel('field amplitude (T)')
axis tight
grid on
% fit a dipole
cfg = [];
cfg.latency = [0.019];
cfg.numdipoles = 1;
cfg.gradfile = sRawFIFF_name;
cfg.vol.o = [0,0,0]; % in cm
cfg.vol.r = 7; % should not matter
cfg.grid.xgrid = -7:1:7;
cfg.grid.ygrid = -7:1:7;
cfg.grid.zgrid = -1:1:8;
dip = dipolefitting(cfg, avg)
=================== Output ===================================
ntrl =
111
reading and preprocessing
reading and preprocessing trial 1 from 111
reading and preprocessing trial 2 from 111
...
reading and preprocessing trial 111 from 111
the input is raw data with 315 channels and 111 trials
applying preprocessing options
averaging trials
averaging trial 1 of 111
averaging trial 2 of 111
...
averaging trial 111 of 111
the input is timelock data with 315 channels and 158 timebins
using headmodel specified in the configuration
reading gradiometers from file Dip10_1000nA_std_03_raw.fif
selected 306 channels
selected 1 topographies
900 dipoles inside, 1348 dipoles outside brain
scanning grid
scanning grid location 1/900
scanning grid location 2/900
...
scanning grid location 900/900
found minimum after scanning on grid point [0 -6 3]
First-order
Iteration Func-count f(x) Step-size optimality
0 4 0.848031 0.0232
1 12 0.842257 10 0.0127
2 16 0.837597 1 0.00289
3 20 0.837204 1 0.00185
4 24 0.837115 1 0.000602
5 28 0.837106 1 0.000173
6 32 0.837105 1 4.07e-006
7 36 0.837105 1 1.86e-007
8 40 0.837105 1 1.04e-007
9 48 0.837105 0.407507 2.98e-008
Optimization cannot make further progress:
relative change in x less than options.TolX.
found minimum after non-linear optimization on [-0.598803 -6.67657 2.81002]
dip =
label: {1x306 cell}
dip: [1x1 struct]
Vdata: [306x1 double]
Vmodel: [306x1 double]
time: 0.0191
dimord: 'chan_time'
grad: [1x1 struct]
cfg: [1x1 struct]
=================== End ======================================
----------------------------------
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