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.

A function get_ch_positions for DigMontage

See original GitHub issue

Describe the new feature or enhancement

If I have an existing montage and want to add fiducials, there is currently no way to do that without calling make_dig_montage again. But the montage itself does not provide a way to get the ch positions.

Currently the only way I can find that gets a montage is either you make it from scratch make_dig_montage or you get it from raw using raw.get_montage. But if you say already have an existing montage via raw.get_montage() it seems you would have to hack out the channel positions and then call make_dig_montage again? Since there is no public API for getting the channel positions, I wonder if there’s an easier way around this?

Describe your proposed implementation

Possibly a get_ch_positions() public function for DigMontage, that one can then do:

montage  = raw.get_montage()
ch_positions = montage.get_ch_positions()

Additional comments

TBD

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
larsonercommented, Oct 29, 2020

In that case we should just make it get_positions(), and doing mon_2 = make_dig_montage(**mon.get_positions()) should have all attributes of mon and mon_2 the same. If you want the channel positions you just use mon.get_positions()['ch_pos']

0reactions
larsonercommented, Oct 30, 2020

That code operates on an info object. There is no info as part of DigMontage

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.channels.DigMontage — MNE 1.2.2 documentation
Any coordinate frame can be transformed to head if the fiducials (i.e. LPA, RPA and Nasion) are defined. One can use this function...
Read more >
BUG:mne.create_info function mismatch channel names with ...
create_info with DigMontage can not match channel names in a case insensitive manner. Steps to reproduce. import mne montage = mne.channels.
Read more >
Channel positions are not present in DigMontage - MNE Forum
RuntimeWarning: DigMontage is only a subset of info. There are 4 channel positions not present in the DigMontage. The required channels are: ...
Read more >
mne.channels.DigMontage — MNE 0.15.dev0 documentation
mne.channels.DigMontage¶ ... Montage for digitized electrode and headshape position data. ... Montages are typically loaded from a file using ...
Read more >
Working with sensor locations - | notebook.community
DigMontage > contain sensor positions in 3D ( x , y , z , in meters), ... Raw object (see the documentation of...
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