Coder Social home page Coder Social logo

cpicanco / stimulus_control Goto Github PK

View Code? Open in Web Editor NEW
10.0 8.0 7.0 29.79 MB

A teaching machine for free behavioral experiments

License: GNU General Public License v3.0

Pascal 99.28% Python 0.69% Shell 0.03%
stimulus-control behavior-analysis prototype pascal

stimulus_control's Introduction

Stimulus Control

DOI

Stimulus Control is a fork of EAM (https://github.com/eep-lab/eam).

  • It is aimed at fast programming of behavioral experiments.
  • It can be extended to Design, Present, Record and Archive a wide range of behavioral experiments.
  • It was designed for Participants, Researchers and Developers.
  • It is a prototype to run non time-critical experiments.
  • It is being inspired by OpenSesame, Psychopy and Expyriment.

BAIXE A VERSÃO MAIS RECENTE AQUI.

Download the prototype here.

Instructions to compile the prototype here.

Works that cited Stimulus Control

Cedro, Á. M., Borges, J., Diniz, M. L. N. et al. (2019). The Psychological Record. https://doi.org/10.1007/s40732-019-00346-5

Martins T. H. S., Rodrigues R. M., Araújo F. C. O. et al. (2023). Journal of Experimental Analysis of Behavior. https://10.1002/jeab.881

Some features

  • Text Messages

  • Simple Discriminations

  • Conditional Discriminations

  • Task Styles

    • Feature positive effect (uses keyboard as operandum)
    • Go/No-Go (using keyboard or mouse as operandum)
    • MTS (using keyboard or mouse as operandum)
    • SPAN (using keyboard or mouse as operandum, work in progress)
    • and others
  • Stimuli (antecedents, consequents):

    • Sounds using the (non-free, as in freedom) Bass library (a substitute is in need)
    • Images (jpg, bmp, png), opaque or transparent
    • Videos using the LCLVLC component and the libvlc library will be implemented.
  • Backgrounds

    • Random visual mask
    • Colors
  • Responses (schedules of reinforcements):

    • CRF, EXT
    • FT, VT
    • FR, VR
    • FI, VI,
    • DRH, DRL
  • Designs

    • Free operant
    • Discrete Trials
  • Performance Assessment/Criteria

    • Consecutive Hits
    • Hit porcentage in Bloc
  • Blocs of Trials

    • Create blocs of trials
    • Concatenate blocs of trials
    • Concatenate blocs of trials based on participant's performance (if criteria was reached, go to bloc x, if not go to bloc y)
  • Timestamped Events

    • Starts and endings of trials, Hits and Misses are timestamped by default
    • Custom timestamps can be implemented through custom trial types
    • For high precision and high granularity timestamps
      • We use EpikTimer package on windows
      • We use clock_get_time on linux
  • Pupil Communication (https://github.com/pupil-labs/pupil)

    • Auto start/stop of Pupil Recordings
    • Auto start/stop (and custom start) of the current selected Pupil Calibration Method
    • Prompts for unsuccesful calibration
    • More details about our implementation here: https://github.com/cpicanco/pupil-fpc
  • Cross-Platform. Tested under Windows (7, 8 and 10), Crunchbang 11, Ubuntu LTS (16.04) and Debian 9.

  • Free software, GPL3, compiled with Lazarus RAD IDE (1.8.2) and FPC (3.0.4).

  • Core code was written using a Behavior Analytic ontology.

Changes Made

  • Adapted from Delphi to Free Pascal compiler and Lazarus development environment
  • Replaced old GUI for a new prototype one
  • Fixed some timing bugs
  • Fixed some bugs related to the TTrial create/free life cycle
  • New trial types inherited from TTrial
  • Refactoring for better Behavior Analytic ontology fit.
  • For more, please check GitHub issues: https://github.com/cpicanco/stimulus_control/issues

Running from source

https://github.com/cpicanco/stimulus_control/wiki

stimulus_control's People

Contributors

cpicanco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stimulus_control's Issues

Sugestão - Pasta de participantes

Tenho uma sugestão para quando um novo nome de participante for colocado na aba "geral", automaticamente aparecer uma pasta nomeada com todos os arquivos necessários para iniciar o experimento.

erro nas imagens que estou usando jpg

não sei por que ta dando erro nessas imagens sendo que está incluído a que você utilizou e disse que não encontrou o problema, será que tem a ver com a dimensão?
já utilizei dois formatos (png e jpg) e mesmo assim não funcionou
erro estimulos

algumas imagens que utilizei
a1
a3
a2

Does the software runs time critical experiments?

I did not test. I should say that it was not intended for time critical experiments. I guess that time critical experiments would require enhanced drawing methods and GPU specific implementation.

O último modelo auditivo programado se mantém nas demais tentativas

  • Está apresentado o mesmo estímulo modelo auditivo em todas as tentativas. No caso, apresentada o último modelo auditivo carregado. Por exemplo, eu programei oito tentativas. A oitava foi com Sol sustenido menor (G#m). Quando fui rodar, o Stimulus Control apresentou o G#m em todas as oito tentativas. Ao conferir o arquivo TXT que é gerado, o nome da tentativa é aquela do arquivo que se quis carregar, mas o Sstm é o arquivo da ultima tentativa programada. Abaixo um exemplo do que estou falando:
    [Blc 1 - T7]
    Kind=MTS
    Name=Acordes_projeto_borges_F#->maior
    Cursor=0
    SStm=Acordes_projeto_borges_G#m.wav 1 12632256 (onde esta "G#m.wav" deveria ser F#.wav, indicando o estímulo modelo S+ no caso desta tentativa é o F#).
    Se eu entrar no arquivo TXT e mudar os "SStm" um por um manualmente funciona.

Multilanguage support for UI

Code should be coded in english. User interface should have as many as possible languages, but right now it will receive English and Portuguese attention.

Reduce memory use

All session parameters are saved inside text files with the INI file structure:

[Section]
Key=Value

In the current implementation (unit/session_config.pas) the program will load some of this values through a custom (overrided) ReadSectionValues method;

TCIniFile = class (TIniFile)
public
procedure ReadSectionValues(const Section: string; Strings: TStrings); override;
end;

The memory used grows very fast in some circumstances, because all trial sections Key=values are stored inside TSringList's.

Specially when the 'NextTrial= x' feature is used to jump over trials, there is no need to load this trials into memory.

So a solution may be to load the current and the following trial at the beginning of each trial.

O estímulo comparação considerado correto em todas as tentativas é da última tentativa programada

  • Acompanhando o bug anterior, a resposta considerada correta em todas as tentativas é aquela que foi programada na última tentativa. Então, se na última tentativa programada a resposta certa foi considerada escolher a palavra menor, esta fica para todas as tentativas programadas até então. Um exemplo disto abaixo, nas linhas de TXT:
    [Blc 1 - T6]
    Kind=MTS
    Name=Acordes_projeto_borges_C#->maior (exemplo do erro anterior)
    Cursor=0
    SStm=Acordes_projeto_borges_G#m.wav 1 12632256 (exemplo do erro anterior)
    SSch=CRF
    NumComp=2
    C1IET=Rpositivo.png 0 0 1000
    C1Res=HIT
    C1Stm=menor.png 0 12632256 (o certo aqui seria maior.png)
    C1Sch=CRF
    C1Nxt=
    C1TO=
    C2IET=X.png 0 0 1000
    C2Res=MISS
    C2Stm=maior.png 0 12632256 B (o certo aqui seria menor.png).

Se a alteração for feita direto no arquivo TXT, colocando maior.png e menor.png nos lugares certos, funciona.

Crash on end session.

This bug came back with the dizzy timers type. Something related to the EndTrial method. The Trial object is loosing its reference in the wrong time raising RunTime error 216. Need to fix that.

Apparently this bug occurs only when finishing the session by pressing crtl+q (key down event).

Implement Calibration Screen

  • It will be inherited from TTrial.
  • It will have a standard, hard coded set of calibration points (4 or 10).
  • Background/Points/Screen luminance must be optimized for OpenCV OpticalFlow.

Improve time accuracy when playing successive sounds

Improve the time accuracy for successive sound stimuli may be possible in the short time; its noticeable with the "naked eye".

Further improvements may require to find a cheaper way to get some more precise feedback of the stimuli presentation lags/inaccuracy. Unfortunately, the Black Box Tool Kit is not affordable at all.

A ferramenta de Randomização não está alterando as tentativas, apenas os nomes destas

A ferramenta de randomização não está funcionando. As tentativas são apresentadas na ordem que foram programadas na aba "tentativas" ferramenta "MTS".

Quando abrimos o arquivo TXT para conferir, o nome da tentativa foi randomizado, mas os parâmetros não acompanham a mudança. Exemplo abaixo:

[Blc 1 - T2]
Kind=MTS
Name=Acordes_projeto_borges_F#m->menor(a) (nome randomizado)
Cursor=0
SStm=Acordes_projeto_borges_C#.wav 1 255 (acorde modelo da tentativa, que foi programado como tentativa 2 na ferramenta MTS)
SSch=CRF
NumComp=2
C1IET=0 0 1000
C1Res=HIT
C1Stm=maior(a).png 0 255
C1Sch=CRF
C2IET=0 0 1000
C2Res=MISS
C2Stm=menor(a).png 0 255
C2Sch=CRF
SBnd=300 170 300 200
SMsg=Acordes_projeto_borges_C# - 1
C1Bnd=300 810 300 200
C1Msg=menor(a) - 3
C2Bnd=300 490 300 200
C2Msg=maior(a) - 2

[Blc 1 - T3]
Kind=MTS
Name=Acordes_projeto_borges_D#->maior(a)
Cursor=0
SStm=Acordes_projeto_borges_C#m.wav 1 255
SSch=CRF
NumComp=2
C1IET=0 0 1000
C1Res=HIT
C1Stm=menor(a).png 0 255
C1Sch=CRF
C2IET=0 0 1000
C2Res=MISS
C2Stm=maior(a).png 0 255
C2Sch=CRF
SBnd=300 490 300 200
SMsg=Acordes_projeto_borges_C#m - 2
C1Bnd=300 170 300 200
C1Msg=menor(a) - 1
C2Bnd=300 810 300 200
C2Msg=maior(a) - 3

Limite do número de comparações

Percebi que 8 comparações é o limite por tentativa. Queria saber se terá alguma atualização que possa aumentar esse número de comparações?
Necessidade: precisava utilizar 12 comparações em uma mesma tentativa.

improve runtime language setup

Setting default language during xml property storage event OnRestore event will reset some components to default values. Right now, a work around is to save old values, then setup the language and then reload old values. This is too much work for the long run. A better alternative is in need.

ERRO NO RELATÓRIO - INCONSISTÊNCIA

No relatório produzido pelo programa após uma sessão, a coluna Tentativa.Nome não está consistente com a coluna S.Comparações (as duas colunas estão em cor vermelho no arquivo em anexo). Pelo que aparece no relatório a coluna S.Comparações está mostrando uma tentativa a frente da que deveria mostrar, ou seja, se na coluna Tentativa.Nome mostra a tentativa 1, na coluna S.Comparações mostra a tentativa 2 e assim por diante.
ERRO NO RELATÓRIO DE SESSÃO - INCONSISTÊNCIA.xlsx

Improve time accurary system wide

Now the program requires time handling for:

  • Latency, Total Session duration (and other similar records);
    • it uses GetTickCount to get BeginTime, EventTime differences (e.g.);
    • BeginTime always is the beginning of the session for improved precision;
  • Response control;
    • it uses a single thread for each trial instance as a custom timer to define (increment) time. In this case It works as chronometer to control schedules of reinforcement (e.g.)
    • it is necessary to test this in a more reliable and transparent way. It was design to deliver 100-500 miliseconds time resolution on two intel machines (i3, and a Pentium(R) Dual-Core CPU T4500 @ 2.30GHz), on linux and windows;
  • Trial duration, Inter Trial duration, Csq duration, Matching to Sample Trial -> Sample delay.
  • Visual stimulus presentation (images, videos, animations) and Auditory stimulus will be discussed in another issues (#10).

There is no implementation for high resolution range (10, 2, miliseconds and higher). I imagine the nanoseconds would be very good to EEG experiments. EpikTimer would be very good, but I don know if it will fit mac computers.

Is necessary to evaluate all the stuff and decide what is the best for each occasion.

  • Remove TTimer completely would be a good first step.
  • use a single thread to the Limited Hold Timer;
  • use a single thread to each Schedule Timer;

Escrever posição dos estímulos

  • Na opção de escrever as disposições dos estímulos na tela, quando tento colocar 1 linha e 3 colunas o programa acusa o erro de acess violation (o erro que se der ok corrompe os dados, se der cancel fecha o programa).

Apresentação variável das consequências

Quando a consequência é um arquivo de som (.wav) ela é apresentada. Quando a consequência é arquivo de imagem (.png) não funciona, mesmo se for alterado no arquivo TXT gerado.

Estímulo formato MP4

Oi Rafael,

Utilizei o vídeo no formato MP4 e ele não rodou, ficou apenas um quadrado preto. Em avi ele rodou normalmente.

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.