Giter Site home page Giter Site logo

stimulation_protocol's Introduction

Stimulation_protocol

Overview of the stimulation

Each stimulation protocol consists in the presentation of a set of natural images and of drifting grating stimuli.

  • Each drifting grating stimuli is presented 10 times.
  • A subset of the images is presented 10 times (repeated images)
  • The rest of the images are presented only once (unique images)
(temporary solution, later this will change)

To simplify the experimental procedure the experiment is divided in 10 section.

  • The same repeated images and drifting grating stimuli are presented once in every section of the experiment, so that after the 10th section these stimuli are presented 10 times.
  • The unique images changes over every sections, so that after the 10th section these stimuli are presented only once

Stimuli are displayed by the utils.display_stimuli(..., utils.SignFunc), which take as last parameter a signaling function to call when the window is flipped (i.e. when stimulus is presented) with

win.callOnFlip(MySignFunc, frameInfo, clock)

Currently the functions called is utils.SignFunc() which takes as arguments the frameInfo dictionary and a clock to store timestamps each frame presentation.

Usage

Firstly set the parameters in params_stim.txt according to needs.

{
    "stim_duration": 0.5, #in seconds
    "blank_duration": 5, #in seconds

    "size_of_stimuli" : 10, #in degree of visual field

    "images_path": "./images/life_of_animals", 
    "Nrepeated": 40, #number of images repeated over sections
    "Nunique": 60,  #number of images not repeated over sections

    "sf_grating": [0.01, 0.02, 0.04, 0.08, 0.16, 0.32], #spatial frequency of grating stimuli in cycles per degree
    "Nori_grating": 16 # number of different orientation of visual stimuli
    "size_grating" : 200 # temporarely needs to be adjusted by hand to have fullscreen grating stimuli (units=deg)
}

then run the script

python StimProtocol.py

Before showing stimuli StimProtocol.py asks through a dialogue box experiment informations and monitor name and distance.

The experiment information are used to construct the structure of the data folder.

If the monitor name is not found among the ones already used, the user will be asked to insert details of the monitor.

Logs

Data is stored in appropriate folder according to the experiment info.

Example: data/mouse/mouse01/13-12-2020/section_1

Inside the folder there are four json files:

  • monInfo.json contains details about monitor used and its distance
  • param_stim.json contains used parameters of stimulation
  • stimuli_in_order.json contains a dictionary where id of stimuli (image_path or orientation and spatial frequency of drifting gratings) and whether each stimulus is repeated or not are saved
  • frameInfo.json contain dictionary of detailed logs of stimulation protocol
    • timestamp of frame presentation
    • stimulus id of the stimulus presented in that specific frame (image_path or orientation, spatial frequency and phase of drifting gratings)

stimulation_protocol's People

Contributors

lucabaroni avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.