Skip to content

Feature: Implement domain specific treadmill and gaze physiological filters #140

@VaibhavGarg2003

Description

@VaibhavGarg2003

The experanto/filters/ directory currently has empty placeholder modules for treadmill_filters.py and gaze_filters.py. In systems neuroscience, it is standard practice to filter behavioral data based on the animal's physiological state before analysis.
For example:

Treadmill: Mouse visual cortex responses differ between running and resting states.
Researchers often want to analyze only one state at a time.

Gaze/Eye Tracking: Eye tracker data contains artifacts from blinks (pupil size drops to 0 or NaN) and saccades (rapid eye movements). These time windows should be excluded to ensure data quality.

I propose implementing the following filters, following the closure pattern established in common_filters.py:

treadmill_filters.py

  • running_filter(threshold, smoothing_sigma): Returns valid TimeIntervals where the animal's treadmill speed exceeds a configurable threshold.
    OptionalGaussian smoothing prevents micro-fluctuations from splitting intervals.

gaze_filters.py

  • blink_filter(vicinity, pupil_channel_idx): Detects blinks (pupil size drops to 0 or NaN) and excludes a configurable time window around each event.

Both filters will:

  • Accept a SequenceInterpolator as input
  • Return List[TimeInterval] of valid clean data
  • Include comprehensive tests in a new tests/test_domain_filters.py
  • Include Numpy style docstrings

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions