Plot topomap with customize ICA components

I am trying to reimplement ICASSO in python with MNE.
I have select some ICA components from different ICA runs and group them as a ndarray.
I’d like visualize the selected components without needing to refer to the original mne.preprocessing.ica.
Can anyone show me where should I look?
I’m trying to use plot_topomap but not sure what is its input.

If you want topomap, that’s the correct function. Provide data as an array of shape (n_sensors, ) (one value per sensor location on the topomap) and pos as an instance that contains the location/montage for all sensors.

You can create the info with mne.create_info and then add the montage with info.set_montage().

Thank you. It seems I have been misunderstood the input data. I thought it was ICA components.

It can be anything you want as long as you define the sensor location and value.
The location is given in the montage of the Info instance, and the value is given in data.

For instance, I use it to plot a topographic map of sensors’ weights between 0 and 1.

1 Like

Many thanks, I can plot the ICA components topomap now.