Skip to main content

Stimuli for vision science, as image arrays

Project description

Stimupy

A pure-Python package for creating new and existing visual stimuli commonly used in the study of contrast, brightness, lightness, and other aspects of visual perception.

JOSS Status PyPI version Tests Py versions Documentation Status



stimupy has been designed to:

  • generate (novel) visual stimuli in a reproducible, flexible, and easy way
  • recreate exact stimuli as they have been used in prior vision research
  • explore large parameter spaces to reveal relations between formerly unconnected stimuli
  • provide classic stimulus sets (e.g. ModelFest), exactly as described in the original manuscripts (including experimental data)
  • build new stimulus sets or benchmarks (e.g. for testing computational models), and easily add them to stimupy
  • support vision science by providing a large, openly-available and flexible battery of relevant stimulus functions
  • unify and automate stimulus creation
  • be FAIR: Findable, Accessible, Interoperable, and Reusable

Core features:

Stimupy has been designed to generate stimuli from code, so that they are reproducible, flexible, and easy.

  • basic visual stimulus components, such as basic shapes, wave gratings, Gaussians

  • visual noise textures, of different kinds,

  • many different parameterized visual stimuli

    • Gabors, plaids, edges,
    • a variety of so-called illusions (e.g. Simultaneous Brightness Contrast, White's illusion, Hermann grid, Ponzo illusion), and many more
  • exact replications of stimuli previously published (e.g. ModelFest) as described in their respective papers

  • all stimuli are fully parameterizable

    • with interpretable parameters that are familiar and relevant to vision scientists (e.g. visual angle, spatial frequency, target placements).
    • This also makes it possible to explore stimulus parameter spaces which might reveal relations between formerly unconnected stimuli
  • stimuli are composable/composed:

    • stimuli tend to be composed from several components, and these provided building blocks and masks can be used to assemble more complicated geometries
  • flexible output structures

    • generated stimuli are Python dictionary
      • mutable data structures (compared to objects), so they allow the user to add additional information easily (e.g. stimulus descriptions, stimulus masks, experimental data).
    • containing the stimulus-image as a NumPy-array,
      • makes images fully interoperable using common NumPy tooling (rather than, e.g., an OpenGL texture),
    • together with other useful stimulus-specific information (e.g. (target) masks, sizes etc.).
  • modular and therefore easy to extend with new stimulus functions, and new stimulus sets

  • utility functions for stimulus import, export, manipulation (e.g. contrast, size), or plotting

  • application-oriented documentation documentation, including interactive demonstrations of stimulus functions

  • unit and integration tests

See the documentation for more details

A small fraction of the stimulus variety that stimupy can produce \label{fig:overview}


Citing stimupy

If you use stimupy for your scientific work, please cite the paper as:

Schmittwilken, L., Maertens, M., & Vincent, J. (2023). stimupy: A Python package for creating stimuli in vision science. Journal of Open Source Software, 8(86), 5321. https://doi.org/10.21105/joss.05321

Here is a BibTeX entry for this reference:

@article{Schmittwilken2023,
    doi = {10.21105/joss.05321},
    url = {https://doi.org/10.21105/joss.05321},
    year = {2023},
    publisher = {The Open Journal},
    volume = {8},
    number = {86},
    pages = {5321},
    author = {Lynn Schmittwilken and Marianne Maertens and Joris Vincent},
    title = {stimupy: A Python package for creating stimuli in vision science},
    journal = {Journal of Open Source Software}
}

Your stimulus (set) is not here?

Given the modular nature of the package, any stimulus or stimulus set not currently available, can be easily added. Open an issue and let us know what you'd like to see added.

If you want to contribute yourself, see contributing


Installation

pip can install stimupy directly PyPI:

pip install stimupy

OR (for developers), install from source:

  1. Clone the repository from GitHub:

    git clone git@github.com:computational-psychology/stimupy.git
    
  2. stimupy can then be installed using pip. From top-level directory run:

    pip install .
    

    to install to your local python library.

To install in developer/editable mode: pip install -e . at the root directory. This makes changes to files immediately usable, rather than having to reinstall the package after every change.

Dependencies

Dependencies should be automatically installed (at least using pip). stimupys required dependencies are:

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

stimupy-1.1.2.tar.gz (190.0 kB view details)

Uploaded Source

Built Distribution

stimupy-1.1.2-py3-none-any.whl (221.8 kB view details)

Uploaded Python 3

File details

Details for the file stimupy-1.1.2.tar.gz.

File metadata

  • Download URL: stimupy-1.1.2.tar.gz
  • Upload date:
  • Size: 190.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for stimupy-1.1.2.tar.gz
Algorithm Hash digest
SHA256 67cfe7e1a71df9c6968780382d69ec6721c6fdf3392d3cff1b2a61509ec7dcee
MD5 306ca769e3b9743e2f8319f2baea7e2f
BLAKE2b-256 182e5836d147e51adc29750ab397b51a53e0a3c9d626051fee2c0dc47ed7a13c

See more details on using hashes here.

File details

Details for the file stimupy-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: stimupy-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 221.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for stimupy-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37e5176c87f1162746a21f15884b432d83ef938c70c9cac06ada4f769b9e1338
MD5 052ea539003ccaffa6fd33fc98605ee8
BLAKE2b-256 377e6bce5c220acab9384dd18e5f422c6b72ced526b2eab5bbe15dfdd6ada8af

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