Extract Scout time series

Hi Maren,

This was a bug indeed… A very sneaky one, very difficult to detect and reproduce.
In the two versions, the same list of vertices was read and averaged, but the sign flip that is applied to compensate for the opposite orientations in large ROIs was not performed in the same way.

The combination of factors was the following (I’m describing in details them for future reference, you don’t necessarily need to understand all of it):

  1. In your Destrieux atlas, the vertices of the scout “S_temporal_sup” were not sorted by increasing order of indices the way they are supposed to be (was it imported more than a year ago? or are you using an old version of FreeSurfer?)
  2. In the recent version of function process_extract_scout (Nov 2014), the list of vertices was sorted again before extracting the scouts values, but not before getting the orientations of the dipoles from the cortex surface.
  3. In bst_scout_value, for constrained source models, the signs of the sources might be flipped according to their orientation. But in this case, it was not flipping the correct ones.
  4. I guess in most cases, the wrong flipping of a few vertices would not change much the results. But because your region is very large and with very heterogeneous orientations, the result ended up being quite different.

The correct result was the one obtained in the interactive way.
I fixed the process “Extract > Scout time series” so that it sorts again the vertex indices. I also fixed some other functions to prevent these unsorted lists of vertices to be saved in the atlases in the first place.
You can update Brainstorm again, it should be work now (I may have introduced new bugs).
Thank you very much for taking the time to help me fix this bug.

I have two more remarks about your database:
a) The average of the sources is supposed to be the same as the sources of the average. I’m not sure why yours are different and why you recalculate explicitly the average of the sources.
b) Most of the regions coming from the atlases are very large and have shapes that you would naturally design as a region of interest. If you average the signals over large regions, you can lose a lot of the signals of interest. You could also try comparing your results with what you would get with smaller scouts, either hand-drawn or resulting of a sub-parcellation of an existing anatomical atlas.

Cheers,
Francois