Skip to content

Commit

Permalink
Update: MEG sensors display correct location (#637)
Browse files Browse the repository at this point in the history
* update the MEG sensors display, this PR allow the discpaly the correct postion of the sensor and not the intergation points

* Remove old code and add comment
  • Loading branch information
tmedani authored Aug 21, 2023
1 parent 40188c9 commit e4e2788
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions toolbox/gui/view_leadfield_vectors.m
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ function DrawArrows()
delete(findobj(hAxes, '-depth', 1, 'Tag', 'SelChannel'));
% Plot selected sensor
if ~isempty(Channels(iChannel).Loc) && ~ismember(Channels(iChannel).Name, {'EEG','MEG','MEG MAG', 'MEG GRAD'})
line(Channels(iChannel).Loc(1,1), Channels(iChannel).Loc(2,1), Channels(iChannel).Loc(3,1), ...
% Center of mass of all coordinates
line(mean(Channels(iChannel).Loc(1,:),2), mean(Channels(iChannel).Loc(2,:),2), mean(Channels(iChannel).Loc(3,:),2), ...
'Parent', hAxes, ...
'LineWidth', 2, ...
'LineStyle', 'none', ...
Expand Down Expand Up @@ -477,7 +478,8 @@ function DrawArrows()
Channels = ChannelMat.Channel(iChannels);
% Get channels locations
if length(Channels) > 10
markersLocs = cell2mat(cellfun(@(c)c(:,1), {Channels.Loc}, 'UniformOutput', 0))';
% Center of mass of all coordinates for each sensor
markersLocs = cell2mat(cellfun(@(c) mean(c,2), {Channels.Loc}, 'UniformOutput', 0))';
end
% Ask to select reference
isOk = SelectReference();
Expand Down

0 comments on commit e4e2788

Please sign in to comment.