Skip to main content

robust eye movement detection for natural viewing

Project description

REMoDNaV - Robust Eye Movement Detection for Natural Viewing
============================================================

`Travis tests
status <https://travis-ci.org/psychoinformatics-de/remodnav>`__
`codecov.io <https://codecov.io/github/psychoinformatics-de/remodnav?branch=master>`__
`License: MIT <https://opensource.org/licenses/MIT>`__ `GitHub
release <https://GitHub.com/psychoinformatics-de/remodnav/releases/>`__
`PyPI version fury.io <https://pypi-hypernode.com/pypi/remodnav/>`__
`Average time to resolve an
issue <http://isitmaintained.com/project/psychoinformatics-de/remodnav>`__
`Percentage of issues still
open <http://isitmaintained.com/project/psychoinformatics-de/remodnav>`__

REMoDNaV is a velocity based eye movement event detection algorithm that
is based on, but extends the adaptive Nyström & Holmqvist algorithm
(Nyström & Holmqvist, 2010). It is built to be suitable for both static
and dynamic stimulation, and is capable of detecting saccades,
post-saccadic oscillations, fixations, and smooth pursuit events.
REMoDNaV is especially suitable for data without a trial structure and
performs robustly on data with temporally varying noise level.

Support
-------

All bugs, concerns and enhancement requests for this software can be
submitted here: https://github.com/psychoinformatics-de/remodnav

If you have a problem or would like to ask a question about how to use
REMoDNaV, please `submit a question to
NeuroStars.org <https://neurostars.org/new-topic?body=-%20Please%20describe%20the%20problem.%0A-%20What%20steps%20will%20reproduce%20the%20problem%3F%0A-%20What%20version%20of%20REMoDNaV%20are%20you%20using%3F%20On%20what%20operating%20system%20%3F%0A-%20Please%20provide%20any%20additional%20information%20below.%0A-%20Have%20you%20had%20any%20luck%20using%20REMoDNaV%20before%3F%20%28Sometimes%20we%20get%20tired%20of%20reading%20bug%20reports%20all%20day%20and%20a%20lil'%20positive%20end%20note%20does%20wonders%29&tags=remodnav>`__
with a ``remodnav`` tag. NeuroStars.org is a platform similar to
StackOverflow but dedicated to neuroinformatics.

Any previous REMoDNaV questions can be found here:
http://neurostars.org/tags/remodnav/

Installation via pip
--------------------

Install the latest version of ``remodnav`` from
`PyPi <https://pypi-hypernode.com/project/remodnav>`__. It is recommended to use a
dedicated `virtualenv <https://virtualenv.pypa.io>`__:

::

# create and enter a new virtual environment (optional)
virtualenv --python=python3 ~/env/remodnav
. ~/env/remodnav/bin/activate

# install from PyPi
pip install remodnav

Example usage
-------------

**required (positional) arguments:**

REMoDNaV is easiest to use from the command line. To get REMoDNaV up and
running, supply the following required information in a command line
call: - ``infile``: Data file with eye gaze recordings to process. The
first two columns in this file must contain x and y coordinates, while
each line is a timepoint (no header). The file is read with NumPy’s
``recfromcsv`` and may be compressed. - ``outfile``: Output file name.
This file will contain information on all detected eye movement events
in BIDS events.tsv format. - ``px2deg``: Factor to convert pixel
coordinates to visual degrees, i.e. the visual angle of a single pixel.
Pixels are assumed to be square. This will typically be a rather small
value.

Note: you can compute this factor from *screensize*, *viewing distance*
and *screen resolution* with the following formula:
``degrees(atan2(.5 * screen_size, viewing_distance)) / (.5 * screen_resolution)``
- ``sampling rate``: Sampling rate of the data in Hertz. Only data with
dense regular sampling are supported.

Exemplary command line call:

::

remodnav "inputs/raw_eyegaze/sub-01/ses-movie/func/sub-01_ses-movie_task-movie_run-1_recording-eyegaze_physio.tsv.gz" \
"sub-01/sub-01_task-movie_run-1_events.tsv" 0.0185581232561 1000.0

**optional parameters:**

REMoDNaV comes with many configurable parameters. These parameters have
sensible default values, but they can be changed by the user within the
command line call. Further descriptions of these parameters can be found
in the corresponding `publication <yettolink>`__.

