# Displaying filters from CSP trained externally to MNE

**URL:** <https://mne.discourse.group/t/displaying-filters-from-csp-trained-externally-to-mne/2890>\
**Category:** Support & Discussions\
**Tags:** eeg, visualization, spatial-filter\
**Created:** [March 26, 2021, 10:39am UTC](https://mne.discourse.group/t/displaying-filters-from-csp-trained-externally-to-mne/2890 "2021-03-26T10:39:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdussard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cdussard/32/312_2.png) [@cdussard](https://mne.discourse.group/u/cdussard)\
**Post date:** [March 26, 2021, 10:39am UTC](https://mne.discourse.group/t/displaying-filters-from-csp-trained-externally-to-mne/2890/1 "2021-03-26T10:39:57Z")

</div>

- MNE-Python version: latest version
- operating system: Windows 10

Hi,

I have trained CSP filters with calibration data using OpenVibe software and ended up with an XML file that contains the weights associated with each electrode.  
I would like to display the topographical maps of the CSP weights as shown in the MNE example:

 ![](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/6a370f05bd8959a2f21955efe0b41fa9aeb808d8.png)  
(OpenVibe doesn’t seem to support CSP filter display, so I was advised to try to do this using MNE instead)  
I think the CSP.plot\_filters and plot\_patterns function could do the trick.  
However, I am unsure whether it is possible to instantiate a CSP object by reading a file with externally obtained weights (instead of retraining from scratch with MNE) and how I would do this.

Would anyone have input on this?

Thank you very much 🙂

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [March 27, 2021, 8:06pm UTC](https://mne.discourse.group/t/displaying-filters-from-csp-trained-externally-to-mne/2890/2 "2021-03-27T20:06:10Z")

</div>

create a fake evoked object with EvokedArray and use the plot\_topomap method or  
otherwise you can use mne.viz.plot\_topomap that takes as input the values at electrodes  
and their locations

HTH  
Alex

---

<div class="post-metadata">

**Author:** ![cdussard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cdussard/32/312_2.png) [@cdussard](https://mne.discourse.group/u/cdussard)\
**Post date:** [March 29, 2021, 8:15am UTC](https://mne.discourse.group/t/displaying-filters-from-csp-trained-externally-to-mne/2890/3 "2021-03-29T08:15:36Z")

</div>

Thank you for the quick response, it worked ! 🙂
