Introduction to: Python and OpenSesame THE BASICS.

Slides:



Advertisements
Similar presentations
Project 1 ACSM PowerPoint.
Advertisements

Using Microsoft PowerPoint in the Classroom
Getting Started with PowerPoint
Create a Simple Game in Scratch
Create a Simple Game in Scratch
PowerPoint Workshop Presented by Delores Woodhurst.
Developing a PowerPoint Presentation
Computer Basics Hit List of Items to Talk About ● What and when to use left, right, middle, double and triple click? What and when to use left, right,
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Intro to Microsoft PowerPoint 2010 Public Computer Center, Moore Memorial Library, Greene, NY.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
Create your first presentation
Right-click on the colored box and remove it.
A Tutorial by Aaron Price
Microsoft PowerPoint ® 2003 Carl B. Struck Presentation Graphics n Educational, business, sales and other presentations (slide shows) n Combination of.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
ABC’s of PowerPoint (Office 2007) Part 1: Basic Vocabulary Part 2: Cursors Part 3: Insert Your Text Part 4: Insert Your Pictures Part 5: Basic Tools &
Conversational Computers
Microsoft PowerPoint Level One Presented by Merrilee Shopland Media Graphics Specialist Professional Development & Evaluation Programs.
Customizing Your Toolbars in Microsoft Office Lunch and Learn: June 7, 2005.
Get started with PivotTable reports Make your data work for you Imagine an Excel worksheet of sales figures. It lays out thousands of rows of data about.
Power Point EDU 271 Microsoft PowerPoint is a powerful tool to create professional looking presentations and slide shows. PowerPoint allows you to construct.
Key Applications Module Lesson 19 — PowerPoint Essentials
Introduction to TouchDevelop
PowerPoint Basics Tutorial 2: A Slide Show In this tutorial you’re going to create a presentation from scratch. You will have to keep this presentation.
PowerPoint Basics (for Macs) 1. Before you start your project, you need: Completed project storyboard. Files with images, sound, or video already saved.
Microsoft PowerPoint Getting Started Guide Prepared for Towson University Dr. Jeff M. Kenton Amy Chase Martin 2007.
Go to the Roseville City School District Website and pull down the Employees menu. Then click Online Services. Scroll down until you see Global Scholar-
ESL PowerPoint Demonstration The Effective Use of Presentation Software in the ESL Classroom By Daniel Craig University of Illinois ESL 401 J.
> 1 Diagrams in Word Faculty of Health Alan Grace.
© Paradigm Publishing Inc. MICROSOFT WINDOWS XP MAINTAINING FILES AND CUSTOMIZING WINDOWS Section 2.
XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.
A guide to creating a power point display Essentials Ctl M =New Slide: a new slide can be inserted. It is placed after the slide that you are viewing.
1 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb”
Microsoft PowerPoint Tutorial Created by L. George 2006.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
Introduction to Microsoft publisher
PowerPoint Basics Tutorial 1: Objects These tutorials will introduce you to the most basic and useful functions of Microsoft PowerPoint We’re going.
How to Design a Page, Part 2 HOWE/ANDERSON. Step 1: Login   Job No  User ID/ Password.
PowerPoint Practice Exercise 1 1.Save this file in your AV-TECH Folder as PowerPoint Practice Exercise 1. 2.Open this file in PowerPoint. 3.Edit each slide.
An Introduction to Designing, Executing and Sharing Workflows with Taverna Katy Wolstencroft myGrid University of Manchester IMPACT/Taverna Hackathon 2011.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Learning PowerPoint Presenting your ideas as a slide show… …on the computer!
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
PowerPoint Basics Tutorial 2: A Slide Show In this tutorial you’re going to create a presentation from scratch. You will have to keep this presentation.
MICROSOFT WORD PRESENTATION. Word Processing  Software that is designed for the entry, editing, and printing of documents.  Windows Version = Microsoft.
Introduction to: Python and OpenSesame FOR PROS. OpenSesame In OpenSesame you can add Python in-line codes which enables complex experiment. We will go.
Clemson OLLI Presentation Template Instructions Important: Before starting to use this template, print out the following nine instruction pages.
How to Create a Power Point Presentation. Topics that will be covered: 1) Getting Started 2) Common Features 3) Working with Text 4) Working with Graphics.
Today We Will Review: Operating Systems (Windows) (week 3 & 4) Starting up MS Windows Desktop and its contents Functions of the desktop components Brain.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Computer/LMS Access To log onto one of these computers: Enter your Username, for example: 2014BNS099 followed So a complete login.
Chapter 8 Using Document Collaboration, Integration, and Charting Tools Microsoft Word 2013.
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Microsoft Excel.
Presenting Prezi Michael Pelitera
Unit 11 – PowerPoint Interaction
Introduction to TouchDevelop
Go to =>
Introduction to PowerPoint
BUSINESS COMMUNICATION SKILLS PRESENTATION SKILLS OF THESIS & PROJECT
Creating a Simple Game in Scratch
Presentation transcript:

Introduction to: Python and OpenSesame THE BASICS

OpenSesame OpenSesame is an open-source experiment building platform. It is totally free. It has Python in-line integration which enables complex experimental designs. Intro to: Python and OpenSesame2

Looks and Feels Intro to: Python and OpenSesame3 Objects Experiment Sequence Overview Working Window

Our Experiment Intro to: Python and OpenSesame4 We will create two versions of the Posner’s cuing paradigm. 1.Exogenous cue 2.Endogenous cue

Our Experiment – Exogenous Version Intro to: Python and OpenSesame5

Our Experiment – Endogenous Version Intro to: Python and OpenSesame6

Our Experiment Intro to: Python and OpenSesame7 We manipulate these factors: 1.Side of the cue (left / right) 2.Side of the target (left / right) 3.Stimulus onset asynchrony (200, 400, 600, 800 ms). We will start with the exogenous cue

Outline of an experiment Intro to: Python and OpenSesame8 Instruction message Practice Start of experiment message Experiment (x blocks) End of experiment message

Structure of the experiment Intro to: Python and OpenSesame9 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Intro to: Python and OpenSesame10 Create a new experiment let’s create a new experiment We will use the default template

Intro to: Python and OpenSesame11 General Properties Here we define the general properties of our experiment, For example the back-end, resolution, fonts and colors Under the hood

Intro to: Python and OpenSesame12 General Properties We can check under the hood of every object in the experiment and change its properties with script changes. These are not Python scripts, but they are pretty straight-forward and easily manipulated

Sequence Intro to: Python and OpenSesame13 An object that holds other objects in order (you can add conditions for objects). As its name implies, it is launching the objects in a sequence. Our whole experiment is created inside a sequence called experiment

Sequence Intro to: Python and OpenSesame14 Let’s start filling the experiment sequence with the most important thing in the experiment, the instructions

Built-In Objects Intro to: Python and OpenSesame15 OpenSesame has plenty of objects for many specific needs. We will use the commonly used ones for this class.

Sketchpad – Where the magic happens Intro to: Python and OpenSesame16 Tools: like writing, drawing lines and dots, presenting images Canvas – An object which holds what you see on the screen Extra options

Sketchpad – Introduction message Intro to: Python and OpenSesame17 Change name Use a text tool to write instructions

Structure of the experiment Intro to: Python and OpenSesame18 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Do it yourself - Intro to: Python and OpenSesame19 Use sketchpad objects to create: 1.Begin experiment message. 2.End of experiment message. Make sure that their duration is until keypress

Structure of the experiment Intro to: Python and OpenSesame20 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Looping – Experiment loop Intro to: Python and OpenSesame21 We will use a loop object to loop over the block sequence for the amount of blocks needed in our experiment. *[ block = a collection of trials ]

Experiment loop Intro to: Python and OpenSesame22 Change name Create variables

Experiment loop Intro to: Python and OpenSesame23 We will have 3 experimental blocks (which are exactly the same) We will have two variables, block and practice. Note that the blocks should be sequential and not random

Block Sequence Intro to: Python and OpenSesame24 We need a block_sequence. We can drag a sequence object from the menu and place it on the exp_loop. We tell OpenSesame to set the sequence as an item to run for exp_loop

Structure of the experiment Intro to: Python and OpenSesame25 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Inside Block Sequence Intro to: Python and OpenSesame26 block_Sequence should have a trial_loop inside as well as a break message.

Structure of the experiment Intro to: Python and OpenSesame27 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Trial loop is looping over a trial sequence Intro to: Python and OpenSesame28 We will leave the trial_loop information for now Let’s build trial_sequence

Structure of the experiment Intro to: Python and OpenSesame29 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Fixation Point Intro to: Python and OpenSesame30 We can use the rectangle tool and line tool to draw these stimuli Set the duration to 400 (ms) Not good enough.. Some fine tuning are needed.. Let’s check under the hood

Under the hood - Sketchpad Intro to: Python and OpenSesame31 Do it yourself – Change the fixation cross size to be a little bit smaller and broader

Fixation Intro to: Python and OpenSesame32 Much better!

Structure of the experiment Intro to: Python and OpenSesame33 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Feedback? Logging Trial Loop Break SOA

Cue Intro to: Python and OpenSesame34 We can easily copy the script from fixation sketchpad to the cue sketchpad to keep the same design We want either the left or right squares to highlight depending on the condition

Cue Intro to: Python and OpenSesame35 We can use the show if conditions (just like in Python ifs!) to tell OpenSesame when to highlight which square Putting a variable name in squared brackets is OpenSesame’s way of using variables. So [cue] is a variable (not yet defined) which represents the side of the cue (can be right / left) We can also see this information in the script (under the hood)

Structure of the experiment Intro to: Python and OpenSesame36 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Intro to: Python and OpenSesame37 The SOA sketchpad is pretty similar to the fixation sketchpad with a small difference, we can create an unlinked copy of fixation (right-click) and change what we need.

SOA Intro to: Python and OpenSesame38 We need the duration of SOA to vary according to an experiment variable.. We’ll call the variable [SOA].

Structure of the experiment Intro to: Python and OpenSesame39 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Target Intro to: Python and OpenSesame40 Use the fixdot tool in the target sketchpad to draw a target in each of the squares. Use the show if condition to select when to present it (name the variable [target])

Target Intro to: Python and OpenSesame41 Also, set the duration to be 0 This is the opensesame way of making the duration of presentation controlled by the keyboard response

Our Experiment so far; Intro to: Python and OpenSesame42 We’re getting there! This is what you all should see in your programs

Structure of the experiment Intro to: Python and OpenSesame43 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Keyboard response Intro to: Python and OpenSesame44 Define the correct response Define the allowed responses (separated by ;) Timeout (how long to listen to the keyboard) Flush – discard any previous keyboard presses

Keyboard response Intro to: Python and OpenSesame45 The variable [correct_response] is in charge of the correct response in a trial and its already linked to the keyboard object. We set it elsewhere (where all the variables are set). We want the participant to press: ‘q’ if the target is in the left square ‘p’ if the target is in the right square We give the participant 2 seconds to respond.

Structure of the experiment Intro to: Python and OpenSesame46 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Logger tool Intro to: Python and OpenSesame47 Decides which variables to save at every trial For now we will let it save all the variables for us.

Structure of the experiment Intro to: Python and OpenSesame48 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Looping – Trial Loop Intro to: Python and OpenSesame49 Now that we have the trial_sequence out of the way.. Let’s define the trial_loop that represent all the variables we used in the sequence. 1.[cue] 2.[target] 3.[SOA] 4.[correct_response]

trial_loop Intro to: Python and OpenSesame50 We will use the variable wizard to define most of the variables

Loop Variable Wizard Intro to: Python and OpenSesame51 The first row represents the variable names. The rest of the rows represent the categories of the variables

Loop Variable Wizard Intro to: Python and OpenSesame52 The wizard will create all the combination of these three variables for us. 2*2*4 = 16 combinations

trial_loop Intro to: Python and OpenSesame53 We still have to set the [correct_response] variable to be ‘p’ when the target is to the right and ‘q’ when it is left. Sounds like an if statement.. I wish we had Python to do that automatically..

trial_loop Intro to: Python and OpenSesame54

trial_loop Intro to: Python and OpenSesame55 We can set a loop for 4 times in a block And randomly

Structure of the experiment Intro to: Python and OpenSesame56 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Status Intro to: Python and OpenSesame57 The experiment is almost done! We need to make sure the participant understands the instructions and so a practice block is required. Append a new loop after the instructions and call it prac_loop

