[FieldTrip] Fwd: Re: How to impove dics realfilter solution

Gio Piantoni g.piantoni at nin.knaw.nl
Fri Sep 28 10:50:35 CEST 2012


Hi Michael,

Thanks for your suggestion! In fact, the contribution of the imaginary
part increases with higher levels of noise (and it's zero when the
noise is zero). I tested with a simulation (see code below). The
imaginary part derives from the uncorrelated sensor noise and seem to
contain no meaningful information, sorry if I had given wrong
information before, my intuition tricked me.

Thanks for the interesting discussion!

Cheers,
Gio

%-----------------%
%-forward model
fieldtripdir = '/path/to/fieldtrip/';

elec = ft_read_sens([fieldtripdir 'template/electrode/standard_1020.elc']);
load([fieldtripdir 'template/headmodel/standard_bem.mat']);

cfg = [];
cfg.elec = elec;
cfg.vol = vol;
cfg.grid.xgrid = -80:10:80;
cfg.grid.ygrid = -110:10:80;
cfg.grid.zgrid = -70:10:90;
cfg.inwardshift = 1;
lead = ft_prepare_leadfield(cfg);
%-----------------%

%-------------------------------------%
%-loop over relative noise
relnoise = 0:.05:1;
realfilter = zeros(size(relnoise));
imagfilter = zeros(size(relnoise));
for i = 1:numel(relnoise)

  %-----------------%
  %-create data
  cfg = [];
  cfg.dip.pos = [10 30 30];
  cfg.dip.mom = [1 0 0]';
  cfg.dip.frequency = 10;
  cfg.vol = vol;
  cfg.relnoise = relnoise(i);
  cfg.elec = elec;

  data = ft_dipolesimulation(cfg);
  %-----------------%

  %-----------------%
  %-fourier freq
  cfg = [];
  cfg.method    = 'mtmfft';
  cfg.output    = 'fourier';
  cfg.taper = 'hanning';
  cfg.foilim    = [10 10];
  freq = ft_freqanalysis(cfg, data);
  %-----------------%

  %-----------------%
  %-beamformer
  cfg = [];
  cfg.method = 'dics';
  cfg.frequency = 10;
  cfg.grid = lead;
  cfg.vol = vol;
  cfg.elec = elec;
  cfg.dics.projectnoise = 'yes';
  cfg.dics.lambda = '1%';
  cfg.dics.keepfilter = 'yes';

  source = ft_sourceanalysis(cfg, freq);

  %-take one dipole as example
  realfilter(i) = sum(abs(real(source.avg.filter{source.inside(100)}(:))));
  imagfilter(i) = sum(abs(imag(source.avg.filter{source.inside(100)}(:))));
  %-----------------%

end

plot(relnoise, realfilter)
hold on
plot(relnoise, imagfilter, 'r')
%-------------------------------------%


On Thu, Sep 27, 2012 at 8:03 PM, Michael Wibral <michael.wibral at web.de> wrote:
>
>
>
>
> -------- Original Message --------
> Subject: Re: [FieldTrip] How to impove dics realfilter solution
> Date: Thu, 27 Sep 2012 20:01:22 +0200
> From: wibral <wibral at em.uni-frankfurt.de>
> Reply-To: wibral at em.uni-frankfurt.de
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
>
>
>
> Dear Filedtrip users,
>
> I fully agree with jan Mathijs,
>
> in principle when using DICS to reconstruct source power, the nature of
> the physical processes (forward model) should guarantee that filters are
> automatically real-valued, because this reflects the quasi-static
> approximation of maxwell's equations which holds pretty well in MEG. In
> practice filter coeffcients only deviate from being real because of sensor
> noise, which is not a desirable effect.
>
> Best,
> Michael
>
>
> On 09/27/2012 01:39 PM, jan-mathijs schoffelen wrote:
>
> Dear Björn, caro Gio,
>
> I don't agree with you, Gio, that one should use complex-valued filters.
> The reason for this is that they don't make sense from a biophysical point
> of view. The mixing from sources to channels (as represented in the
> leadfields) is strictly real-valued, because it is (near-)instantaneous. I
> think that the unmixing from channels to sources also should be real-valued,
> for the same argument. When you allow filter coefficients to be
> complex-valued, this is equivalent to allowing the sensor-level signals to
> be shifted in time with respect to one another. I consider this a bit odd.
> In Joachim's seminal paper (on which FieldTrip's initial DICS implementation
> is based), this was not really explicit in the methods description. However,
> based on personal communications with said Joachim, I at least distilled
> that the filters should be real-valued. The complex-valued filters were kept
> in (as default) for backward compatibilitiy reasons. Although mathematically
> possible (perhaps even more strictly answering to the minimum variance and
> unit gain constraints), and sometimes seemingly giving nicer subjective
> results, I'd advice against using them.
>
> Cheers,
>
> JM
>
>
>
> On Sep 25, 2012, at 12:21 PM, Gio Piantoni wrote:
>
> Hi Björn,
>
> It's not surprising that the results are pretty bad after using real
> filters. The fourier transform and DICS are intrinsically
> complex-valued, so using only the real part means throwing away half
> of the information (and getting meaningless results).
>
> The realfilter option was implemented in order to allow to pass the
> time-domain signal through the complex-value spatial filter and obtain
> a "virtual electrode". A virtual electrode with complex values is
> "weird to say the least", see:
> http://mailman.science.ru.nl/pipermail/fieldtrip/2006-May/000510.html
> Robert considered it an error in the algorithm and fixed it by
> providing the realfilter option. However, to me it seems more correct
> to think that complex spatial filters requires complex input (i.e.
> frequency-domain signal), so don't use DICS spatial filters on
> time-domain real-valued MEG recordings to generate time-domain virtual
> electrodes. If you want time-domain virtual electrodes, use LCMV
> spatial filters centered at the location of interest. Other smart
> people might disagree though.
>
> I suggest not to use realfilter option at all, but I'd be happy to
> hear other meaningful applications of this option.
>
> Hope this helps,
>
> Gio
>
> On Fri, Sep 14, 2012 at 10:23 AM, Björn Herrmann <bherrmann at cbs.mpg.de>
> wrote:
>
> Dear fieldtrip user,
>
>
> I am using the DICS beamformer to localize a 3Hz FFT power topographical
> distribution (using a neuromag system). The topographies are very clear
> auditory in single subjects, thus it shouldn't be a problem finding the
> "right" solution. When I use the beamformer to obtain complex-value spatial
> filters, the solution looks very good (using NAI). No problem here. However,
> using cfg.dics.realfilter = 'yes', i.e. the spatial filter will have real
> values, the localization completely breaks down, sometimes even finding a
> strong peak in the opposite hemisphere than visible in the sensor topography
> (the head is centered in the sensor array).
>
>
> Does someone have a suggestion how to improve the solution using
> realfilter = 'yes'. I use the following settings. They are rather standard I
> guess.
>
>
> cfg = [];
>
> cfg.method            = 'dics';
>
> cfg.frequency         = 3;
>
> cfg.dics.projectnoise = 'yes';
>
> cfg.dics.lambda       = '5%';
>
> cfg.dics.keepfilter   = 'yes';
>
> cfg.dics.realfilter   = 'yes';
>
> cfg.dics.fixedori     = 'no';
>
>
>
> If someone has a suggestion, I would appreciate it.
>
> Thanks in advance,
>
> best,
>
>
> Björn
>
>
>
>
> _______________________________________________
>
> fieldtrip mailing list
>
> fieldtrip at donders.ru.nl
>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
> Jan-Mathijs Schoffelen, MD PhD
>
> Donders Institute for Brain, Cognition and Behaviour,
> Centre for Cognitive Neuroimaging,
> Radboud University Nijmegen, The Netherlands
>
> Max Planck Institute for Psycholinguistics,
> Nijmegen, The Netherlands
>
> J.Schoffelen at donders.ru.nl
> Telephone: +31-24-3614793
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list