GWeindel / hmp

Repository for the hmp python package
BSD 3-Clause "New" or "Revised" License
35 stars 8 forks source link

New feature: hmp.visu.plot_components_sensor() #59

Closed GWeindel closed 1 year ago

GWeindel commented 1 year ago

Introducing a new feature that allows plotting the channel contribution to each retained PC.

This is made possible by storing the PCA decomposition matrix as an attribute to the result from hmp.utils.transformed_data

hmp_data.attrs['components'] The new function then uses mne's mne.viz.plot_topomap to plot the channel contribution using the stored attribute and the info or position object as used for hmp.visu.plot_topo_timecours()

image

GWeindel commented 1 year ago

Storing in hmp_data.attrs['components'] doesn't yield a nice output. Perhaps move hmp_data to Dataset or just store a np.array