{ "info": { "author": "Akseli Palen", "author_email": "akseli.palen@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Human Machine Interfaces", "Topic :: Scientific/Engineering :: Image Recognition", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "================\nsaccademodel-py\n================\n\nA least-squares optimal offline method to find saccadic reaction time and saccade duration from tracked gaze points.\n\nYou have tracked the gaze points of the following event sequence:\n\n1. A person looks at point (A). An image appears at (B).\n2. The person reacts to the image and starts to move their gaze toward (B). The *saccade* starts.\n3. The gaze arrives to (B). The saccade ends.\n4. The person looks at point (B).\n\nNow you want to determine:\n\na. The time between events 1 and 2, called the *saccadic reaction time* or *SRT*.\nb. The time between events 2 and 3, called the *saccade duration* or *SD*.\n\nThe *saccademodel* algorithm computes the times for you by fitting an ideal gaze path to the data. The ideal gaze path has the following structure. From t=0 to t=saccade_start the ideal gaze is exactly at point (A). From t=saccade_start to t=saccade_end the ideal gaze moves from (A) to (B) with constant velocity. From t=saccade_end to t=n the gaze remains at (B). The algorithm finds such times *saccade_start* and *saccade_end* that **minimize the mean squared error** between the ideal gaze path and the given tracked gaze points. In other words, the algorithm splits the data to three segments: source fixation, saccade, and target fixation.\n\nAs the **greatest advantage**, when compared to velocity-based saccade recognition methods, data does not need to be filtered beforehand because the squared error approach does that by itself. Even though filtering would yield smaller total squared error, it does not affect the estimates of *saccade_start* and *saccade_end*. However, if the noise in the data is nonstationary, some special noise filtering methods might be needed.\n\nAs the **greatest disadvantage**, the *saccademodel* algorithm is suitable only for offline analysis and therefore cannot be used in realtime setups.\n\n\n\n1. Install\n==========\n\nWith `pip\n`_::\n\n $ pip install saccademodel\n\n\n\n2. Usage\n========\n\nThe data structure **pointlist** is used thoroughly. It is a list of points, where each point is a list [x, y].\n\nThe usage is simple::\n\n >>> import saccademodel\n >>> rawdata = [\n [130.012, 404.231],\n [129.234, 403.478],\n [None, None],\n [133.983, 450.044],\n ...\n ]\n >>> results = saccademodel.fit(rawdata)\n >>> print(results)\n {\n 'source_points': [[344.682, 200.115], ...],\n 'saccade_points': [[324.233, 202.393], ...],\n 'target_points': [[556.423, 112.607], ...],\n 'mean_squared_error': 0.000166802\n }\n\nNote that the lengths of the returned lists can be used to determine saccadic reaction time and duration. For example, given the points from the appearance of stimulus, the saccadic reaction time is captured in the length of ``source_points`` and the saccade duration in ``saccade_points``. If the frame rate is known, you can convert the lengths to seconds by::\n\n >>> framerate = 300.0 # samples per second\n >>> saccadic_reaction_time = len(results.source_points) / framerate\n >>> saccade_duration = len(results.saccade_points) / framerate\n\n\n\n3. API\n======\n\n3.1. saccademodel.fit(gazepointlist)\n------------------------------------\n\nParameter:\n\n- gazepointlist: a list of [x, y] points i.e. a list of lists.\n\nReturn dict with following keys:\n\n- source_points: the points before the saccade\n- saccade_points: the points in the saccade\n- target_points: the points after the saccade.\n- mean_squared_error: the average squared error from the model for a point.\n\n\n3.2. saccademodel.version\n-------------------------\n\nThe current version string::\n\n >>> saccademodel.version\n '1.2.3'\n\n\n\n4. For developers\n=================\n\n4.1. Virtualenv\n---------------\n\nUse virtualenv::\n\n $ virtualenv -p python3.5 saccademodel-py\n $ cd saccademodel-py\n $ source bin/activate\n ...\n $ deactivate\n\n\n4.2. Jupyter Notebook\n---------------------\n\nUsage::\n\n $ cd explore\n $ jupyter notebook\n\nInstall requirements::\n\n $ pip install --editable .[notebook]\n\n\n4.3. Testing\n------------\n\nFollow `instructions to install pyenv\n`_ and then either run quick tests::\n\n $ python3.5 setup.py test\n\nor comprehensive tests for multiple Python versions in ``tox.ini``::\n\n $ pyenv local 2.6.9 2.7.10 3.1.5 3.2.6 3.3.6 3.4.3 3.5.0\n $ eval \"$(pyenv init -)\"\n $ pyenv rehash\n $ tox\n\nInstall new pyenv environments by::\n\n $\u00a0pyenv install 3.4.5\n\nValidate README.rst at `http://rst.ninjs.org/\n`_\n\n\n4.4. Publishing to PyPI\n-----------------------\n\nFollow `python packaging instructions\n`_:\n\n1. Create an unpacked sdist: ``$ python setup.py sdist``\n2. Create a universal wheel: ``$ python setup.py bdist_wheel --universal``\n3. Go to `PyPI and register the project by filling the package form\n `_ by uploading\n ``saccademodel.egg-info/PKG_INFO`` file.\n4. Upload the package with twine:\n\n 1. Sign the dist: ``$ gpg --detach-sign -a dist/saccademodel-1.2.3*``\n 2. Upload: ``twine upload dist/saccademodel-1.2.3*`` (will ask your PyPI password)\n\n5. Package published!\n\nUpdating the package takes same steps except the 3rd.\n\n\n\n5. Versioning\n=============\n\n`Semantic Versioning 2.0.0\n`_\n\n\n\n6. License\n==========\n\n`MIT License\n`_", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/infant-cognition-tampere/saccademodel-py", "keywords": "saccade estimation eye-tracking", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "saccademodel", "package_url": "https://pypi.org/project/saccademodel/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/saccademodel/", "project_urls": { "Homepage": "https://github.com/infant-cognition-tampere/saccademodel-py" }, "release_url": "https://pypi.org/project/saccademodel/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A least-squares optimal method to find the saccadic reaction time and the saccade duration from tracked gaze points", "version": "0.1.0" }, "last_serial": 1853880, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a8cccb2ac7685989e186e830fc985bfa", "sha256": "61478ecd899164a965a49a4682a10e4788f143e6c8fc6d6d11be19a56b7c188d" }, "downloads": -1, "filename": "saccademodel-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a8cccb2ac7685989e186e830fc985bfa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14483, "upload_time": "2015-12-09T13:50:46", "url": "https://files.pythonhosted.org/packages/69/50/3c70552ab30683f7d134030e31839e47b040e70c6130324c0238c1a71d99/saccademodel-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a11c3d3ea687777b03f8bb0bfae62fe0", "sha256": "724e556045e50cb669d8ea44e1de7e70c2c7ae462adf7ec04ae00cdbb0c26a71" }, "downloads": -1, "filename": "saccademodel-0.1.0.tar.gz", "has_sig": true, "md5_digest": "a11c3d3ea687777b03f8bb0bfae62fe0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10360, "upload_time": "2015-12-09T13:50:52", "url": "https://files.pythonhosted.org/packages/7f/7b/04735a396879925a39c8ee861f4fe21622ccd2abd73cc7f0a6c73e500c44/saccademodel-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a8cccb2ac7685989e186e830fc985bfa", "sha256": "61478ecd899164a965a49a4682a10e4788f143e6c8fc6d6d11be19a56b7c188d" }, "downloads": -1, "filename": "saccademodel-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a8cccb2ac7685989e186e830fc985bfa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14483, "upload_time": "2015-12-09T13:50:46", "url": "https://files.pythonhosted.org/packages/69/50/3c70552ab30683f7d134030e31839e47b040e70c6130324c0238c1a71d99/saccademodel-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a11c3d3ea687777b03f8bb0bfae62fe0", "sha256": "724e556045e50cb669d8ea44e1de7e70c2c7ae462adf7ec04ae00cdbb0c26a71" }, "downloads": -1, "filename": "saccademodel-0.1.0.tar.gz", "has_sig": true, "md5_digest": "a11c3d3ea687777b03f8bb0bfae62fe0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10360, "upload_time": "2015-12-09T13:50:52", "url": "https://files.pythonhosted.org/packages/7f/7b/04735a396879925a39c8ee861f4fe21622ccd2abd73cc7f0a6c73e500c44/saccademodel-0.1.0.tar.gz" } ] }