Skip to content

ValueError: Points have to be provided as one dimensional arrays of length 3. #7452

Closed

Description

@andraderenew

I am trying to analyze this tutorial dataset with MNE-Python and I cannot get through the analysis because of the error below.

I run:

import mne
import matplotlib.pyplot as plt
import numpy as np
raw=mne.io.read_raw_bdf('/home/andraderenew/Downloads/EEG/faces_run1.bdf')
raw.load_data()
raw.set_eeg_reference()
 montage = mne.channels.read_custom_montage('/home/andraderenew/Downloads/EEG/electrode_locations_and_headshape.sfp')


>>> raw.set_montage(montage)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "</home/andraderenew/.local/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-30>", line 2, in set_montage
  File "/home/andraderenew/.local/lib/python3.7/site-packages/mne/utils/_logging.py", line 90, in wrapper
    return function(*args, **kwargs)
  File "/home/andraderenew/.local/lib/python3.7/site-packages/mne/channels/channels.py", line 488, in set_montage
    set_dig=set_dig, raise_if_subset=raise_if_subset)
  File "/home/andraderenew/.local/lib/python3.7/site-packages/mne/channels/montage.py", line 1545, in _set_montage
    _mnt = _get_montage_in_head(montage)
  File "/home/andraderenew/.local/lib/python3.7/site-packages/mne/channels/montage.py", line 1356, in _get_montage_in_head
    return transform_to_head(montage.copy())
  File "/home/andraderenew/.local/lib/python3.7/site-packages/mne/channels/montage.py", line 935, in transform_to_head
    native_head_t = get_ras_to_neuromag_trans(nasion, lpa, rpa)
  File "/home/andraderenew/.local/lib/python3.7/site-packages/mne/transforms.py", line 650, in get_ras_to_neuromag_trans
    raise ValueError("Points have to be provided as one dimensional "
ValueError: Points have to be provided as one dimensional arrays of length 3.

Activity

  1. agramfort commented on Mar 15, 2020

    @agramfort
    SponsorMember
  2. andraderenew commented on Mar 15, 2020

    @andraderenew
    Author

    electrode_locations_and_headshape.sfp.zip
    I had to compress because github won´t allow for .sfp format

  3. agramfort commented on Mar 15, 2020

    @agramfort
    SponsorMember
  4. added this to the 0.20 milestone on Mar 19, 2020
  5. hoechenberger commented on Mar 19, 2020

    @hoechenberger
    Member

    I think this could easily be fixed and make it into 0.20

  6. larsoner commented on Mar 19, 2020

    @larsoner
    Member

    Are you on it @hoechenberger or do you need help?

  7. hoechenberger commented on Mar 19, 2020

    @hoechenberger
    Member

    I have not yet started working on this, could do tomorrow if that's okay with @agramfort?

  8. agramfort commented on Mar 19, 2020

    @agramfort
    SponsorMember
  9. andraderenew commented on Mar 19, 2020

    @andraderenew
    Author

    I am sorry no to be able to work on this because I have no time these days

  10. larsoner commented on Mar 25, 2020

    @larsoner
    Member

    Moving the milestone to 0.21

  11. modified the milestones: 0.20, 0.21 on Mar 25, 2020
  12. larsoner commented on Aug 31, 2020

    @larsoner
    Member

    This no longer crashes on master but it does have the problem that headshape only gets a single value

  13. larsoner commented on Aug 31, 2020

    @larsoner
    Member

    @andraderenew is headshape as a name a standard SFP file thing, or something specific to your lab?

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions