Skip to content

Extend artifact detection: DetectAndRemoveArtifacts preprocessor and signed saturation#4539

Open
alejoe91 wants to merge 31 commits intoSpikeInterface:mainfrom
alejoe91:saturation-preprocessor
Open

Extend artifact detection: DetectAndRemoveArtifacts preprocessor and signed saturation#4539
alejoe91 wants to merge 31 commits intoSpikeInterface:mainfrom
alejoe91:saturation-preprocessor

Conversation

@alejoe91
Copy link
Copy Markdown
Member

This PR introduces a DetectAndRemoveArtifactsRecording class so that it can be used in the preprocessing pipeline.
Users can pass a recording_to_detect: in this case, saturation/artifacts are detected on that recording (e.g., raw) and applied to the preprocessor parent (preprocessed)

Also extended saturation to optionally provide the "sign" of the saturation events. This can be useful to further inspect saturation issues and track down experimental causes to the saturation.

@alejoe91 alejoe91 requested a review from samuelgarcia April 20, 2026 15:37
@alejoe91 alejoe91 requested a review from JoeZiminski April 20, 2026 15:37
@alejoe91 alejoe91 added the preprocessing Related to preprocessing module label Apr 20, 2026
@alejoe91 alejoe91 requested a review from chrishalcrow April 20, 2026 15:37
Comment thread src/spikeinterface/preprocessing/detect_artifacts.py Outdated
@chrishalcrow
Copy link
Copy Markdown
Member

Hello, this is great. Part of (my) pipeline philosophy is that you can load a pipeline from a dumped json/pickle:

def _make_pipeline_dict_from_recording_dict(recording_dict):

I don't know how this will work when one argument is a recording object? Might just work?

And I also like the idea that you can specify a pipeline externally without reference to the recording, which this breaks. But more philosophical than practical... I can't really see a way around this.

@alejoe91
Copy link
Copy Markdown
Member Author

alejoe91 commented Apr 21, 2026

Hello, this is great. Part of (my) pipeline philosophy is that you can load a pipeline from a dumped json/pickle:

def _make_pipeline_dict_from_recording_dict(recording_dict):

I don't know how this will work when one argument is a recording object? Might just work?

And I also like the idea that you can specify a pipeline externally without reference to the recording, which this breaks. But more philosophical than practical... I can't really see a way around this.

I have a suggestion. We can have some "magic" string:

  • "pipeline['raw']": tells the function to use the input recording
  • "pipeline['{preprocessing_step}']: grabs recording at a specific step.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preprocessing Related to preprocessing module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants