# Error when trying to plot projectors (SSP)

**URL:** <https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456>\
**Category:** Support & Discussions\
**Tags:** visualization, ssp\
**Created:** [March 8, 2024, 7:04pm UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456 "2024-03-08T19:04:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dugguvan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dugguvan/32/3489_2.png) [@dugguvan](https://mne.discourse.group/u/dugguvan)\
**Post date:** [March 8, 2024, 7:04pm UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/1 "2024-03-08T19:04:29Z")

</div>

- MNE version: 1.6.1
- OS: Windows 11 Pro

Hello!  
I have a problem trying to display the projectors (I’m working with OPM data in fif format).  
I have tried everything, including just uploading a file, calculating the projectors and adding them and then I run:

**mne.viz.plot\_projs\_topomap(projs, colorbar=True, vlim=“joint” , info=raw.info)**

I get:

**File :12 in pick\_channels**

\*\* File ~\anaconda3\Lib\site-packages\mne\_fiff\pick.py:293 in pick\_channels\*\*  
\*\* raise RuntimeError(“ch\_names is not a unique list, picking is unsafe”)\*\*

**RuntimeError: ch\_names is not a unique list, picking is unsafe**

I have checked the structures and everything is ok, maybe (it seems to be) a problem with pick\_channels.

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [March 9, 2024, 8:03am UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/2 "2024-03-09T08:03:46Z")

</div>

Could you save the projector and the `raw.info` and share them here to replicate?

Mathieu

---

<div class="post-metadata">

**Author:** ![dugguvan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dugguvan/32/3489_2.png) [@dugguvan](https://mne.discourse.group/u/dugguvan)\
**Post date:** [March 9, 2024, 11:24am UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/3 "2024-03-09T11:24:37Z")

</div>

Sure! but I am wondering what is the best way to share it, because the structure (specially of projectors) has too many branches to just paste it here. Because It is not possible to upload files, is it?

Thanks,

Rodrigo

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [March 9, 2024, 12:51pm UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/4 "2024-03-09T12:51:50Z")

</div>

You can’t upload files directly here, but if you save only the projectors and the info with:

- [mne.write\_proj — MNE 1.6.1 documentation](https://mne.tools/stable/generated/mne.write_proj.html#mne-write-proj)
- [mne.io.write\_info — MNE 1.6.1 documentation](https://mne.tools/stable/generated/mne.io.write_info.html#)

The 2 files will be very small and you can share them either directly on the forum through an external provider; or in a GitHub issue here: [Issues · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues)

Mathieu

---

<div class="post-metadata">

**Author:** ![dugguvan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dugguvan/32/3489_2.png) [@dugguvan](https://mne.discourse.group/u/dugguvan)\
**Post date:** [March 9, 2024, 3:30pm UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/5 "2024-03-09T15:30:22Z")

</div>

Super, here are the files under the names test-info.fif and test-proj.fif

[Proj and info](https://drive.google.com/drive/folders/1vGygQVKmPEaT80VG5XmoYXbF2FEe5o4I?usp=sharing)

Rodrigo

---

<div class="post-metadata">

**Author:** ![dugguvan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dugguvan/32/3489_2.png) [@dugguvan](https://mne.discourse.group/u/dugguvan)\
**Post date:** [March 11, 2024, 10:16am UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/6 "2024-03-11T10:16:46Z")

</div>

More info:

First I thought that the error was related to the (additional) input channel stored in info.raw, but by dropping it before the projectors computing I got the same error message.

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [March 11, 2024, 10:27am UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/7 "2024-03-11T10:27:30Z")

</div>

The issue is that this function [mne-python/mne/utils/misc.py at a622a467074ea9ba0f1d1168c4ec3b8c6af74323 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/blob/a622a467074ea9ba0f1d1168c4ec3b8c6af74323/mne/utils/misc.py#L269-L296)

Turns your list of unique channel names into a list of channel names with duplicate, which then yields the error you get: `ch_names is not a unique list`. In particular, the 2 channels `L108_bz-s77` and `L108_bz-s110` both end up as `L108_bz`.

I am not familiar with the naming schema of your channels, but since you mention working with OPM data, this is not a VectorView or CTF system and should be treated as a bug. I opened: [Fix by mscheltienne · Pull Request #12489 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/pull/12489) to track and fix it.  
In the meantime, you can try renaming your channels with `raw.rename_channels`.

Mathieu

---

<div class="post-metadata">

**Author:** ![dugguvan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dugguvan/32/3489_2.png) [@dugguvan](https://mne.discourse.group/u/dugguvan)\
**Post date:** [March 17, 2024, 12:13pm UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/8 "2024-03-17T12:13:14Z")

</div>

Thanks! I realized of the same issue. Now everything is working ok forcing the name changes.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 24, 2024, 12:13pm UTC](https://mne.discourse.group/t/error-when-trying-to-plot-projectors-ssp/8456/9 "2024-03-24T12:13:24Z")

</div>

Closed on March 24, 2024, 12:13pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
