Extend artifact detection: DetectAndRemoveArtifacts preprocessor and signed saturation#4539
Extend artifact detection: DetectAndRemoveArtifacts preprocessor and signed saturation#4539alejoe91 wants to merge 45 commits intoSpikeInterface:mainfrom
DetectAndRemoveArtifacts preprocessor and signed saturation#4539Conversation
|
Hello, this is great. Part of (my) pipeline philosophy is that you can load a pipeline from a dumped json/pickle: 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:
What do you think? |
saturation application with apodization
for more information, see https://pre-commit.ci
oliche
left a comment
There was a problem hiding this comment.
It's good to go, maybe we could state that this apodization is a number of samples ?
Thanks a lot for looking at this !
Renamed |
| self.apodization_samples = apodization_samples | ||
|
|
||
| def get_traces(self, start_frame, end_frame, channel_indices): | ||
| traces = self.parent_recording_segment.get_traces(start_frame, end_frame, channel_indices) |
There was a problem hiding this comment.
When it's apodization, we should get traces with margin because the events could be on the edge. In that casem different start/end frames could give different results if we don't take margins into account
There was a problem hiding this comment.
@samuelgarcia I implemented the margin logic and added a proper test. For zeros and noise, margin is set to 0, so the behavior should be the same
chrishalcrow
left a comment
There was a problem hiding this comment.
I've only read the preprocessing pipeline stuff - honestly so happy with the solution!
Please don't merge until you've got an approval on the other stuff!
|
Also added automatic loading od saturation levels for SpikeGLX and OpenEphys, follwing SpikeInterface/probeinterface#434 When available, this sets the |
…saturation-preprocessor
This PR introduces a
DetectAndRemoveArtifactsRecordingclass 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.
EDIT (Chris): new preprocessing pipeline docs: https://spikeinterface--4539.org.readthedocs.build/en/4539/modules/preprocessing.html#the-preprocessing-pipeline