Skip to content

Commit

Permalink
Changes in sensors_topoplot.m related to issue #29
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Becker committed Oct 30, 2017
1 parent 6b5cf59 commit 5fce532
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions africa/sensors_topoplot.m
Expand Up @@ -25,15 +25,19 @@

comp2view = comp(indchantype(D,cmodality),:);

if (strcmp(cmodality,'MEGPLANAR')) % Average gradiometers
if (strcmp(cmodality,'MEGPLANAR')) % Average gradiometers (because there are two of them at each position)
comp2view = sqrt(comp2view(1:2:end,:).^2 + comp2view(2:2:end,:).^2);
end

if (strcmp(cmodality,'MEGMAG'))
cfg.channel = {'MEGMAG'};
%cfg.channel = {'MEGMAG'};
cfg.channel = {'all'};

cfg.layout = fullfile(osldir,'layouts','neuromag306mag.lay');
elseif (strcmp(cmodality,'MEGPLANAR'))
cfg.channel = {'MEGMAG'};
%cfg.channel = {'MEGMAG'};
cfg.channel = {'all'};

cfg.layout = fullfile(osldir,'layouts','neuromag306mag.lay');
elseif (strcmp(cmodality,'MEGGRAD'))
cfg.channel = {'MEG'};
Expand All @@ -49,10 +53,23 @@
error('Unsupported modality');
end




data.dimord = 'chan_comp';
data.topo = comp2view;
data.topolabel = D.chanlabels(indchantype(D,cfg.channel));

% gett
if (strcmp(cmodality,'MEGMAG')) || (strcmp(cmodality,'MEGPLANAR'))
data.topolabel = D.chanlabels(indchantype(D,'MEGMAG'));
else
data.topolabel = D.chanlabels(indchantype(D,cfg.channel));
end
data.time = {1};

%if (strcmp(cmodality,'MEGPLANAR')) % Plot every second gradiometer (because there are two of them at each position)
% data.topolabel=data.topolabel(1:2:end);
%end

%cfg = rmfield(cfg,'channel');
%cfg.component = 1:size(comp,2);
Expand All @@ -61,8 +78,11 @@
cfg.commentpos = 'title';

cfg.title = cmodality;
cfg.skipscale = 'yes'
cfg.skipcomnt = 'yes'


%cfg.layout = ft_prepare_layout(cfg);
cfg.layout = ft_prepare_layout(cfg);

if do_plot
ft_topoplotER(cfg,data);
Expand Down

0 comments on commit 5fce532

Please sign in to comment.