<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Benjy,
<div class=""><br class="">
</div>
<div class="">It looks as if you are almost there.</div>
<div class=""><br class="">
</div>
<div class="">That is, I don’t know what your data structure looks like, but if you create it sufficiently lean, and internally consistent, it should work.</div>
<div class="">Something like:</div>
<div class=""><br class="">
</div>
<div class="">data = [];</div>
<div class="">data.weights = weights;</div>
<div class="">data.label = <list-of-labels>;</div>
<div class="">data.time = 0; % just give it a value</div>
<div class="">data.dimord = ‘chan_time’;</div>
<div class=""><br class="">
</div>
<div class="">Alternatively, you can use the lower-level function ft_plot_topo (it’s in fieldtrip/plotting): this function requires also ‘low-level’ input arguments, i.e. two vectors of x and y coordinates of the sensor positions, the vector with the to-be-plotted
 values, and some additional options for aesthetics. I think the help documentation of this function explains it well enough.</div>
<div class=""><br class="">
</div>
<div class="">Two points of caution: </div>
<div class="">1) with the 306 mixed gradiometer/magnetometer system it probably does not make sense to visualize a topogrophy of the gradiometers and magnetometers mixed, and also, using the gradiometers only it probably will probably not result in a nice topography. </div>
<div class="">2) it could be that it is more informative to look at the ‘forward mixing weights’, rather than the unmixing weights that drop out of your classifier. An exceptionally good read about this issue is provided in: <a href="https://doi.org/10.1016/j.neuroimage.2013.10.067" class="">https://doi.org/10.1016/j.neuroimage.2013.10.067</a></div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 5 Mar 2021, at 15:18, Barnett, Benjy <<a href="mailto:benjy.barnett.20@ucl.ac.uk" class="">benjy.barnett.20@ucl.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi!
<div class=""><br class="">
</div>
<div class="">I am trying to plot the topography of my LDA weights, but am having some trouble. I am using my own script to calculate the weights rather than any packages (e.g. DMLT, or MVPA-light), so the tutorials on the fieldtrip site haven’t been able to
 help me. So far, I’ve simply tried adding the weights (a 306x1 length vector) as a field to my data structure. And trying this code:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">data.weights = weights;</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">cfg.xlim =<span style="color: #a020f0" class="">'maxmin'</span>;</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">cfg.zlim =
<span style="color: #a020f0" class="">'maxmin'</span>;</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(160, 32, 240);" class="">
<span style="" class="">cfg.layout = </span>'neuromag306all.lay'<span style="" class="">;</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">cfg.channel =
<span style="color: #a020f0" class="">'MEG'</span>;</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(34, 139, 34);" class="">
<span style="" class="">cfg.parameter = </span><span style="color: #a020f0" class="">'weights'</span><span style="" class="">; </span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">figure; ft_topoplotER(cfg,data); colorbar</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 14px;" class="">
Unsurprisingly, this doesn’t work. It results in the error 'field “weights" not present in data’. I assume because the weights field is not interpretable by the fieldtrip code. I guessed the lack of a dimord field for the weights might be underlying its lack
 of interpretability, but playing around with that has not worked either. I’ve tried adding a ‘weightsdimord’ field with the [306x1] dimensions, but this also - unsurprisingly - didn’t work.</div>
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 14px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 14px;" class="">
Is there a way around this? Will I need to use lower level functions than ft_topoplotER? If so, can anyone advise on how I might implement this?</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 14px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 14px;" class="">
Many thanks for your time,</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 14px;" class="">
Benjy</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>