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
The
experanto/filters/directory currently has empty placeholder modules fortreadmill_filters.pyandgaze_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.pyrunning_filter(threshold, smoothing_sigma): Returns validTimeIntervals where the animal's treadmill speed exceeds a configurable threshold.OptionalGaussian smoothing prevents micro-fluctuations from splitting intervals.
gaze_filters.pyblink_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:
SequenceInterpolatoras inputList[TimeInterval]of valid clean datatests/test_domain_filters.py