Skip to content

Reading coordinates (montage) from vhdr files #4471

Closed

Description

@jdue

I have encountered an issue trying to read coordinate information (i.e., montage) from brainvision vhdr files (from the 'coordinates' field). For example, something like this

raw = mne.io.read_raw_brainvision('filename.vhdr', montage=True, eog=['EOG1', 'EOG2'])

results in ImportError: cannot import name '_sphere_to_cartesian' as this function does not seem to exist in mne.transforms. Another function, _sph_to_cart, does exist, however. The expected argument structure of this function differ slightly though.

One way to solve this issue might be to modify line 438 of mne.io.brainvision from

from ...transforms import _sphere_to_cartesian

to

from ...transforms import _sph_to_cart

and, consequently, also changing line 446 from

pos = _sphere_to_cartesian(r=radius, theta=theta, phi=phi)

to

pos = _sph_to_cart(np.atleast_2d([radius, theta, phi])).squeeze()

to conform with the expected structure of arguments of _sph_to_cart. This seems to solve the issue for me at least but I don't know what your preferred solution is, e.g., if you would rather modify _sph_to_cart.

I am using MNE 0.14.1.

Activity

  1. agramfort commented on Aug 9, 2017

    @agramfort
    SponsorMember
  2. larsoner commented on Apr 16, 2019

    @larsoner
    Member

    Fixed by #4531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions