Back to the main page.
Bug 2166 - dics beamformer with rawtrial='yes' and fixedori='yes' still computes filter per trial
Status | CLOSED FIXED |
Reported | 2013-05-14 14:12:00 +0200 |
Modified | 2014-01-29 13:28:35 +0100 |
Product: | FieldTrip |
Component: | inverse |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P3 normal |
Assigned to: | Eelke Spaak |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Eelke Spaak - 2013-05-14 14:12:58 +0200
I'm not sure whether this is a bug or not (but suspect it is). Lines 305-321 of beamformer_dics read: if fixedori % compute the leadfield for the optimal dipole orientation % subsequently the leadfield for only that dipole orientation will % be used for the final filter computation if isfield(dip, 'filter') && size(dip.filter{i},1)~=1 filt = dip.filter{i}; else filt = pinv(lf' * invCf * lf) * lf' * invCf; end [u, s, v] = svd(real(filt * Cf * ctranspose(filt))); maxpowori = u(:,1); eta = s(1,1)./s(2,2); lf = lf * maxpowori; dipout.ori{i} = maxpowori; dipout.eta{i} = eta; if ~isempty(subspace), lforig = lforig * maxpowori; end end so it is checked whether there is a pre-supplied filter first. However, it is only used if size(dip.filter{i},1)~=1. It seems to me that the condition should be size(dip.filter{i},1)==1, so only use it if there IS only one row, meaning that the filter projects toward a single orientation already. If the provided filter already projects to a single orientation, should the above code be changed to: if fixedori % compute the leadfield for the optimal dipole orientation % subsequently the leadfield for only that dipole orientation will % be used for the final filter computation if isfield(dip, 'filter') && size(dip.filter{i},1)==1 filt = dip.filter{i}; else filt = pinv(lf' * invCf * lf) * lf' * invCf; [u, s, v] = svd(real(filt * Cf * ctranspose(filt))); maxpowori = u(:,1); eta = s(1,1)./s(2,2); lf = lf * maxpowori; dipout.ori{i} = maxpowori; dipout.eta{i} = eta; if ~isempty(subspace), lforig = lforig * maxpowori; end end end so there won't be a dipout.ori/eta anymore, but that is fine since the filter was precomputed.
Eelke Spaak - 2013-05-15 17:11:13 +0200
fixed in 2166
Eelke Spaak - 2013-05-15 17:11:39 +0200
(In reply to comment #1) Note that the code I posted in my first description was not completely right.