+--------------+---+---------------------------------------------------+
| Parameter | U | Description |
| | n | |
| | i | |
| | t | |
+==============+===+===================================================+
| ``--min-blin | s | missing data windows shorter than this duration |
| k-duration`` | e | will not be considered for ``dilate nan`` |
| | c | |
+--------------+---+---------------------------------------------------+
| ``--dilate-n | s | duration for which to replace data by missing |
| an`` | e | data markers on either side of a signal-loss |
| | c | window. |
+--------------+---+---------------------------------------------------+
| ``--median-f | s | smoothing median-filter size (for initial data |
| ilter-length | e | chunking only). |
| `` | c | |
+--------------+---+---------------------------------------------------+
| ``--savgol-l | s | size of Savitzky-Golay filter for noise |
| ength`` | e | reduction. |
| | c | |
+--------------+---+---------------------------------------------------+
| ``--savgol-p | | polynomial order of Savitzky-Golay filter for |
| olyord`` | | noise reduction. |
+--------------+---+---------------------------------------------------+
| ``--max-vel` | d | maximum velocity threshold, will issue warning if |
| ` | e | exceeded to inform about potentially |
| | g | inappropriate filter settings. |
| | / | |
| | s | |
| | e | |
| | c | |
+--------------+---+---------------------------------------------------+
| ``--min-sacc | s | minimum duration of a saccade event candidate. |
| ade_duration | e | |
| `` | c | |
+--------------+---+---------------------------------------------------+
| ``--max-pso_ | s | maximum duration of a post-saccadic oscillation |
| duration`` | e | (glissade) candidate. |
| | c | |
+--------------+---+---------------------------------------------------+
| ``--min-fixa | s | minimum duration of a fixation event candidate. |
| tion_duratio | e | |
| n`` | c | |
+--------------+---+---------------------------------------------------+
| ``--min-purs | s | minimum duration of a pursuit event candidate. |
| uit_duration | e | |
| `` | c | |
+--------------+---+---------------------------------------------------+
| ``--min-inte | s | no saccade detection is performed in windows |
| rsaccade_dur | e | shorter than twice this value, plus minimum |
| ation`` | c | saccade and PSO duration. |
+--------------+---+---------------------------------------------------+
| ``--noise-fa | | adaptive saccade onset threshold velocity is the |
| ctor`` | | median absolute deviation of velocities in the |
| | | window of interest, times this factor (peak |
| | | velocity threshold is twice the onset velocity); |
| | | increase for noisy data to reduce false positives |
| | | (Nyström and Holmqvist, 2010, equivalent: 3.0). |
+--------------+---+---------------------------------------------------+
| ``--velthres | d | start value for adaptive velocity threshold |
| h-startveloc | e | algorithm (Nyström and Holmqvist, 2010), should |
| ity`` | g | be larger than any conceivable minimum saccade |
| | / | velocity. |
| | s | |
| | e | |
| | c | |
+--------------+---+---------------------------------------------------+
| ``--max-init | H | maximum saccade frequency for initial detection |
| ial-saccade- | z | of major saccades, initial data chunking is |
| freq`` | | stopped if this frequency is reached (should be |
| | | smaller than an expected (natural) saccade |
| | | frequency in a particular context). |
+--------------+---+---------------------------------------------------+
| ``--saccade- | s | size of a window centered on any velocity peak |
| context-wind | e | for adaptive determination of saccade velocity |
| ow-length`` | c | thresholds (for initial data chunking only). |
+--------------+---+---------------------------------------------------+
| ``--lowpass- | H | cut-off frequency of a Butterworth low-pass |
| cutoff-freq` | z | filter applied to determine drift velocities in a |
| ` | | pursuit event candidate. |
+--------------+---+---------------------------------------------------+
| ``--pursuit- | d | fixed drift velocity threshold to distinguish |
| velthresh`` | e | periods of pursuit from periods of fixation. |
| | g | |
| | / | |
| | s | |
| | e | |
| | c | |
+--------------+---+---------------------------------------------------+

Thus, to change the default value of any parameter(s), it is sufficient
to include the parameter(s) and the desired value(s) into the command
line call:

::

remodnav "inputs/raw_eyegaze/sub-01/ses-movie/func/sub-01_ses-movie_task-movie_run-1_recording-eyegaze_physio.tsv.gz" \
"sub-01/sub-01_task-movie_run-1_events.tsv" 0.0185581232561 1000.0 --min-blink-duration 0.05

Citation
--------

TODO

License
-------

MIT/Expat

Contributing
------------

Contributions in the form of issue reports, bug fixes, feature
extensions are always welcome.

References
----------

Nyström, M., & Holmqvist, K. (2010). An adaptive algorithm for fixation,
saccade, and glissade detection in eyetracking data. Behavior research
methods, 42(1), 188-204. doi: https://doi.org/10.3758/BRM.42.1.188


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remodnav-0.2.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

remodnav-0.2-py2.py3-none-any.whl (29.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file remodnav-0.2.tar.gz.

File metadata

  • Download URL: remodnav-0.2.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.20.0 CPython/3.6.3

File hashes

Hashes for remodnav-0.2.tar.gz
Algorithm Hash digest
SHA256 277abc03ca82d8d555ad84bdbce61d04871eb89c02d6c1cbc6cee6228406ea4f
MD5 20d01fa2eab4964906c57b01759e685d
BLAKE2b-256 9a0093e4043df90ba040c9d0aac7dd529f52c8bb1ca9ba8d82fbf6a791bcbe89

See more details on using hashes here.

File details

Details for the file remodnav-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: remodnav-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.20.0 CPython/3.6.3

File hashes

Hashes for remodnav-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ad8d27db5fb68d31978550ffb4f911f4cb2f657f574721061d019355e252cb8
MD5 11c6f25064ac00478ab166a7c29bb562
BLAKE2b-256 823deae3c70fccebb8dd9f0ea1f22585986d22e4d147087dbb2e21c2bdb76cc7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page