Skip to content

Conversation

@mhhennig
Copy link
Member

@mhhennig mhhennig commented Dec 5, 2025

This fixes a bug in RemoveArtifactsRecordingSegment

Previously artifacts would not be removed if the trigger was before start_frame but the blanking carried on beyond. Only tested on zeros mode.

…actsRecordingSegment

Previously artifacts would not be removed if the trigger was before `start_frame` but the blanking carried on beyond. Only tested on `zeros` mode.
Co-authored-by: Chris Halcrow <57948917+chrishalcrow@users.noreply.github.com>
@alejoe91 alejoe91 added the preprocessing Related to preprocessing module label Dec 5, 2025
if pad is None:
mask = (self.triggers >= start_frame) & (self.triggers < end_frame)
else:
mask = (self.triggers >= start_frame - pad[1]) & (self.triggers < end_frame + pad[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mask = (self.triggers >= start_frame - pad[1]) & (self.triggers < end_frame + pad[0])
mask = (self.triggers >= start_frame - pad[0]) & (self.triggers < end_frame + pad[1])

pad is defined as pad = [int(ms_before * fs / 1000), int(ms_after * fs / 1000)]

Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhhennig see my comment

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.

3 participants