Giter VIP home page Giter VIP logo

Comments (7)

dengemann avatar dengemann commented on July 24, 2024

Hi,

no, it's not a bug. The code actually works for different channel types.
The keys are meant to map different rejection criteria to channels (in one
epoch), and unless full_report is not set to False a list returned (this
for one particular epoch).

I hope I understood you correctly,

Denis

from mne-python.

larsoner avatar larsoner commented on July 24, 2024

Hey @t3on ,

If you look at epochs.py, you'll see that the _get_data_from_disk function calls _is_good_epoch, which in turn calls _is_good with full_report=True (as referenced by @dengemann). This should give all the offending channels. Is it not doing that in some situation? It's possible we missed one instance (or some instances), but I think _get_data_from_disk is the only place epochs.drop_log gets set...

from mne-python.

larsoner avatar larsoner commented on July 24, 2024

Oh, and I should mention that the _get_data_from_disk method is used by user-level method drop_bad_epochs() and whenever preloading epochs data, so either of these should populate drop_log in a meaningful way.

from mne-python.

teonbrooks avatar teonbrooks commented on July 24, 2024

Hey guys,

Thanks for your suggestions. I have taken a look at those methods and I have a question. From what I understand in this code is that you find the channel with the maximum value at a sample and subtract from it the channel with the minimum value at the same given sample for all the samples in your epoch.
e.g. deltas = np.max(e_idx, axis=1) - np.min(e_idx, axis=1)

From there, it looks like only one maximum channel is returned from these other other contenders.
e.g. idx_max_delta = np.argmax(deltas)

Then delta becomes a single value that is then tested against the threshold
e.g. delta = deltas[idx_max_delta]
e.g. if delta > thresh:

If idx_max_delta maximally has only one value, then its value would be the only one return for the channel rejection, even if there were other channels that exceeded threshold.

Is this the proper logic of this segment of code. If so, is that the overall intention because what I would think to do would be to see if any deltas > thresh and return those indices because those would be all the channels rejected by the threshold?

Thanks for reading.

from mne-python.

agramfort avatar agramfort commented on July 24, 2024

hi,

you're right. The current code can only log one bad channel per channel type.

would you consider sending us a pull-request?

from mne-python.

larsoner avatar larsoner commented on July 24, 2024

@t3on, I can also take a stab fixing it if you don't want to -- just let us know

from mne-python.

teonbrooks avatar teonbrooks commented on July 24, 2024

Hey @Eric89GXL ,

Thanks for the offer but I think I will try to do it. Just getting out of class.

Best

from mne-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.