<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Mikkel,</div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
thanks a lot for clarifying further and for your very detailed answer </div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I managed to plot topographies in Fieldtrip following your suggestions and modifying the SPM function "spm12/toolbox/MEEGtools/<b>spm_eeg_img2maps.m".
</b>I attach the modified function here, with an example script for plotting multiple topographies, in case it might be useful to others...</div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks again,</div>
<div class="elementToProof" style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div style="text-align: left; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Benedetta </div>
<div style="text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(34, 34, 34);">
<span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);">-----</span><br>
<span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);">Doctoral Candidate - FNRS ASP</span></div>
<div style="text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(34, 34, 34);">
<br>
</div>
<div style="text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(34, 34, 34);">
<span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);"><a href="https://www.coma.uliege.be/" target="_blank" rel="nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer" style="color: rgb(0, 0, 0);">Coma
Science Group</a> GIGA Consciousness</span><span style="font-family: arial, sans-serif;"><br>
</span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);"><a href="http://www.chuliege.be/cerveau" target="_blank" rel="nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer" style="color: rgb(0, 0, 0);">Centre
du Cerveau²</a> CHU de Liège</span></div>
<div style="text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(34, 34, 34);">
<span style="font-family: arial, sans-serif;"><br>
</span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);">University of Liège, Belgium </span><span style="font-family: arial, sans-serif;"><br>
</span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);">11 Avenue de l'Hôpital, B34+2</span><span style="font-family: arial, sans-serif;"><br>
</span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);">4000-Liège (Sart Tilman)</span><span style="font-family: arial, sans-serif;"><br>
</span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; color: rgb(0, 0, 0);">Belgium</span></div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mikkelcv@drcmr.dk <mikkelcv@drcmr.dk><br>
<b>Sent:</b> Friday, March 15, 2024 2:00 PM<br>
<b>To:</b> Cecconi Benedetta <Benedetta.Cecconi@uliege.be>; FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Subject:</b> SV: Using FieldTrip for Plotting SPM Statistical Maps</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
@font-face
{font-family:Aptos}
@font-face
{font-family:"Apple Color Emoji"}
@font-face
{font-family:"Lucida Sans Unicode"}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif}
a:link, span.x_MsoHyperlink
{color:blue;
text-decoration:underline}
p.x_xmsonormal, li.x_xmsonormal, div.x_xmsonormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif}
p.x_xelementtoproof, li.x_xelementtoproof, div.x_xelementtoproof
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif}
span.x_EmailStyle24
{font-family:"Aptos",sans-serif;
color:windowtext}
.x_MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:3.0cm 2.0cm 3.0cm 2.0cm}
div.x_WordSection1
{}
-->
</style>
<div lang="DA" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">Dear Benedetta</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">I see; if I understand correctly, SPM treats the data as a “volume”, with the first two dimensions being x and y coordinates and the 3<sup>rd</sup> dimension being time. To get this data into
FieldTrip, you will probably need to specify it as a volume data structure (<a href="https://www.fieldtriptoolbox.org/faq/how_is_anatomical_functional_or_statistical_volume_data_described/">https://www.fieldtriptoolbox.org/faq/how_is_anatomical_functional_or_statistical_volume_data_described/</a>).</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">Event though volumes in FieldTrip, in most instances, refer to MR data or source reconstructed EEG/MEG data, I think you can treat your t-maps as such for plotting. SPM kind of does this for
statistics as it converts the EEG topographies over time into a volume with time as one side of the “volume”.</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">For plotting purposes, you can then use the FieldTrip functions for source plots (<a href="https://www.fieldtriptoolbox.org/tutorial/plotting/#plotting-data-at-the-source-level">https://www.fieldtriptoolbox.org/tutorial/plotting/#plotting-data-at-the-source-level</a>).
With the cfg.method = ‘slice’ for ft_sourceplot, you could probably create some topoplot-looking figures.
</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">Probably something like this could work:</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"># Create your data</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">volume.tscore. = % your t-score</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">volume.dim = [32, 32, 201]. % x, y, time</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt">cfg = [];</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt">cfg.method = 'slice';</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt">cfg.funparameter = ’tscore’;</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt">ft_sourceplot(cfg, volume);</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">You might need to play around a little with the cfg.funparameter and/or cfg.maskparameter to get it to work properly.</span><span style="font-size:11.0pt"></span></p>
<p class="x_MsoNormal" style="text-indent:65.2pt"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">Best regards</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">Mikkel</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<div id="x_mail-editor-reference-message-container">
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">Fra:
</span></b><span style="color:black">Cecconi Benedetta <Benedetta.Cecconi@uliege.be><br>
<b>Dato: </b>fredag, 15. marts 2024 kl. 11.47<br>
<b>Til: </b>mikkelcv@drcmr.dk <mikkelcv@drcmr.dk>, FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Emne: </b>Re: Using FieldTrip for Plotting SPM Statistical Maps</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Dear</span><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black"> Mikkel,</span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black">thanks a lot for your answer
</span><span style="font-size:11.0pt; font-family:"Apple Color Emoji"; color:black">🙂</span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black">I'm not sure I can implement the solution you proposed as my T_maps/contrast maps (3D Sensor maps over time) are 32x32x201 double where 32x32 is
the n of pixels and 201 the n of samples (here's a col of a contrast map):</span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black"><img border="0" width="435" height="342" id="x_image_0" style="width:4.5312in; height:3.5625in" data-outlook-trace="F:1|T:1" src="cid:6c6b3150-aa61-4789-8ec2-22d006dba4c1"></span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black">If I create a matrix Ch x time points, I do not know which values correspond to which channel (e.g., which channel a certain t-value belongs to)...</span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black">I am probably missing something of what you explained, is there any chance you could clarify further?</span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Lucida Sans Unicode",sans-serif; color:black">Thanks a lot in advance,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black"> </span></p>
</div>
<div id="x_Signature">
<p class="x_MsoNormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Benedetta </span><span style="font-family:"Arial",sans-serif; color:#222222"></span></p>
<p class="x_MsoNormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">-----</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Doctoral Candidate - FNRS ASP</span><span style="font-family:"Arial",sans-serif; color:#222222"></span></p>
<p class="x_MsoNormal"><span style="font-family:"Arial",sans-serif; color:#222222"> </span></p>
<p class="x_MsoNormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black"><a href="https://www.coma.uliege.be/" target="_blank"><span style="color:black">Coma Science Group</span></a> GIGA Consciousness</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black"><a href="http://www.chuliege.be/cerveau" target="_blank"><span style="color:black">Centre du Cerveau²</span></a> CHU de Liège</span><span style="font-family:"Arial",sans-serif; color:#222222"></span></p>
<p class="x_MsoNormal"><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">University of Liège, Belgium </span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">11 Avenue de l'Hôpital, B34+2</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">4000-Liège (Sart Tilman)</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Belgium</span><span style="font-family:"Arial",sans-serif; color:#222222"></span></p>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="0" width="100%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black"> mikkelcv@drcmr.dk <mikkelcv@drcmr.dk><br>
<b>Sent:</b> Friday, March 15, 2024 10:46 AM<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Cc:</b> Cecconi Benedetta <Benedetta.Cecconi@uliege.be><br>
<b>Subject:</b> SV: Using FieldTrip for Plotting SPM Statistical Maps</span> </p>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<div>
<div>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt">Dear Benedetta</span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt">Depending on what level you have your t-maps (sensor level, source level, or something else), you can manually create the FieldTrip data structure. All you need is to arrange your t-map as
NxM matrix, a vector with the N channel names, and a vector with the M dimension, usually time or frequency. Finally, you specify the “dimord” according to one of the datatypes, e.g., “chan_time” if the data is channelled by time points. The details on what
you need and what the data fields should be named are explained here: <a href="https://www.fieldtriptoolbox.org/development/datastructure/">
https://www.fieldtriptoolbox.org/development/datastructure/</a></span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt">For example, if you have a single t-value per channel location in a standard EEG cap, you would export the N channels x 1 “t-map” and the channel names. Once you have arranged it according
to the FieldTrip naming conventions, you can use ft_checkdata to see if the structure is “valid” in FieldTrips view or if something is still missing.</span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt">Best regards</span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt">Mikkel</span></p>
<p class="x_xmsonormal"><span lang="EN-GB" style="font-size:11.0pt"> </span></p>
<div id="x_x_mail-editor-reference-message-container">
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_xmsonormal" style="margin-bottom:12.0pt"><b><span style="color:black">Fra:
</span></b><span style="color:black">fieldtrip <fieldtrip-bounces@science.ru.nl> på vegne af Cecconi Benedetta via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Dato: </b>torsdag, 14. marts 2024 kl. 19.06<br>
<b>Til: </b>fieldtrip@science.ru.nl <fieldtrip@science.ru.nl><br>
<b>Cc: </b>Cecconi Benedetta <Benedetta.Cecconi@uliege.be><br>
<b>Emne: </b>[FieldTrip] Using FieldTrip for Plotting SPM Statistical Maps</span></p>
</div>
<p class="x_xelementtoproof"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Hello everyone
</span><span style="font-family:"Apple Color Emoji"; color:black">🙂</span></p>
<p class="x_xelementtoproof"> </p>
<p class="x_xelementtoproof"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">I have contrast and t-maps generated in SPM-EEG, and I've been finding it challenging to plot these in SPM while allowing for some customization (even basic
ones like adjusting the scale or plotting multiple time points).</span></p>
<p class="x_xelementtoproof"> </p>
<p class="x_xelementtoproof"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Since there does not seem to be a simple solution to achieve this, I was considering using FieldTrip for plotting these statistical maps. I found the function
spm2fieldtrip, but it only seems to handle the conversion of raw data. I was wondering if any of you have experience or insights on using FieldTrip for plotting SPM statistical maps directly, without the need to redo the entire analysis on FieldTrip. </span></p>
<p class="x_xelementtoproof"> </p>
<p class="x_xelementtoproof"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Any tips or guidance would be greatly appreciated..</span></p>
<p class="x_xelementtoproof"> </p>
<p class="x_xelementtoproof"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Thanks in advance for your help!
</span><span style="font-family:"Apple Color Emoji"; color:black">🙂</span></p>
<p class="x_xelementtoproof"> </p>
<p><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Best, </span>
</p>
<div>
<p class="x_xmsonormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black"> </span></p>
</div>
<p class="x_xmsonormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Benedetta </span></p>
<p class="x_xmsonormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">-----</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Doctoral Candidate - FNRS ASP</span></p>
<p class="x_xmsonormal"><span style="font-family:"Arial",sans-serif; color:#222222"> </span></p>
<p class="x_xmsonormal"><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black"><a href="https://www.coma.uliege.be/" target="_blank"><span style="color:black">Coma Science Group</span></a> GIGA Consciousness</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black"><a href="http://www.chuliege.be/cerveau" target="_blank"><span style="color:black">Centre du Cerveau²</span></a> CHU de Liège</span></p>
<p class="x_xmsonormal"><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">University of Liège, Belgium </span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">11 Avenue de l'Hôpital, B34+2</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">4000-Liège (Sart Tilman)</span><span style="font-family:"Arial",sans-serif; color:#222222"><br>
</span><span style="font-family:"Lucida Sans Unicode",sans-serif; color:black">Belgium</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>