The best way to preprocess before and after splitting

未关闭
#4,900 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
8/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃
技术栈
python
领域
data

调研方向

This is an open API design question, not a ready task: the payload names apply_preprocessing_pipeline, split_by and the common_reference step, and asks whether to document option 1 or add split_by as a pipeline step (option 2). Read the existing preprocessing pipeline code first to see how it chains recordings and dicts. A newcomer should not start a patch until a maintainer chooses an option in the thread.

由索引模型根据 Issue 内容生成。

描述

discussion

Consider the following problem.

I have a 4-shank Neuropixels probe. There is a large piece of noise that I want to remove by doing a common median reference. I believe (for whatever reasons) that it will be better to subtract the median value taken from ALL channels/shanks. After this, I want to split the recording per shank up, and apply other preprocessing steps. You might even want to do another common median reference per shank after the global one.

Question: what's the best way to proceed. And should SpikeInterface support some syntactic sugar to allow you to do this with pipelines etc?

Some possible answers, with examples, give that you have a recording which cab en split by group.

  1. Do two preprocessing pipelines
    [{'name': 'bandpass_filter', 'kwargs': {'freq_max': 3000}}, {'name': 'common_reference', 'kwargs': {}}]
preprocessing_before_split = [{'name': 'common_reference'}]
preprocessing_after_split = [{'name': 'common_reference'}]
pp_rec = si.apply_preprocessing_pipeline(
    si.apply_preprocessing_pipeline(
        recording, preprocessing_before_split
    ).split_by('group')), 
preprocessing_after_split)

Good:

  • We don't have to do anything
    Bad
  • Bit awkward.
  1. Make split_by a preprocessing step
preprocessing_pipeline = [{'name': 'common_reference'}, {'name', 'split_by', 'kwargs': {'property': 'group'}, {'name': 'common_reference'}]
pp_rec = si.apply_preprocessing_pipeline(recording, preprocessing_pipeline)

Good: simple for user
Bad:

  • Typing gets more and more complex - Current if apply_preprocessing_pipeline takes in a rec/dict it returns a rec/dict. Now a rec might return a dict, if split_by is around.

Any other ideas?

If we stick with 1, let's document it. If we aim for 2, let's do it!

I think I prefer 1...

主要语言
Python
星标
883
派生
291
平均合并
3 天 17 小时
30 天内合并 PR
40

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SpikeInterface/spikeinterface 的其他 Issue

查看 SpikeInterface/spikeinterface 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。