-
Notifications
You must be signed in to change notification settings - Fork 0
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
LFP subsampling #2
Conversation
code/run_capsule.py
Outdated
channel_ids_to_keep = channel_ids[0:len(channel_ids):SPATIAL_CHANNEL_SUBSAMPLING_FACTOR] | ||
channel_ids_to_remove = [channel_id for channel_id in channel_ids if channel_id not in channel_ids_to_keep] | ||
recording_lfp_spatial_subsampled = recording_lfp.remove_channels(channel_ids_to_remove) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use recording_lfp_spatial_subsampled = recording_lfp.channel_slice(channel_ids_to_keep)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @arjunsridhar12345
I added a few comments and suggestions
@arjunsridhar12345 do you mind if I push directly to your PR? |
Yeah sure |
code/run_capsule.py
Outdated
recording_lfp = spre.common_reference( | ||
recording_lfp, | ||
reference="single", | ||
groups=groups, | ||
ref_channel_ids=reference_channel_ids, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arjunsridhar12345 not sure this is correct. If I understand correctly, you want to subtract the median of the channnels in agar (from surface_channel_index to the last channel) to the remaining channels, correct?
The current solution will subtract to each channel group (so each channel in your case), the corresponding reference_channel_id
, so all channels out of the brain will be zeroed out, with no effect on the other channels. Is this the wanted behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, want to subtract the median of channels from surface index to last to the remaining channels. Then, should the reference be "global" with only ref_channel_ids set? Or what parameters should be passed to get the desired effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm I don't think we have that option yet, but we could cook in a workaround if needed.
See this issue: SpikeInterface/spikeinterface#2985
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok cool. that seems close, basically just need to subtract the remaining traces from the median of those channels. is there any sort of set traces type functionality or another way you know of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really...I'll think about a smart way to do it! We will probbaly need some custom recording functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arjunsridhar12345 fixed in this PR: SpikeInterface/spikeinterface#3139 (and SpikeInterface/spikeinterface#3140)
Until we release, I added a custom installation in the postinstall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok great, thanks!
LFP Subsampling ported from allensdk. Peforms spatial and temporal subsampling: