What is PCA extraction from source data?

Hello,

I created a headmodel and am extracting the source data. One of the options for extraction is PCA. I understand what PCA is in terms of EEG data, But not in source space. After extracting my source data using PCA, does this mean that only a certain number of vectors will be extracted? Or does it mean something else?

best wishes

If you are referring to the PCA option for computing scouts time series (ie. summarize the signals from multiple dipoles into one signal only), it computes the principal mode across all the signals in input:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scouts#Scout_function

If you are referring to the PCA option of the process "Sources > Unconstrained to flat map", it groups at each spatial location the three times series (x,y,z) of unconstrained minimum norm source estimation into one signal:
brainstorm3/toolbox/process/functions/process_source_flat.m at master · brainstorm-tools/brainstorm3 · GitHub
image

Both are computed with function bst_scout_value.m / PcaFirstMode():

Hi Francois,

Thanks very much.We are using constrained.

Is PCA only applied when i am extracting multiple scouts? Could PCA be used on one scout?

This code only takes the 1st mode? I havent really used PCA for much of anything, what is the benefit of using PCA vs taking the mean of the scout?

For example, in our study, we apply a type of stimulation to the hand area and have 3 conditions, baseline, during stim and post baseline stim. We are using the dummy headmodel in brainstorm and we are looking at activity in the motor and somatosensory area.
Since we are looking at broader regions not specific to hand regions, but all of the somatosensory and motor area, we were hoping that applying a PCA to the data might reduce the dimensions of our data to focus theoretically on the hand regions since the signal coming from this area should be the most prominent.

Would the type of PCA in brainstorm allow us to extract more meaningful data, rather then taking the mean of all the voxels for the regions of interest?

Thanks very much for the info!

Is PCA only applied when i am extracting multiple scouts? Could PCA be used on one scout?

The number of scouts you consider is unrelated.
If you select the scout function "PCA", it extracts the first mode of all the signals included in the scout for each scout independently.

This code only takes the 1st mode?

Yes. See the corresponding code in bst_scout_value.
If you want to explore more what this is doing, put a breakpoint at line 269 and then display the scout time series with PCA. When the debugger stops, execute the code line by line.

I havent really used PCA for much of anything, what is the benefit of using PCA vs taking the mean of the scout?

For a scout: I'm not sure, I haven't been using this option much.
@Sylvain?

For converting unconstrained (3 values per location) to flat maps (1 value per location), it has many advantages over the norm (sqrt(x^2+y^2+z^2)), as it preserves the signals dynamics (oscillations around zero).

Would the type of PCA in brainstorm allow us to extract more meaningful data, rather then taking the mean of all the voxels for the regions of interest?

It is difficult to answer. If you have a broad ROI where only a few dipoles are active and the rest is noise, then the mean would give you a really low value while the PCA might return something close to the signal in the activated areas. But if there are many things going on simultaneously in your ROI, the PCA might return something else than what you want, while the mean would give you something more flat and less misleading.
I feel like taking the first mode of the PCA over a large region can have unpredictable effects, but maybe @Sylvain has a different opinion.

If you think that the 1st mode of the PCA is a solution to consider:
I'd recommend you start by experimentally compare the two (PCA and mean) on some well established effects that you can identify clearly in your recordings, to get an intuition of the results you might obtain with both approaches.

Linking this topic to the corresponding PR:
https://github.com/brainstorm-tools/brainstorm3/pull/559