[FieldTrip] topoplot of vector

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Fri May 25 11:16:34 CEST 2012


Dear Fanny, Arjen,

I would like to add something to that. Like Arjen said, first make a
ft-like structure, but don't 'fake it' by naming your datafield e.g.
'powspctrm', but name it appropriately and use the cfg.parameter field in
the plotting functions to specify the field you want to plot.

In similar cases what I always do is to add extra field to my main data
structure. This could be, e.g. different statistical maps, different ways
of normalizing etc:

data.dimord = 'chan_freq'
data.powspctrm = [N x 1];
data.powspctrmLOG = [N x 1];
data.stat_difference = [N x 1];
data.conditionA_minus_B = [N x 1];
etc.

This is memory efficient, makes it easy to keep things together (the
repetition/trial dimension with the trialinfo, for instance), don't mix up
the field and to them without messing around with temporary data
structures.

Note that many functions that work on datastructures use the cfg.parameter
field. For instance averaging, baselinecorrection, grandaverage etc. all
should work in this way.

cheers,
Stephen

On 25 May 2012 11:00, Stolk, A. <a.stolk at fcdonders.ru.nl> wrote:
> Hi Fanny,
>
> If you want to plot results that are not the output from a ft function, you could try and place the obtained vector in a ft-alike structure.
>
> For example;
> data.powspctrm = your_vector_here; % [N x 1]
> data.freq = 1;
> data.label = your_label_here; % {1 x N}
> data.dimord = 'chan_freq';
> ft_topoplotER(cfg,data)
>
> The topoplot function is deprecated and still in the software package for compatibility reasons. Alternatively, have a look how ft_topoplotER/TFR calls the low-level ft_plot_topo function. I recon the above solution is easier.
>
> Hope this helps,
> Arjen
>
>
> ----- Oorspronkelijk bericht -----
>> Van: "Fanny Quandt" <fannyquandt at gmail.com>
>> Aan: fieldtrip at donders.ru.nl
>> Verzonden: Vrijdag 25 mei 2012 10:12:58
>> Onderwerp: [FieldTrip] topoplot of vector
>> Dear Fieldtrip-User,
>>
>> I am trying to plot some results ( one value per channel) using a
>> topoplot function.
>> Since I am working with ECoG data, I specified my own layout with
>> ft_prepare_layout. Plotting my results obtain from ft_freqanalysis
>> using ft_topoplotER works just fine.
>>
>> Now 2 Questions:
>>
>> 1) Is there a way to plot data, using ft_topoplotER , which is not
>> obtain from freqanalysis or timelocked analysis, but which is only a
>> vector.
>>
>> 2) I tried using the function topoplot (topoplot(cfg,dat) where cfg
>> contained the layout. However I get the following error message. It
>> might be that some points of my mask fall outside the outline, which
>> does not cause a problem using ft_topoplotER.
>>
>> Undefined function 'inside_contour' for input arguments of type
>> 'double'.
>>
>> Error in topoplot (line 488)
>> maskA(inside_contour([Xi(:) Yi(:)], cfg.layout.mask{i})) = true;
>>
>>
>> I would very much appreciate any help.
>> Best,
>> Fanny
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at science.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at science.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list