Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to detect channels outside of brain with detect_bad_channels #2929

Open
a-zmz opened this issue May 29, 2024 · 7 comments
Open

unable to detect channels outside of brain with detect_bad_channels #2929

a-zmz opened this issue May 29, 2024 · 7 comments
Labels
preprocessing Related to preprocessing module question General question regarding SI

Comments

@a-zmz
Copy link

a-zmz commented May 29, 2024

Hi,

I tried to remove bad channels of my neuropixels 1.0 data, and the detect_bad_channels function could not detect any channels outside of brain no matter parameters...

key questions:

  • since i shifted 48 channels to bank 1, channel 0-47 are actually at the top. in this case, what should i do with outside_channels_location?
  • should i do this step on raw or highpass filtered data? with raw data, it can detect noise channels, but not on highpass filtered one. and yet by eye you can see those noisy channels that are outside of the brain:
    image

ps. running spikeinterface v0.101.0 on linux fedora 39

Thanks!

@zm711
Copy link
Collaborator

zm711 commented May 29, 2024

@a-zmz,

we are at a hackathon right now for spikeinterface. We will try to get to this soon! Ping us again Monday if we haven't responded before then, please!

@zm711 zm711 added preprocessing Related to preprocessing module question General question regarding SI labels May 29, 2024
@a-zmz
Copy link
Author

a-zmz commented Jun 10, 2024

hello again guys, any update on this?

@JoeZiminski
Copy link
Collaborator

JoeZiminski commented Jun 11, 2024

Thanks @a-zmz, this is interesting, Can I confirm, when you supply the raw data the bad channel detection works well, but if you bandpass filter the data, then it does not work?

This actually may not be so suprising, the data must be filtered for bad channel detection to work. If raw data is passed, it will be filtered internally in the function. Both this internal filtering (and the filtering applied in the IBL pipeline from which this is ported) are highpass filters. It may be that the bandpass filter is removing high frequencies that would indicate these are noisy channels in the ibl function. Out of interst, could you see if, when the detection is working, these channels are labelled as noisy (2) or out of brain (3)?

I think if it is working without bandpass filtering, I would detect bad channels on the 'raw' data (technically, on the highpass filtered data under the hood) and then do bandpass filtering. This is a point for #2996, in general it is probably not idea to perform detect bad channels after bandpass filtering? @oliche may be able to comment better.

@a-zmz
Copy link
Author

a-zmz commented Jun 11, 2024

hello @JoeZiminski, yea i realised the highpass filtering in the bad channel detection function. When passing raw to the function, i got those channels are labelled as noisy. And yea from now I would do the bad channel detection before bandpass filtering. Thanks very much!

re question about detecting out_of_brain channels if I have 48 channels shifted up:

  • how should i set outside_channels_location?
  • rather than top bottom or both, is it possible to use the actual depth position of channel for outside_channels_location?

@alejoe91
Copy link
Member

The depths of the channels are used already, so top and bottom refer to the physical locations, not the channel indices ;)

@a-zmz
Copy link
Author

a-zmz commented Jun 11, 2024

oh right i see, then i should just use top if channels outside are further away from the shank tip?
But like i tried different options with the location, none of the channels were detected as out_of_brain, is there something else i could try?

@alejoe91
Copy link
Member

yes top is correct. You can try to play around with the outside_channel_threshold parameter. @oliche any other suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preprocessing Related to preprocessing module question General question regarding SI
Projects
None yet
Development

No branches or pull requests

4 participants