Skip to content

check info against compensation chans (Continued) #5218

Closed

Description

@bloyl

Following #5133 exceptions are raised when meas_info objects are created with channels that don't allow for attached compensation matrices to be applied/interpreted.
A coupled PR will come once I have some time.

This is a running list of places where this causes a problem

  • ica.plot_overlay()
    specifically picks = [inst.ch_names.index(k) for k in ica.ch_names] of viz.plot_ica_overlay

Activity

  1. agramfort commented on May 19, 2018

    @agramfort
    SponsorMember
  2. bloyl commented on May 19, 2018

    @bloyl
    ContributorAuthor
    import os.path as op
    from mne import Epochs
    from mne.preprocessing import ICA
    from mne.io import read_raw_ctf
    from mne.datasets import testing
    from mne.event import make_fixed_length_events
    ctf_fname = op.join(testing.data_path(download=False), 'CTF',
                        'testdata_ctf.ds')
    
    method = 'fastica'
    raw = read_raw_ctf(ctf_fname, preload=True)
    events = make_fixed_length_events(raw, 99999)
    
    raw.apply_gradient_compensation(1)
    epochs = Epochs(raw, events, None, -0.2, 0.2, preload=True)
    
    ica = ICA(n_components=2, random_state=0, max_iter=2, method=method).fit(raw)
    
    #interestingly this doesn't throw an exception
    ica.plot_overlay(raw, show=True)
    
    #this does throw an exception
    ica.plot_overlay(epochs.average(), show=True)
    
  3. larsoner commented on May 22, 2018

    @larsoner
    Member

    Note that this affects examples/datasets/spm_faces_dataset.py

  4. agramfort commented on May 22, 2018

    @agramfort
    SponsorMember
  5. larsoner commented on May 22, 2018

    @larsoner
    Member

    I can do it but we need to think harder and converge on the right fix

  6. agramfort commented on May 22, 2018

    @agramfort
    SponsorMember
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