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.

[BUG] `mne.label.find_pos_in_annot` doesn't check `coord_frame`

See original GitHub issue

It doesn’t seem like a good idea to allow any position to be passed to find_pos_in_annot without checking that it is in the mri coordinate frame. If someone has the wrong coordinate frame, the error will be silent and they will get the wrong ROI which to me seems like a pretty good risk for incorrect results that could be avoided by enforcing the coordinate frame or maybe rather making this a class function of Dipole.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
larsonercommented, Jul 16, 2021

I don’t think Dipole would be the right subclass, in general the point you’re talking about could be anything (iEEG sensor, part of a mesh, an elementary current dipole, etc.). I think we should do two things:

  1. Document clearly that if an ndarray or list-like is passed, these must be in the MRI coordinate frame
  2. Add support for other objects as we need them, such as DigPoint instances (?), where we can check the coordinate frame

FWIW Dipole always lives in the head coordinate frame, so if we wanted to add support for that in (2) then we’d have to have a trans argument in that function, if we don’t already.

But really I think we should do the doc update (1) first and then let actual use cases guide (2)

0reactions
larsonercommented, Jul 16, 2021

Dipole is always in head coords and I don’t think it’s a common use case anyway. Let’s just start from montage (and not worry about Dipole) since it’s the use case we actually want to support for iEEG?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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