[FieldTrip] how to specify each channel-color in a topoplot
michelecolombo at live.it
Fri May 30 17:19:24 CEST 2014
My goal is to make a double plot:
1) a subplot with a topoplot of channel-values that are color-mapped,
2) a sorted stem-plot where the stem color is mapped to its height., and
represent the channel values
The outcome should be more easily interpretable than a colorbar, because
it would allow to appreciate the whole distribution at a glance, and
provide spatial info about the distance between colors.
The first step would be to visualize a 1*num_channels vector plotted
on the eeg scalp, with the usual topoplot style, and with colors that I
I compute these values outside of fieldtrip, so I need to re-create the
expected fieldtrip structure.
Question: how to properly preserve the value-color mapping?
all the intuitive options I tried fail with this respect. somehow the
colormap given is used as the range of possible color-rgb-values, and
subsequently the colors are chosen from this map. Instead, I would want
to actually give the channel-by-channel color value to be plotted on the
scalp, (interpolating as usual in the space across channels).
attached, you can see a failed attempt: the colormap plotted is
flattened to a very narrow sub-range of the colomap given.
relevant parts of the used code:
hh=axes('Position',[.62 .6 .3 .3],'Layer','top'); %
overlay on plot
% the way i define the colormap. I tried also with a simple:
cfg.colormap= rgbslide(all_chan_stat,'low_color',[0 0
'high_color',[1 0.9 0],'res',numel(all_chan_stat));
if ~isempty([bads_max bads_min])
cfg.highlight=sort([bads_max bads_min]); % hilight
some outliers. this works fine.
topoplot(cfg,[all_chan_stat']); % all_chan_stat is my
1*num_channels = 257 channels from the EGI system.
% the old-deprecated topoplot function seems more easily accessible than
the current one, provided I just use fieldtrip to plot, not to compute,
for cc= 1: length(channels)
stem(cc, sorted(cc), 'Color',
cfg.colormap(cc,:), 'MarkerFaceColor', cfg.colormap(cc,:)) ; hold on;
Another option would be to first do the topoplot, given a colormap, then
to retrieve the color plotted at each channel (but I don't know how),
and use these colors to plot the stem
another attempted option:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 39798 bytes
Desc: not available
More information about the fieldtrip