I am using brainstorm3 to analyze MEG data and trying to extract the time series of scouts. When I click on display scouts time series, for some scouts, it shows in matlab command window that “BST> Flipped the sign of 14 sources”, but for one scout, it shows “BST> Sign flipping cancelled because it decreases the signal amplitude (ratio=0.86678).”
I wonder how to determine which sources should be flipped, whether there’s sign flipping or not for a specific scout, and what I can do if I don’t want to apply sign flipping?
Within a large scout, you have a high chance to have sources oriented differently. An artifact of the minimum norm estimate is that two dipoles close to each other but with opposite directions (eg. the two sides of a sulcus) will show opposite current values.
This behavios is hidden by default, but you can get to see it by changing the source colormap (in the 3D figure showing the sources, right-click > Colormap > Uncheck the “absolute values” option). You would see positive values one side of the sulcus, and negative on the other side.
If you use the “mean” function for your scouts, you would average the positive and negative values at the same time, decreasing a lot the amplitude of your scouts signal. The function bst_scout_value.m, which calculates the scouts time series, tries to correct on the fly for this unwanted effect. If the parameter “isSignFlip” is set, it will try to identify what is the main orientation, and flip the sign of the current values coming from dipoles with opposite directions. Hence the number of flipped values depends on the number and normal of vertices in the scout.
It will keep this modification only if the amplitude of the final scout value of the scout are higher. This is why sometimes you would see those messages “sign flipping cancelled”.
If you don’t understand well what is happening here, just leave it the way it is.
If you are an expert and you really don’t want this heuristic correction to happen, you can add a line to force the isSignFlip flag to zero (line 48 for instance).
You can also place a breakpoint at the beginning of this function and follow the operations step by step to understand better what is happening in this function.