<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div class="yahoo-style-wrap" style="font-family:times new roman, new york, times, serif;font-size:13px;"><div>Hello, </div><div>I'm Jed Meltzer, a researcher at the Rotman Research Institute of Baycrest Hospital in Toronto. A student in my lab is working on an MEG project involving connectivity between the left and right motor cortex during hand movement, and we are interested in quantifying causal influences between the two regions using methods such as Granger Causality and phase-slope index (PSI). When calculating PSI in field-trip, we are a bit confused about which direction is which, and are seeking clarification. Here is our cfg setup: </div><div><br></div><div><span><div><span style="white-space: pre-wrap;">                                     </span>data.label   = {'LM1' 'RM1' 'LV1' 'RV1'};</div><div><span style="white-space: pre-wrap;">                                    </span>data.trial   = tdata;<br></div><div><span style="white-space: pre-wrap;">                                      </span>data.time    = tdata_time;</div><div><span style="white-space: pre-wrap;">                                   </span>data.cfg     = cfg;</div><div><br></div><div><span style="white-space: pre-wrap;">                                    </span>%% time-frequency analysis</div><div><br></div><div><span style="white-space: pre-wrap;">                                    </span>% tf</div><div><span style="white-space: pre-wrap;">                                   </span>cfg = [];</div><div><span style="white-space: pre-wrap;">                                      </span>cfg.output = 'fourier';</div><div><span style="white-space: pre-wrap;">                                        </span>cfg.method = 'mtmconvol';</div><div><span style="white-space: pre-wrap;">                                      </span>cfg.keeptrials = 'yes';</div><div><span style="white-space: pre-wrap;">                                        </span>cfg.taper = 'hanning'; % </div><div><span style="white-space: pre-wrap;">                                 </span>cfg.toi = timesec;<br></div><div><span style="white-space: pre-wrap;">                                   </span>cfg.channel = 'all'</div><div><span style="white-space: pre-wrap;">    </span><span style="white-space: pre-wrap;">                              </span>cfg.foi = 1:0.5:80; </div><div><span style="white-space: pre-wrap;">      </span><span style="white-space: pre-wrap;">                              </span>cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;  </div><div><span style="white-space: pre-wrap;">                                      </span>cfg.pad = 10 % this is the parameter to output evenly spaced freq bins</div><div><br></div><div><span style="white-space: pre-wrap;">                                        </span>freq = ft_freqanalysis(cfg, data)</div><div><br></div><div><span style="white-space: pre-wrap;">                                     </span>freqdim = freq.freq;</div><div><span style="white-space: pre-wrap;">                                   </span>timedim = freq.time;</div><div> <span><div><span style="white-space: pre-wrap;">                                   </span></div><div>                                        % psi</div><div><span style="white-space: pre-wrap;">                                   </span>cfg = [];</div><div><span style="white-space: pre-wrap;">                                      </span>cfg.method = 'psi'; % </div><div><span style="white-space: pre-wrap;">                                    </span>cfg.bandwidth = 5; % </div><div><span style="white-space: pre-wrap;">                                     </span>stat = ft_connectivityanalysis(cfg, freq);</div><div><span style="white-space: pre-wrap;">                                     </span>RM1toLM1_psi = squeeze(stat.psispctrm(1,2,:,:));</div><div><span style="white-space: pre-wrap;">                                       </span>LM1toRM1_psi = squeeze(stat.psispctrm(2,1,:,:));</div><div><br></div><div><br></div><div>We are not sure about those last two lines of the code. We would like to have the causal influence of channel 1 to channel 2 be reflected as a positive number. We have read through the documentation and we find two parts of it to seem contradictory. First, there is this page: </div><div><br></div><div><span><a href="http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip/" rel="nofollow" target="_blank">http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip/</a></span><br></div><div><br></div><div>It states: </div><div>------</div><div><span><p style="margin-top: 0px; text-align: justify; color: rgb(33, 37, 41); font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px;">Note that this representation lacks a ‘labelcmb’ field, and that the ‘dimord’ is ‘chan_chan_freq’. This means that the numeric data now implicitly contains both the combinations {‘a’ ‘b’} (in coh.cohspctrm(1,2,:) ) , and the combination {‘b’ ‘a’} (in coh.cohspctrm(2,1,:) ). For a quantity like the coherence spectrum the values across the diagonal are symmetric, but for complex-valued quantities, as well as for directional measures of interaction, the values at the entries across the diagonal are typically different. The convention used by FieldTrip is that the row-channel ‘causes’ the column-channel.</p><div>--------</div><div>So, we interpret this to mean that if channel 1 is LM1, and channel 2 is RM1, then we would probably want: </div><div><span><span style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; white-space: pre-wrap;">     </span><span style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif;">LM1toRM1_psi = squeeze(stat.psispctrm(1,2,:,:));</span></span><br></div></span>because the first dimension is the "row" channel and the second dimension is the "column" channel. </div><div><br></div><div>However, in the help for the psi function: </div><div><span><a href="http://www.fieldtriptoolbox.org/reference/ft_connectivity_psi/" rel="nofollow" target="_blank">http://www.fieldtriptoolbox.org/reference/ft_connectivity_psi/</a></span><br></div><div>it says:</div><div>-----</div><div><span><pre class="ydp44283aechighlight" style="font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13.2px; margin-top: 0px; margin-bottom: 0px; color: rgb(33, 37, 41); background: rgb(240, 240, 240);"><code style="font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit;"><span class="ydp44283aecn">If</span> <span class="ydp44283aecn">the</span> <span class="ydp44283aecn">phase</span> <span class="ydp44283aecn">slope</span>
 <span class="ydp44283aecn">index</span> <span class="ydp44283aecnb" style="color: rgb(0, 112, 32);">is</span> <span class="ydp44283aecn">positive</span><span class="ydp44283aecp">,</span> <span class="ydp44283aecn">then</span> <span class="ydp44283aecn">the</span> <span class="ydp44283aecn">first</span> <span class="ydp44283aecn">chan</span> <span class="ydp44283aecp">(</span><span class="ydp44283aecmi" style="color: rgb(64, 160, 112);">1</span><span class="ydp44283aecn">st</span> <span class="ydp44283aecn">dim</span><span class="ydp44283aecp">)</span> <span class="ydp44283aecn">becomes</span> <span class="ydp44283aecnb" style="color: rgb(0, 112, 32);">more</span> <span class="ydp44283aecn">lagged</span> <span class="ydp44283aecp">(</span><span class="ydp44283aecnb" style="color: rgb(0, 112, 32);">or</span>
 <span class="ydp44283aecn">less</span> <span class="ydp44283aecn">leading</span><span class="ydp44283aecp">)</span> <span class="ydp44283aecn">with</span> <span class="ydp44283aecn">higher</span> <span class="ydp44283aecn">frequency</span><span class="ydp44283aecp">,</span> <span class="ydp44283aecn">indicating</span> <span class="ydp44283aecn">that</span> <span class="ydp44283aecn">it</span> <span class="ydp44283aecnb" style="color: rgb(0, 112, 32);">is</span> <span class="ydp44283aecn">causally</span>
 <span class="ydp44283aecn">driven</span> <span class="ydp44283aecn">by</span> <span class="ydp44283aecn">the</span> <span class="ydp44283aecnb" style="color: rgb(0, 112, 32);">second</span> <span class="ydp44283aecn">channel</span> <span class="ydp44283aecp">(</span><span class="ydp44283aecmi" style="color: rgb(64, 160, 112);">2</span><span class="ydp44283aecn">nd</span> <span class="ydp44283aecn">dim</span><span class="ydp44283aecp">)</span></code></pre></span>------</div></span>So following this logic, if we want a positive number to reflect a causal influence from LM1 (channel 1) to RM1 (channel 2), then we would instead want to write: </div><div><span><span style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; white-space: pre-wrap;">  </span><span style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif;">LM1toRM1_psi = squeeze(stat.psispctrm(2,1,:,:));</span></span><br></div><div><br></div><div>Can you help me figure out which one is correct? Our data have periods of both positive and negative PSI (quite interestingly) so it's impossible for us to "guess" which one is correct just from the pattern. </div><div><br></div><div>Thanks,</div><div>Jed</div></span></div></div></body></html>