Practice vs. Experiment Intro to: Python and OpenSesame58 The practice and experiment sequences are pretty much similar. There are some differences: 1.The practice block should have only 1 block 2.A practice block should have only 8 trials and not We need breaks in the experiment blocks but not the practice blocks. We should re-use objects as much as we can to avoid bugs and having to change multiple places.

Prac_loop Intro to: Python and OpenSesame59 Like exp_loop, prac_loop should have two variables, block and practice. And we tell prac_loop to iterate on block_sequence (our pre-defined sequence). This creates a linked copy of block_sequence in prac_loop

Practice vs. Experiment Intro to: Python and OpenSesame60 1.The practice block should have only 1 block 2.A practice block should have only 8 trials and not We need breaks in the experiment blocks but not the practice blocks.

Practice vs. Experiment Intro to: Python and OpenSesame61 So how would we create the other two differences between the sequences?

Breaks! Intro to: Python and OpenSesame62 Inside block_sequence, We can tell OpenSesame to run the break sketchpad only if the [practice] variable is set to no (i.e, in the exp_loop)

Practice vs. Experiment Intro to: Python and OpenSesame63 1.The practice block should have only 1 block 2.A practice block should have only 8 trials and not We need breaks in the experiment blocks but not the practice blocks.

Practice vs. Experiment Intro to: Python and OpenSesame64 We notice that an experiment block has: 64 trials (4 repeats of 16 trials). The practice block should have: 8 trials, or 0.5 repeats of 16 trials. We can create a variable to define our repeats.

Repeating trials Intro to: Python and OpenSesame65 We create a new variable in both exp_loop and prac_loop called repeat_block We set it to 0.5 in the prac_loop and 4 in the exp_loop

Trial_loop Intro to: Python and OpenSesame66 Next, in the trial_loop, we tell the repeat command to take input from the [repeat_block] variable!

Practice vs. Experiment Intro to: Python and OpenSesame67 1.The practice block should have only 1 block 2.A practice block should have only 8 trials and not We need breaks in the experiment blocks but not the practice blocks.

Structure of the experiment Intro to: Python and OpenSesame68 General Properties (Posner’s Cuing Paradigm) Experiment Sequence Instructions (txt)Practice Loop Start Experiment (txt) Experiment Loop End (txt) Block Sequence Trial Sequence FixationCue Target Appearance Keyboard Response Logging Trial Loop Break SOA

Time for a test drive! Intro to: Python and OpenSesame69 Save the experiment and run it using this key: Seems to run pretty too fast and the target doesn’t disappear after you press the keyboard.. We better add another sketchpad at the beginning of trial_sequence. Call it blank and set the duration for 1000 ms.

Log file Intro to: Python and OpenSesame70 OpenSesame saves the experiment log in.csv files (comma separated values). These can be easily opened with Microsoft Excel But they are pretty big if we ask OpenSesame to save all the variables from the experiment.

OpenSesame Logging Intro to: Python and OpenSesame71 We can tell opensesame which variables are important to us in the logger tool. [Although, I recommend logging everything in the beginning until you know what are the relevant variables, better to work harder on pre- processing than re-running the experiment]

Log file Intro to: Python and OpenSesame72 We can scroll and choose manually… Or use the script to log the variables we are interested in

OpenSesame Experiment Files Intro to: Python and OpenSesame73 When saving an opensesame project, we can save it in a couple of ways: Re-save our experiment in an OpenSesame files type and call it PosnersCueingParadigm_endo Just the experiment The experiment with the files (e.g., pictures)

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame74 To create the endogenous cue version of the task, we’ll need arrow stimuli. One easy one of getting these pictures is from PowerPoint. Create a white arrow and save it as a.png file.

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame75 We should create two arrows left.png right.png We’ll add these two files to the experiment’s file pool Make sure these arrows are pretty small

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame76 To alter our experiment, we just need some minor modifications to the cue sketchpad.

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame77 First, we remove the highlighted squares and fixation cross (use the sketchpad script)

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame78 Next, place one of the arrows in the middle Use the draw image element

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame79 We want a left arrow to appear when [cue] is left and a right arrow when [cue] is right…

Posner’s Cueing paradigm – endogenous cue Intro to: Python and OpenSesame80

Testing our work Intro to: Python and OpenSesame81 We are done! Let’s test our work