Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sa-nouri/ms-selectivity-feature

Repository files navigation

Microsaccade Selectivity as Discriminative Feature for Object Decoding

This repository contains the code for analyzing microsaccade selectivity as a discriminative feature for object decoding in eye tracking data.

Features

  • Microsaccade detection and analysis
  • Blink detection and removal
  • Glitch detection and correction
  • Data preprocessing and postprocessing
  • Comprehensive test suite
  • Logging support

Installation

Prerequisites

  • Python 3.11 or higher
  • pip (Python package installer)

Installation Steps

  1. Clone the repository:
git clone https://github.com/yourusername/ms-selectivity-feature.git
cd ms-selectivity-feature
  1. Create and activate a virtual environment (recommended):
python -m venv msenv
source msenv/bin/activate  # On Windows: msenv\Scripts\activate
  1. Install the package:
pip install -e .

For development, install with additional dependencies:

pip install -e ".[dev]"

Usage

Basic Usage

from src import detect_microsaccades, detect_blinks, detect_glitches
import numpy as np

# Load your eye tracking data
timestamps = np.load('data/timestamps.npy')
x_positions = np.load('data/x_positions.npy')
y_positions = np.load('data/y_positions.npy')

# Detect microsaccades
microsaccades = detect_microsaccades(
    x_positions,
    y_positions,
    timestamps,
    velocity_threshold=6.0,
    min_duration=3,
    max_duration=20
)

# Detect blinks
blinks = detect_blinks(
    x_positions,
    y_positions,
    timestamps,
    min_duration=50,
    min_amplitude=2.0
)

# Detect glitches
glitches = detect_glitches(
    x_positions,
    y_positions,
    timestamps,
    threshold=5.0
)

Advanced Usage

For more advanced usage examples, please refer to the examples directory.

Development

Setting Up Development Environment

  1. Install development dependencies:
pip install -e ".[dev]"
  1. Install pre-commit hooks:
pre-commit install

Running Tests

pytest

For coverage report:

pytest --cov=src tests/

Code Style

This project uses:

  • Black for code formatting
  • isort for import sorting
  • flake8 for linting
  • mypy for type checking

Run all checks:

black src tests
isort src tests
flake8 src tests
mypy src

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use this code in your research, please cite:

@article{nouri2025microsaccade,
  title={Microsaccade selectivity as discriminative feature for object decoding},
  author={Nouri, Salar and Tehrani, Amirali Soltani and Faridani, Niloufar and Toosi, Ramin and Noroozi, Jalaledin and Dehaqani, Mohammad-Reza A},
  journal={Iscience},
  volume={28},
  number={1},
  year={2025},
  publisher={Elsevier}
}

Acknowledgments

  • List any acknowledgments here
  • Include references to related work
  • Credit any collaborators or institutions

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages