Hi!
I'm trying to compute dipole from aneeg timeseries file, however, I was just able to do so with dipole scan bs function, everytime I tried with ft_dipolefitting I got this error:
** Error: [process_ft_dipolefitting] Sources > FieldTrip: ft_dipolefitting
** Line 94: Not enough input arguments.
**
** Call stack:
** >bst_sourcegrid.m at 94
** >process_ft_dipolefitting.m>Run at 180
** >process_ft_dipolefitting.m at 28
** >bst_process.m>Run at 196
** >bst_process.m at 36
** >panel_process1.m>RunProcess at 151
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 772
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 296
**
**
** File: Andrew/ANDREWOC/data_block001.mat
**
Note: This is not an averaged file nor an ERP, is a short raw record,
when I computed dipole fitting with an averaged ERP I got no error messages, so I guess ft_dipolefitting works only with averaged files? or maybe my approach is wrong,
I just want to get the dipole for a single epileptic spike from an eeg record
Thanks in advance!
Hey Tourette,
The problem seems to be with the sInner variable in bst_sourcegrid, which is not put in as an argument and subsequently not defined. In line 94 it is checked if it is empty, though Matlab will error that the variable does not exist. Why it works for averaged ERP I wouldn't know, maybe it calls the functions a bit different.
It seems that at line 39 of bst_sourcegrid the variable sCortex is created and not used and if I change that to sInner the function runs.
I wouldn't advice changing it like me arbitrary in the code, but maybe Francois can chime in a bit more.
Kind regards,
Steven
I updated BS and it seems to work now but when I tried to compute a moving dipole from 121.4 to 122.4 s (this is the time when the spike begins), it gave me 521 dipoles as result!!!
I tried again with 121 to 122 s and now I got 750 dipoles!!
I don't know why I'm doing wrong
Can you help me?
File is not an avareged one but raw eeg data
Thanks in advance
Hi Tourette,
Since the dipole search algorithm doesn't incorporate time, one dipole per time point is created, which for 121 to 122 would indicate that you use a sampling frequency of 750 Hz. With the dipole subpanel you can visualize them for one time point or check the best fitting dipole .
Kind regards,
Steven
Thanks for the reply!
I will try a downsampled EEG file, but maybe it is related to the signal too (cause in ERP an averaged files it gives few dipoles despite sampling rate)
Right? (Or I missunderstood everything
)
It does not matter if the file is averaged or not.
The process ft_dipolefitting fits one dipole at each time sample you give in input. If you select one time sample only in input (time window = 121.4s-121.4s), you would get one dipole only. If you select N time samples in input (750 time samples between 121s and 122s?), you obtain N dipoles in output.