mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.7k stars 1.31k forks source link

possibly generalize corrmaps #2595

Closed teonbrooks closed 7 years ago

teonbrooks commented 8 years ago

Hey @jona-sassenhagen , thanks for implementing Corrmap. I'm about to use it and i'm pretty excited about it. I am wondering if this could be extended to take a list of principal components, same principle of template matching a spatial distribution but instead of ICs, the spatial maps are from PCA. I haven't looked at the code yet but are you correlating the weights of the corresponding row in the mixing matrix? I am working on a way of comparing principal components across subjects in a meaningful way.

jona-sassenhagen commented 8 years ago

Indeed, CORRMAP correlates mixing matrices across the supplied objects. So if correlations across channel weights is what you're after, CORRMAP can help. It should work with all spatial filter things - PCA, ICA, CSP. (Importantly, CORRMAP tries to find the most representative map(s) across subjects by first finding a best-matching template across subjects, and then correlating individual subject's maps with that one.)

For now, it should be possible to set an ICA object copy's relevant attributes to that of the PCA you're interested in.

In principle, and if we really want to emphasize across-subject stuff in the next release, maybe constructing a general spatial_filter class could be considered.

jona-sassenhagen commented 8 years ago

Hm ... ICA (in MNE, and generally) usually includes a PCA stage, so a very simple way to get a "PCA object" would be making an ICA object with an identity matrix for .unmixing_matrix, right?

dengemann commented 8 years ago

would be making an ICA object with an identity matrix for .unmixing_matrix, right?

in theory yes. but it would of course be a hack. the clean way would be to implement an abstract base class for linear unsupervised learning models (all models that do decomposition using a wieght matrix) and then subclass it for ICA and make a new one for .... Teon what is it actually, are you talking about SSP?

jona-sassenhagen commented 8 years ago

Oh, and of course it would be wholly pointless for the present purpose, as CORRMAP only checks the ICA weights.

teonbrooks commented 8 years ago

@dengemann I just want to be able to compare SSPs across subjects.

agramfort commented 7 years ago

maybe YAGNI :)