<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 Bushra,
<div class=""><br class="">
</div>
<div class="">I would assume - since you were not specific about this in your e-mails - that you used a cfg.(method).fixedori = ‘yes’ constraint, resulting in a scalar spatial filter (i.e. 1 coefficient per channel, rather than 3 coefficients per channel).
The sign flip that you observed is the consequence of the matlab-version specific numeric behavior of the underlying singular value decomposition (svd) that is used to rotate the local dipole’s coordinate system, in order for their axes to point along the
orientations of most variance explained. In an svd (or eigenvalue decomposition) the orientation of the singular vectors (or eigenvectors) is ambiguous with respect to their sign, and there is not much that can be done about it. As such, none of the outputs
is ‘less correct’ than the other one. </div>
<div class="">Depending on what you want to do in your downstream analysis, the polarity issue is something to keep in mind (and account for). Note that this not only counts for a comparison of the same dipole’s reconstructed activity on two subsequent computations
(with 2 different matlab versions, or on two different operating systems etc) but also when you compare the dipole’s activity with its neighbour. Usually, people look at the absolute (or squared) values of the dipoles’ activity (i.e. taking abs(filter * data)
), so in that case the polarity of the signal does not matter.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 3 Sep 2021, at 13:51, Bushra Riaz Syeda via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Hello,</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Just to update, I have checked more subjects and I found that the sign flip is in a lot of subjects ( but my labels were only affected in 3 subjects). </div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Wouldnt this make results unreliable? as reproducibility of results is affected.</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Kind regards</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Bushra Riaz</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
<hr tabindex="-1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 965.296875px;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span>
<div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>> on behalf of Bushra
Riaz Syeda via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>01 September 2021 13:25<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>><br class="">
<b class="">Cc:</b><span class="Apple-converted-space"> </span>Bushra Riaz Syeda <<a href="mailto:bushra.riaz@gu.se" class="">bushra.riaz@gu.se</a>><br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>[FieldTrip] Sign flip in lcmv spatial filter with different versions of MATLAB</font>
<div class=""> </div>
</div>
<div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Hello, </span></div>
<p class="x_MsoNormal" style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">
<span lang="EN-US" class=""> </span></p>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">I am having a strange error. I calculated lcmv beamformer for my<span class="Apple-converted-space"> </span><span class=""> </span>Neuromag dataset couple of years ago. I ran some beamformer based analysis and now I thought I will
redo some part of the analysis. </span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">I noticed during the rerun of my scripts that the spatial filter calculated for 3 subjects ( out of 20) has a sign flip for 3-5 % of the vertices. After investigating for a week, I found that I get sign flip for these vertices when
I run the same script with MATLAB 2013b and MATLAB 2017a ( fieldtrip version was same for both runs). </span></div>
<p class="x_MsoNormal" style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">
<span lang="EN-US" class=""> </span></p>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">I have attached the figure for one of the vertex of spatial filter with both MATLAB versions. </span></div>
<p class="x_MsoNormal" style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">
<span lang="EN-US" class=""> </span></p>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Now my question is, as this sign flip is affecting my further analysis, I would like to know , how to figure out which one is correct and if anyone has any idea where the error could be coming from. </span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Thank you </span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Any help would be highly appreciated. </span></div>
<p class="x_MsoNormal" style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">
<span lang="EN-US" class=""> </span></p>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Kind regards </span></div>
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Bushra Riaz </span></div>
<br class="">
</div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!opPvVMAA85HcdDVfVezgEXp69oQL4SkYmYgdgvy0mdyHTTDecifPewqlEgudYoubyWgQCKPZ6n_MBJM$" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!opPvVMAA85HcdDVfVezgEXp69oQL4SkYmYgdgvy0mdyHTTDecifPewqlEgudYoubyWgQCKPZ6n_MBJM$</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>