GithubHelp home page GithubHelp logo

gufett0 / landmark-experiment Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 31 KB

A classic behavioural task to measure visuospatial bias in human subjects.

License: MIT License

MATLAB 100.00%
matlab-functions psychology-experiments psychtoolbox

landmark-experiment's Introduction

Landmark task

The following is a Matlab/Octave program of a classic behavioural task that I made for a research project about visuospatial bias in human subjects. This was utilized in a pilot experiment conducted during summer 2021 at this lab in Brescia, Italy.

This work helped me improve my coding and debugging skills for high efficiency and milliseconds timing precision.

Brief background notes

The aim of this task is to evaluate the degree of bias while making a judgment on the length of two segments in a line bisected at different shift points. The following is a graphical representation of the task sequence in one trial: the lines will stay on screen for a brief moment after which participants will give a response within a limited interval.

taskprocedure

Before starting the task, participants will be instructed like this: "Welcome! Depending on the instruction that will appear on screen, you'll have to indicate which side of the line, compared to the center, is either shorter or longer. Use the right or left keys accordingly to give your response"

Correct responses will be collected for each bisection shift and a point of subjective equality (PSE) will be computed to quantify the tendency in making biased perceptual judgement either to the left (negative values) or to the right (positive values). Below is an example of data collected from a subject with a leftward bias:

testsubj

Requirements

Matlab 2019b/Octave GNU and Psychophysics Toolbox Version 3 (PTB-3) (instruction for download here)

Customized functions:

VisAng.m to calculate the pixels per degree or degrees per pixel

frames_Brescia.m to optimize stimuli presentation timing

display_question.m to print instructions on screen

draw_pnline.m to draw the horizontal bisected line

How to run the program

Open the LandmarkTask.m file in the editor. If you haven't already set the current Matlab search path do so by typing in the command window

addpath 'C:\Users\AddYourOwnPath'; 

This is also where the three output files will be saved (.mat, _log.txt, _timing.txt), unless you specify otherwise.

If you want to modify the parameters of the task you can change any field of these structure variables (check comments in the code to learn about these):

Design = struct('llength_deg', 20, 'shifts', [], 'range_percent', [], 'shifts_rep', []);
Setting = struct( 'res', [1920 1080], 'sz', [51 28.8], 'vdist', 56, 'fontSize', 38); 
Timing = struct('stim_dur', 0.15, 'iti_dur', 2, 'fix_range', [2 2.5]);

Now run the file. The command window will ask you which instruciton order you want to start with: "Which side is longer" and then "Which side is shorter" (option 12) or viceversa (option 21)

Instruction code  (12 | 21) :

Now you are ready to get familiar with the task. Follow the instruction

Lets do some PRACTICE!
(press enter to start)

If you haven't installed Psychtoolbox the program will stop at this point. The pracrice task will call the MyLandPractice.m function, virtually identical to the following main task function MyLandmark.m, except for some design parameters.

Once MyLandmark.m gets called the command window will ask you to provide a name for the output files

Enter Subject id: 

If the file name already exists it'll output a warning and ask you to overwrite. The whole task sequence is set to run for two blocks so as to cover both instructions.

landmark-experiment's People

Contributors

gufett0 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

nian-jingqing

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.