question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

plotting power topomaps: ValueError: trans must be a Transform between head<->meg, got None

See original GitHub issue

(MNE 0.20.dev0)

I get an error when trying to plot power topomaps for tfrs computed with mne.time_frequency.tfr_morlet:

 File "/home/sh254795/anaconda3/lib/python3.7/site-packages/mne/transforms.py", line 428, in _ensure_trans
    raise ValueError('%s None' % err_str)

ValueError: trans must be a Transform between head<->meg, got None

I traced it down to transforms.py, line 427 (in def _ensure_trans), where apparently my existing trans is not recognised as such:

not isinstance(this_trans, Transform)
True

this_trans
{'from': 1, 'to': 4, 'trans': array([[ 0.99812019, -0.06127739, -0.00142468,  0.00122047],
       [ 0.06122039,  0.99779153, -0.02579   ,  0.01071874],
       [ 0.00300188,  0.02565429,  0.99966681,  0.03850674],
       [ 0.        ,  0.        ,  0.        ,  1.        ]])}

Why is the trans not recognized? I can share the file if you need.

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
larsonercommented, Feb 11, 2020

Okay you’ll have to dig in a bit. Maybe do:

orig = info['dev_head_t']
info['dev_head_t'] = Transform(orig['from'], orig['to'], orig['trans'])

This might not work either, though, and require further work. I was mostly just trying to give you hints to get you enough to get started – but if you don’t want to debug this let me know and I can work on a PR directly

0reactions
SophieHerbstcommented, Feb 11, 2020

Thank you, that works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.viz.plot_topomap — MNE 1.2.2 documentation
If a list , labels should correspond to the order of channels in data . If None (default), no channel names are plotted....
Read more >
Why are there no power lines, pipelines, libraries, trails, etc ...
Powerlines, oil and gas pipelines, other energy infrastructure -- Except for a few unusual instances, such as the Trans-Alaska Pipeline, these features are...
Read more >
Topographic Maps: The basics
A topographic map is a detailed and accurate illustration of man-made and natural features on the ground such as roads, railways, power transmission...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found