+ All Categories
Home > Documents > PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27...

PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27...

Date post: 15-Sep-2020
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
52
Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL)............................................................................................................3 1.1 License.................................................................................................................................................................................................3 1.2 Installation...........................................................................................................................................................................................5 1.3 Structure of the template scripts..........................................................................................................................................................5 2. Experiment files....................................................................................................................................................................................7 3. Scenario file...........................................................................................................................................................................................9 3.1 Scenario header...................................................................................................................................................................................9 3.2 Scenario objects definitions...............................................................................................................................................................14 4. Header file...........................................................................................................................................................................................17 4.1 Stimulus items...................................................................................................................................................................................19 4.1.1 PracticeItems..................................................................................................................................................................................19 4.1.2 Stimulus items: Items, ItemsBlock.................................................................................................................................................21 4.2 Global variables.................................................................................................................................................................................22 4.3 Instructions........................................................................................................................................................................................28 4.4 Stimulus timing.................................................................................................................................................................................29 4.5 Pre-stimulus period............................................................................................................................................................................30 4.6 Stimulus period..................................................................................................................................................................................30 4.7 Inter-item period................................................................................................................................................................................31 1
Transcript
Page 1: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

PCP Manual Project

Content

1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL)............................................................................................................31.1 License.................................................................................................................................................................................................31.2 Installation...........................................................................................................................................................................................51.3 Structure of the template scripts..........................................................................................................................................................52. Experiment files....................................................................................................................................................................................73. Scenario file...........................................................................................................................................................................................93.1 Scenario header...................................................................................................................................................................................93.2 Scenario objects definitions...............................................................................................................................................................144. Header file...........................................................................................................................................................................................174.1 Stimulus items...................................................................................................................................................................................194.1.1 PracticeItems..................................................................................................................................................................................194.1.2 Stimulus items: Items, ItemsBlock.................................................................................................................................................214.2 Global variables.................................................................................................................................................................................224.3 Instructions........................................................................................................................................................................................284.4 Stimulus timing.................................................................................................................................................................................294.5 Pre-stimulus period............................................................................................................................................................................304.6 Stimulus period..................................................................................................................................................................................304.7 Inter-item period................................................................................................................................................................................31

1

Page 2: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4.8 Post-stimulus period..........................................................................................................................................................................314.9 Response period................................................................................................................................................................................324.10 Inter-trial period..............................................................................................................................................................................334.11 Pause period....................................................................................................................................................................................334.12 End of presentation block period.....................................................................................................................................................344.13 End of experiment period................................................................................................................................................................344.14 Questionnaire parameters................................................................................................................................................................344.15 Bitmap parameters...........................................................................................................................................................................354.16 Sound parameters............................................................................................................................................................................354.17 Selection response parameters.........................................................................................................................................................354.18 Keyboard input response parameters..............................................................................................................................................364.19 Fixation bar parameters...................................................................................................................................................................365. Function library...................................................................................................................................................................................385.1 SHOWFILE.......................................................................................................................................................................................395.2 DUMMYFMRI.................................................................................................................................................................................395.3 SETRESPONSE................................................................................................................................................................................405.4 PRESENTTRIAL..............................................................................................................................................................................405.5 RUNEXPERIMENT.........................................................................................................................................................................415.6 RUNQUESTIONNAIRE..................................................................................................................................................................415.7 LOGDATA........................................................................................................................................................................................425.8 TRIALORDERRANDOMIZATION................................................................................................................................................425.9 LOADBITMAP.................................................................................................................................................................................43

2

Page 3: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

5.10 PRESENTBITMAP.........................................................................................................................................................................435.11 LOADSOUND................................................................................................................................................................................445.12 PRESENTSOUND..........................................................................................................................................................................445.13 PRESENTITEM..............................................................................................................................................................................455.14 GETKEYBOARDINPUT...............................................................................................................................................................465.15 GETMOUSEINPUT.......................................................................................................................................................................466. Experiment Lego.................................................................................................................................................................................486.1 SAVE LOG.......................................................................................................................................................................................486.2 LOAD/UNLOAD BITMAP FILES..................................................................................................................................................486.3 SYNCHRONIZE WITH SCANNER AND COLLECT DUMMY SCANS....................................................................................496.4 PRESENT TRIAL (WITH FIXED DURATION, OR AWAIT ANY RESPONSE, OR AWAIT CORRECT RESPONSE).........496.5 PRESENT INSTRUCTIONS............................................................................................................................................................496.6 RUN PRACTICE EXPERIMENT ITEMS.......................................................................................................................................506.7 RUN MAIN EXPERIMENT ITEMS................................................................................................................................................506.8 END OF EXPERIMENT..................................................................................................................................................................516.9 RUN QUESTIONNAIRE.................................................................................................................................................................517. Example experiment............................................................................................................................................................................52

1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL)

1.1 License

3

Page 4: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

The PCP-SPL (Pipeline Code Project - Stimulus Presentation Lab) is a package for timely stimulus presentation and response logging. It is

provided 'as is' and available to the scientific community as free but copyright software (www.gnu.org/copyleft) under the terms of the

GNU General Public Licence. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without

even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public

License for more details. PCP runs on the Presentation Software (www.neurobs.com). The latest release of PCP-SPL can be downloaded

from http://forkstam.se/upload/PCP.zip.

PCP-SPL is developed by Christian Forkstam affiliated to:

• Cognitive Neurophysiology Group, Stockholm Brain Institute, Karolinska institute, Sweden.

• Max-Plank Institute for Psycholinguistics, the Netherlands.

• FC Donders Centre for Cognitive Neuroimaging, the Netherlands.

• University of Algarve, Portugal.

To contribute to the development of the code please indicate any problem thoroughly to simplify updates of the code. Indicate in the

accompanying file 'Updates.log' any modifications of the code, your name and date, and send a zipped set of your experiment files to

christian attsign forkstam dot se.

Copyright (C) 2007-2008, Christian Forkstam

4

Page 5: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

1.2 Installation

This code release for experiment presentation consists of control functions and scripts written for the commercial software Presentation

(www.neurobs.com). The latest release of PCP-SPL can be downloaded from http://forkstam.se/PCP/. (An unsupported early version of the

Presentation software can be found at http://forkstam.se/PCP/Presdl071092403.exe). Unzip and install.

1.3 Structure of the template scripts

Function names are coded in small letters. References to function names are coded in CAPITALS. Variables and presentation objects are

coded in ThisWay.

The template set of experiment files include the following files:

• Experiment files: $Experiment-Template / PCP-Experiment-1Key-Template.exp

$Experiment-Template / PCP-Experiment-2Key-Template.exp

$Experiment-Template / PCP-Experiment-3Key-Template.exp

$Experiment-Template / PCP-Experiment-30Key-Template.exp

• Scenario file: $Experiment-Template / Files / PCP-Scenario-Template.sce

• Header file: $Experiment-Template / Files / PCP-Header-Template.pcl

5

Page 6: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

• Stimuli material file: $Experiment-Template / Files / PCP-PracticeItems-Template.pcl

$Experiment-Template / Files / PCP-Items-Template.pcl

$Experiment-Template / Files / PCP-ItemsBlock-Template.pcl

• Instruction file: $Experiment-Template / Files / PCP-Instruction-Template.txt

• Questionair files: $Experiment-Template / Files / PCP-Question1-Template.txt

$Experiment-Template / Files / PCP-Question2-Template.txt

6

Page 7: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

2. Experiment files

NB! The experiment .exp-files gets corrupted when transferred between different language specific OS (and sometimes also between

different Presentation versions). Remember to check!

The experiment file response button setups are:

PCP-Experiment-1Key-Template.exp

• Button 1 = Left mouse button

PCP-Experiment-2Key-Template.exp

• Button 1 = Left shift button

• Button 2 = Right shift button

PCP-Experiment-3Key-Template.exp

• Button 1 = Left shift button

• Button 2 = Right shift button

• Button 3 = Space E.g. optional as key for experiment leader response

PCP-Experiment-30Key-Template.exp

7

Page 8: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

• Button 1 = Left shift button

• Button 2 = Right shift button

• Buttons {3:28} = {A,B,...,Z}

• Button 29 = Space Defined as key to erase subject keyboard input in function GETKEYBOARDINPUT

• Button 30 = Enter Defined as key to finish subject keyboard input in function GETKEYBOARDINPUT

8

Page 9: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

3. Scenario file

3.1 Scenario header

The Scenario file include a header and a Presentation objects definition part.

The general purpose with the header is to define experiment settings, such as file name of associated .pcl-Header file, response button

codes, FMRI pulse information for FMRI experiment and FMRI testing, and sending output port code.

The objects definition part includes several Presentation object definitions for various object types:

9

Page 10: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

PCP-Scenario-Template.pcl

################################################################ # HEADER ################################################################ scenario = "PCP-TemplateExperiment"; # Name of scenario (for logfile use) pcl_file = "PCP-Header-Template.pcl"; # Name of accompanying pcl-file # active_buttons = 3; # Number of response keys: {1|2|3|30} button_codes = 1,2,9; # Code for response keys: {1|1,2|1,2,9|1:30} #button_codes = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30; target_button_codes = 3,4,9; # Code for response with the CORRECT key {3|3,4|3,4,9|1:30} # $Black = "0,0,0"; # Black colour $White = "255,255,255"; # White colour $Red = "255,0,0"; # Red colour $SoundAttenuation = 0.7; # Sound level attenuation $NumSoundFiles = 0; # Number of sound files $NumBitmapFiles = 0; # Number of bitmap files # default_monitor_sounds = false; # Default setting to monitor sounds # $Size = 20; # default_font_size = 30; # Default font size default_font = "Tahoma"; # Default font default_background_color = $White; # Default background colour font (default = white) default_text_color = $Black; # Default font colour (default = black) screen_height = 768; # Screen height (pixels) screen_width = 1024; # Screen width (pixels) screen_bit_depth = 16; # Colour depth (pixels) # scenario_type = trials; # --- {trials|fMRI_emulation|fMRI} scan_period = 2600; #|FMRI- TR (ms) pulses_per_scan = 1; #|mode Number of pulses per scan pulse_code = 15; # --- FMRI pulse code # default_output_port = 1; # Default output port pulse_width = 20; # Pulse width (ms) write_codes = true; # Send codes through output port # begin; # End of header

10

Page 11: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Change associated Header file:

pcl_file = "PCP-Header-EXPERIMENT.pcl";

Change button settings:

for PCP-Experiment-1Key-Template.exp:

active_buttons = 1; # Use 1 active button button_codes = 1; # Response code 1 = Wrong button 1 response target_button_codes = 3; # Response code 3 = Correct button 1 response

for PCP-Experiment-2Key-Template.exp:

active_buttons = 2; # Use 2 active button button_codes = 1,2; # Response code {1,2} = Wrong button {1,2} response target_button_codes = 3,4; # Response code {3,4} = Correct button {1,2} response

for PCP-Experiment-30Key-Template.exp:

active_buttons = 30; # Use 30 active button button_codes = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30; target_button_codes = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30; # Response code {1:30} = Both wrong and correct button {1:30} response

11

Page 12: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Change sound level attenuation to 30% during sound presentation:

$SoundAttenuation = 0.3;

Change number of sound files to 10 files during sound presentation:

$NumSoundFiles = 10;

Change number of bitmap files to 10 files during bitmap presentation:

$NumBitmapFiles = 10;

Change to FMRI experiment presentation:

scenario_type = fMRI;

Change to test (e.i. emulate scanner pulse) FMRI experiment presentation:

12

Page 13: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

scenario_type = fMRI_emulation;

Change to 10 pulses per scan during FMRI experiment presentation:

pulses_per_scan = 10;

Change to scanner pulse code 10 during FMRI experiment presentation:

pulse_code = 10;

Change to not send codes through parallel port:

write_codes = false;

13

Page 14: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

3.2 Scenario objects definitions

PCP-Scenario-Template.pcl

################################################################ # OBJECTS DEFINITIONS ################################################################

Create trial object Trial with stimulus event object StimulusEvent and picture object Picture.

#---Trial, StimulusEvent, and Picture objects------------------# --- picture { } default; #|Picture object default trial { stimulus_event { picture { #|Template trial Trial } Picture; #|Picture object Picture } StimulusEvent; #|StimulusEvent object StimulusEvent } Trial; #|Trial object Trial

Create text object array Texts with 15 text objects.

#---Text objects array-----------------------------------------# --- array { #|Text objects LOOP $i 15; #|Loop over text objects $k = '$i + 1'; #| text { caption = " "; }; #|Text object ENDLOOP; #|End loop } Texts; #|Texts array name

14

Page 15: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Create box object array Boxs with 5 box objects.

#---Box objects array------------------------------------------# --- text { caption = " "; } Bar; #|Text object Bar array { #|Box objects LOOP $i 5; #|Loop over text objects $k = '$i + 1'; #| box { height = 1; width = 1; }; #|Box object ENDLOOP; #|End loop } Boxs; #|Boxs array name

Create bitmap object array Bitmaps with $NumBitmapFiles box objects.

#---Bitmap objects array---------------------------------------# --- array { #|Picture bitmap(s) LOOP $i $NumBitmapFiles; #|Loop over bitmapfile(s) $k = '$i + 1'; #| bitmap { #| preload = false; #|Preload bitmap in memory filename = "P$k.bmp"; #|Bitmap file name }; #| ENDLOOP; #|End loop } Bitmaps; #|Bitmap array name

Create sound object array Sounds with $NumSoundFiles sound objects:

15

Page 16: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

#---Sound objects array----------------------------------------# --- array { #|Sound wavefile(s) LOOP $i $NumSoundFiles; #|Loop over soundfile(s) $k = '$i + 1'; #|Update sound { #| wavefile { #| preload = false; #|Preload wavefile in memory filename = "S$k.wav"; #|Wavefile file name }; #| attenuation = $SoundAttenuation; #| }; #| ENDLOOP; #|End loop } Sounds; #|Sound array name

Create trial object StopSoundTrial.

#---StopSoundTrial object--------------------------------------# --- trial { #|Stop sound presentation trial monitor_sounds = true; #|Monitor sounds trial_duration = 1; #|Durate for 1 ms } StopSoundTrial; #|

Create trial object StopVideoTrial.

#---StopVideoTrial object--------------------------------------# --- trial { #|Stop video presentation trial monitor_videos = true; #|Monitor video trial_duration = 1; #|Durate for 1 ms } StopVideoTrial; #|

16

Page 17: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4. Header file

The header file include several sub parts. Its general purpose is to define trial timing to present the stimulus. Each trial is composed of

several subtrials periods, defined by the following trial time bins:

Trial name Screen Duration (ms) Time (ms)

BEGIN TRIAL 0

Pre-Stimulus Period + 1000 ms 1000

Stimulus (1) Period XYZ (3000 ms)

- Sub-Stimulus 1 X 600 ms (300 ms on + 300 ms off)

1600

- Sub-Stimulus 2 Y 600 ms (300 ms on + 300 ms off)

2200

- Sub-Stimulus 3 Z 600 ms (300 ms on + 300 ms off)

2800

Inter-Stimulus Period

+ 3000 ms 5800

Stimulus (2) Period XYZ (3000 ms)

- Sub-Stimulus 1 X 600 ms (300 ms on + 300 ms off)

6400

- Sub-Stimulus 2 Y 600 ms (300 ms on + 300 ms off)

7000

17

Page 18: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

- Sub-Stimulus 3 Z 600 ms (300 ms on + 300 ms off)

7600

Post-Stimulus Period + 1000 ms 8600

Response Period Response 2000 ms 10600

Inter-Trial Period + 4000 ms 14600

NEXT TRIAL

18

Page 19: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4.1 Stimulus items

4.1.1 PracticeItems

In PCP-Header-Template.pcl:

include "PCP-PracticeItems-Template.pcl"; # Get practice items

Example of practice items in sentence presentation.

In PCP-PracticeItems-Template.pcl

# 1. ITEM TYPE | 2. ITEM CODE | 3. CORRECT RESPONSE BUTTON | 4. NUMBER OF SUBITEMS | 5. SUBITEM1 | 6. SUBITEM2 | ... # PRACTICE CLASSIFICATION SENTENCES (KEY 1 = NOT ACCEPT; KEY 2 = ACCEPT) array<string> PracticeItems[1][12] = { {"STARTERLEFT", "XXXXXXXXXXXXXXXXXXXXXXXX", "1", "8", "This", "is", "a", "template", "starter", "sentence,", "press", "left." } };

The columns include specific information for each item to be presented:

19

Page 20: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

1. ITEM TYPE is saved in the logfile and should be unique for each item

2. ITEM CODE is the numeric code to be sent over the port for an external marker timing log (e.g. the EEG recording computer). It

is divided in equally many triplets as subitems (e.g. code 001 = port code 1, 010 = 10, and 100 = 100, see below)

3. CORRECT RESPONSE BUTTON is the button code for correct response (e.g. key 1 corresponds to the first input device as

defined in PCP experiment file

4. NUMBER OF SUBITEMS is the number of subitems in complete item (e.g. words in sentence)

5. SUBITEM1, SUBITEM2, … is the subitem 1, 2, ... in complete item (e.g. word 1, 2, ... in sentence), or as in the case of picture

and sound presentation, the file name reference to the bitmap or sound to be presented.

6. The string array is filled with empty strings to fill up the equal numbers of columns per row in the array.

Example of code translations for trial items

Code Translation Example Guide Sentences: A = Correct sentence First = 010, Target = 011, Other = 012, Last = 013 B = Sentence with local semantic violation First = 020, Target = 021, Other = 022, Last = 023 C = Sentence with local syntactic violation First = 030, Target = 031, Other = 032, Last = 033 D = Sentence with global semantic violations First = 040, Target = 041, Other = 042, Last = 043 E = Sentence with global syntactic violation First = 050, Target = 051, Other = 052, Last = 053

20

Page 21: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4.1.2 Stimulus items: Items, ItemsBlock

PCP-Header-Template.pcl

include "PCP-Items-Template.pcl"; # Get trial items include "PCP-ItemsBlock-Template.pcl"; # Get trial items in block

Example of items in sentence presentation.

In PCP-Items-Template.pcl

# 1. ITEM TYPE | 2. ITEM CODE | 3. CORRECT RESPONSE BUTTON | 4. NUMBER OF SUBITEMS | 5. SUBITEM1 | 6. SUBITEM2 | ... # CLASSIFICATION SENTENCES (KEY 1 = NOT ACCEPT; KEY 2 = ACCEPT) array<string> Items[2][13] = { { "T1001A" , "010012012012012012011XXX", "2", "8", "The", "girl" , "spread", "the", "bread@500", "with@", "butter.@" , " @999¤999" }, { "@100009", "040042042042042042041" , "1", "7", "The", "robot", "spread", "the", "bread" , "with" , "socks.¤999", " " } };

PCP-ItemsBlock-Template.pcl

21

Page 22: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

# 1. ITEM TYPE | 2. ITEM CODE | 3. CORRECT RESPONSE BUTTON | 4. NUMBER OF SUBITEMS | 5. SUBITEM1 | 6. SUBITEM2 | ... # CLASSIFICATION SENTENCES (KEY 1 = NOT ACCEPT; KEY 2 = ACCEPT) array<string> ItemsBlock[2][13][2] = { { # Block1 {"T1001A" ,"010012012012012012011XXX","2","8","The","girl" ,"spread","the","bread@500","with@","butter.@" ," @999¤999"," "}, {"@100009","040042042042042042041" ,"1","7","The","robot","spread","the","bread" ,"with" ,"socks.¤999"," " ," "} }, { # Block2, Block3, ..., BlockN {"T2001A" ,"010012012012012012011XXX","2","8","The","girl" ,"spread","the","bread@500","with@","butter.@" ," @999¤999"," "}, {"@200009","040042042042042042041" ,"1","7","The","robot","spread","the","bread" ,"with" ,"socks.¤999"," " ," "} } };

Note that Items has to be defined and is equivalent to one block in ItemsBlock.

4.2 Global variables

Global variables to be used throughout the experiment.

Use template header for multiple experiment common setting, stored e.g. in PCP-Header-Template.pcl, and keep individual setting in

secondary header files, e.g. PCP-Header-Experiment1.pcl, PCP-Header-Experiment2.pcl, ...

22

Page 23: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

In PCP-Header-Template.pcl

#---GLOBAL WORKSPACE VARIABLES---------------------------------# string LogFile = "Logfile.res"; # Specific logfile file name bool SplitItemStructure = true; # Test items structure split in sub items {true|false} string Modality = "Visual"; # Presentation modality {"Visual"|"Auditory"|"VisualAuditory"|"Bitmaps"} string ItemPresentation = "Sequential"; # Item presentation mode {"Sequential"|"Complete"} bool SendCode = true; # Send port code {true|false}. NB!! write_code must be true in Scenario! bool ContinuousSound = false; # Play sound continuously in VisualAuditory Modality {true|false} bool ComparativeStimPres = false; # Present two stimulus in comparative design {true|false} bool VariableStimDur = true; # Variable stimulus presentation duration {true|false} string RandomizeTrialOrder = "No"; # Randomized trial order {"All"|"Block"|"No"} bool FixationBars = false; # Show centred fixation bars during presentation {true|false} bool AddPoint = false; # Add point after last sentence item {true|false} int NumItemsPres = 1; # Number of presentations of each test item int NumItemsBlocks = 1; # Number of presentation blocks (evenly dividable with full trial set) bool AwaitResponse = false; # Forced await response {true|false} string ResponseType = "FixedDuration"; # {"FixedDuration"|"FirstResponse"|"CorrectResponse"|"Retype"|"Selection"} bool SelfPaced = false; # Wait for subject response (true) OR inter-trial period (false) bool FeedbackTrialProgress = true; # Show progress feedback during self paced pause {true|false} bool DoQuestionnaire = true; # Perform online questionnaire {true|false}

In PCP-Header-Experiment1.pcl

... #---GET TEMPLATE HEADER----------------------------------------# include "PCP-Header-Template.pcl"; # Include Header file ... # Switch to complete item presentation string ItemPresentation = "Complete";.. # Item presentation mode {"Sequential"|"Complete"} ...

23

Page 24: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Explanation of Global variables:

• LogFile Specific logfile file name (e.g. "Logfile.res"). This is an additional log file to the ordinary Presentation

log file.

• SplitItemStructure Test items structure split in sub items. Only functional for ItemPresentation = "Sequential".

= true Present each subitem (in their full length) in a sequential subitem-by-subitem fashion

= false Present the first subitem in a sequential letter-by-letter fashion

• Modality: Presentation modality

= "Visual" Present trial text specified in the trial items array.

= "Auditory" Present the sound file as specified in the trial item array. The sound must be part of the sound alphabet

(see SoundAlphabet).

= "VisualAuditory" Same as "Visual" but will also present a sound file specified in the sound alphabet (see

SoundAlphabet and ContinuousSound).

= "Bitmaps" Present the bitmap picture as specified with a file number in the trial items array.

• ItemPresentation Item presentation mode

= "Sequential" Present each item as a sequence of sub items, e.g. as a sentence word-by-word or a word letter-by-letter.

24

Page 25: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

= "Complete" Present the items in their full length, e.g. complete word presentation.

• SendCode Send port code over output port. NB, write_code must be set as true in the Scenario-file!

• = true Translate and send the subitem code over the output port

• = false Don't send port code.

• ContinuousSound Play continuous sound over subsequent trials (see SoundAlphabet). Only functional for Modality =

"VisualAuditory".

= true Play continuous sound that last over the complete sound file length, and over subsequent files

depending on the length of the sound file. The sound played is picked from the first entry in the sound alphabet (see

SoundAlphabet).

= false Play sound that only last over the trial independent of the length of the sound file. The sounds played

are picked from the sound alphabet in a randomized order (see SoundAlphabet).

• ComparativeStimPres Double stimulus presentations, e.g. for comparative designs such as "Is the first and the second item the

same or different?".

= true Present a first item (from position 5 of the trial item array) followed by a second item (from position 6).

= false Only present the item in position 5 of the trial item array.

• VariableStimDur Use variable stimulus presentation duration as defined in VarStimDur (see Stimulus Period). Only

25

Page 26: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

functional for SplitItemStructure = true.

= true Use variable stimulus presentation duration.

= false Do not use variable stimulus presentation duration.

• RandomizeTrialOrder Randomized trial order.

= "All" Randomize trials over complete trial items array.

= "Block" Randomize trials block-wise over the trial items array.

= "No" No randomization.

• FixationBars Centred fixation bars during presentation (see Fixation Bar Parameters)

= true Show fixation bars.

= false Do not show fixation bars.

• AddPoint Add point after last sentence item.

= true Add point.

= false Do no add point.

• NumItemsPres Number of presentations of trial items in trial items array.

26

Page 27: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

= 1 Present trial items ones.

= 2, ..., N Present trial items 2, ..., N times.

• NumItemsBlocks Number of presentation blocks of the trial items array. Must be evenly dividable with full trial set, i.e.

number of trial items * number of presentation blocks (NumItemPres).

• AwaitResponse Forced await response during the response period before continuing with next trial.

= true Await response.

= false Continue independent of response.

• ResponseType Response key or response type.

= "FixedDuration" Keep fixed duration independent of response.

= "FirstResponse" Wait for first response.

= "CorrectResponse" Wait for correct response.

= "Retype" Get keyboard input (works with the button keys ordered as {left, right, A-Z, space, enter}, see PCP-

Experiment-30Keys-Template.exp.

= "Selection" Get mouse selection input (works with the first button keys as mouse button, see PCP-Experiment-

1Keys-Template.exp.

27

Page 28: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

• SelfPaced Self paced subject response

= true Wait for subject response before continue to the next trial

= false Do not wait for subject response but execute instead inter-trial interval.

• FeedbackTrialProgress Show trial number progress feedback during self paced pause. Only functional with SelfPaced = true.

= true Show trial number progress feedback.

= false Do not show feedback.

• DoQuestionnaire Perform online questionnaire from the files specified in QuestionnaireFileName.

= true Perform online questionnaire

= false Do not perform questionnaire.

• PreLoadedBitmaps Bitmap objects preloaded in scenario.

= true Bitmap objects are preloaded in scenario.

= false Bitmap objects are not preloaded in scenario.

4.3 Instructions

28

Page 29: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Update instructions to be presented throughout the experiment.

PCP-Header-Template.pcl

#---INSTRUCTIONS-----------------------------------------------# array<string> Instrs[9] = { # Instrs "Press a button for sequence " , # 1: Pause text 1 "\nwhen you are ready to continue." , # 2: Pause text 2 "Pause...\nPress a button when you are ready to continue.", # 3: Pause text 3 "Press left to continue." , # 4: Left to continue "Press right to accept." , # 5: Right to accept "Start experiment!" , # 6: Start experiment! "Retype the sequence." , # 7: Response instruction "End of experiment block." , # 8: End of experiment block "End of experiment." , # 9: End of experiment }; #

4.4 Stimulus timing

As described earlier, the main trial period is divided into several trial sub-periods. Information on sub-trial period lengths as well as

information on actual screen presentations are defined for each period.

29

Page 30: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4.5 Pre-stimulus period

Pre-stimulus period before stimulus presentation.

#---PRE-STIMULUS PERIOD----------------------------------------# int PreStimDur = 1000; # Pre-stimulus duration time (ms) string PreStimMarker = Cross; # Pre-stimulus marker int PreStimFontSize = CrossFontSize; # Pre-stimulus marker font size (typically 20) int PreStimPos = CrossPos; # Pre-stimulus marker position (typically 15) string PreStimCode = "201"; # Pre-stimulus code

Present a fixation cross for 1000 ms in center position, send log 201 over port, and write Pre in log file.

4.6 Stimulus period

Stimulus presentation period.

30

Page 31: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

#---STIMULUS PERIOD--------------------------------------------# int StimDur = 300; # Stimulus duration time (ms) int InterStimDur = 300; # Inter-stimulus duration time (ms) # !NB. Sound stimuli longer than StimDur+InterStimDur ms # might be clipped! int StimFontSize = 30; # Stimulus font size (typically {30,60}) int StimPos = 0; # Stimulus position (typically 20) # For Variable Stimulus Duration (VariableStimDur) == true # array<string> VarStimDur[7][2] = { # Variable stimulus duration times (ms) {"Base" ,"187"}, # Base stimulus duration time (ms) {"Target" ,"350"}, # Target letter(s) stimulus duration time (ms) {"PerLetter","27" }, # Per letter stimulus duration time (ms) {"MaxLength","10" }, # Max word length (letters) {"Max" ,"450"}, # Max word length stimulus duration time (ms) {"PerComma" ,"200"}, # Per comma stimulus duration time (ms) {"PerPoint" ,"293"}}; # Per point stimulus duration time (ms)

4.7 Inter-item period

Inter-item period between first and second item presentation during ComparativeStimPres = true.

#---INTER-ITEM PERIOD------------------------------------------# int InterItemDur = 0; # Inter-item duration time (ms) for acquisition-classify string InterItemMarker = Cross; # Inter-item marker int InterItemFontSize = CrossFontSize; # Inter-item marker font size int InterItemPos = CrossPos; # Inter-item marker position string InterItemCode = "202"; # Inter-item code

4.8 Post-stimulus period

31

Page 32: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Post-stimulus period after stimulus presentation with possibility to jitter time between:

PostStimDur – PostStimJitter < Post-stimulus period < PostStimDur + PostStimJitter

#---POST-STIMULUS PERIOD---------------------------------------# int PostStimDur = 1000; # Post-stimulus duration time (ms) int PostStimJitter = 500; # Post-stimulus duration time jitter (ms) string PostStimMarker = " "; # Post-stimulus marker int PostStimFontSize = CrossFontSize; # Post-stimulus marker font size int PostStimPos = CrossPos; # Post-stimulus marker position string PostStimCode = "203"; # Post-stimulus code

4.9 Response period

Response period with possibility to add instructions for response (see ResponseMarker and RespInstr).

#---RESPONSE PERIOD--------------------------------------------# int ResponseDur = 2000; # Response duration time (ms) string ResponseMarker = Cross; # Response marker # "Different? Same?" # Different? Same? # "Not pleasent? Pleasent?" # Not pleasent? Pleasent? # "Non-grammatical? Grammatical?" # Non-grammatical? Grammatical? # "Incorrect? Correct?" # Incorrect? Correct? int ResponseFontSize = CrossFontSize; # Response marker font size int ResponsePos = CrossPos; # Response marker position string ResponseCode = "204"; # Response code #---RESPONSE INSTRUCTION (OPTIONAL)----------------------------# string RespInstr = Instrs[7]; # Response instruction int RespInstrFontSize = PeriodFontSize; # Response instruction font size int RespInstrPos = 150; # Response instruction position

32

Page 33: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4.10 Inter-trial period

Inter-trial period between trials with possibility to jitter time between:

InterTrialDur – InterTrialJitter < Inter-trial period < InterTrialDur + InterTrialJitter

#---INTER-TRIAL PERIOD-----------------------------------------# int InterTrialDur = 1000; # Inter trial duration time (ms) int InterTrialJitter = 250; # Inter trial duration time jitter (ms) string InterTrialMarker = Asterix; # Inter-trial marker int InterTrialFontSize = AsterixFontSize; # Inter-trial marker font size int InterTrialPos = AsterixPos; # Inter-trial marker position string InterTrialCode = "205"; # Inter-trial code

4.11 Pause period

#---PAUSE PERIOD-----------------------------------------------# string PauseMarker = Instrs[3]; # Pause marker (see Instrs) int PausePos = RespInstrPos; # Pause marker position int PauseFontSize = PeriodFontSize; # Pause marker font size string PauseCode = "206"; # Pause code

33

Page 34: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

4.12 End of presentation block period

#---END OF EXPERIMENT BLOCK PERIOD-----------------------------# int EndBlockDur = 0; # End-of-experiment-block display duration time (ms) string EndBlockMarker = Instrs[8]; # End-of-experiment-block marker int EndBlockPos = PeriodPos; # End-of-experiment-block marker position int EndBlockFontSize = PeriodFontSize; # End-of-experiment-block marker font size string EndBlockCode = "207"; # End-of-experiment-block code

4.13 End of experiment period

#---END OF EXPERIMENT PERIOD-----------------------------------# int EndDur = 3000; # End-of-experiment display duration time (ms) string EndMarker = Instrs[9]; # End-of-experiment marker int EndPos = PeriodPos; # End-of-experiment marker position int EndFontSize = PeriodFontSize; # End-of-experiment marker font size string EndCode = "208"; # End-of-experiment code

4.14 Questionnaire parameters

34

Page 35: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

#---QUESTIONNAIRE PARAMETERS-------------------------------------# int QuestionDelay = 1000; # Delay time (ms) for requested questionnaire response array<string> QuestionnaireFileName[2]; # Text array QuestionnaireFileName of [number of files] length QuestionnaireFileName[1] = "PCP-Question1-Template.txt"; # Questionnaire file name QuestionnaireFileName[2] = "PCP-Question2-Template.txt"; # Questionnaire file name

4.15 Bitmap parameters

#---BITMAP PARAMETERS------------------------------------------# bool PreLoadedBitmaps = false; # Bitmap objects preloaded in scenario {true|false} int NumBitmapFiles = 0; # Number of bitmap files

4.16 Sound parameters

#---SOUND PARAMETERS-------------------------------------------# int SoundAlphabetSize = 5; # Size of sound alphabet (= total number of wavefiles) array<string> SoundAlphabet[SoundAlphabetSize] = # Sound alphabet {"M","S","V","R","X"}; #

4.17 Selection response parameters

35

Page 36: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

#---SELECTION RESPONSE PARAMETERS------------------------------# int SelectionFontSize = 50; # Selection response font size int SelectionJitter = 20; # Add position jitter to selection response positions (== 0 for no jitter) bool SelectionActiveCentre = true; # Use centre position to mark skipped selection reponses {true|false} bool SelectionResponseFeedback = false; # Show selection response feedback {true|false} int SelectionHalfWidth = 25; # Selection response box halfwidth int SelectionNumPositions = 10; # Number of selection response positions array<int> SelectionPositions[SelectionNumPositions][2] = { # Selection response positions ([x y]-coordinates) { 0, 200 },{ 118, 162 },{ 190, 62 },{ 190, -62 }, # POS1-4 {X, Y} { 118, -162 },{ 0, -200 },{ -118, -162 },{ -190, -62 }, # POS5-8 {X, Y} { -190, 62 },{ -118, 162 } # POS9-10 {X, Y} }; # array<string> SelectionAlphabet[SelectionNumPositions] = { # Selection response alphabet (same size as SelectionNumPositions) "0","1","2","3","4","5","6","7","8","9"}; #

4.18 Keyboard input response parameters

#---KEYBOARD INPUT RESPONSE PARAMETERS-------------------------# array<int> ButtonCodes[4] = {1,2,29,30}; # Button codes used in the template experiments {Left,Right,Erase,Enter}

4.19 Fixation bar parameters

36

Page 37: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

#---FIXATION BAR PARAMETERS------------------------------------# int BarUpPos = 95; # Text object BarUp position on Y-axis int BarDownPos = -15; # Text object BarDown position on Y-axis if # Set fixation bar Modality == "Visual" && # FixationBars == true # then # Trim fixation bars for visual presentations string FixationBar = "__"; # if # ItemPresentation == "Complete" # then # FixationBar = "__________"; # end; # Bar.set_caption(FixationBar); # Bar.redraw(); # default.add_part( Bar , 0 , BarUpPos ); # Add fixation bars to picture object default default.add_part( Bar , 0 , BarDownPos ); # Picture.add_part( Bar , 0 , BarUpPos ); # Add fixation bars to picture object Picture Picture.add_part( Bar , 0 , BarDownPos ); # end; #

37

Page 38: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

5. Function library

The library of functions is found in $Experiment-Template/Lib/ and is loaded in the PCP-Header-Template.pcl.

################################################################ # SET LIBRARY ################################################################ include "../Lib/gettext.pcl"; # include "../Lib/getpicture.pcl"; # include "../Lib/gettrial.pcl"; # # include "../Lib/trialorderrandomization.pcl"; # # include "../Lib/readfile.pcl"; # include "../Lib/showfile.pcl"; # include "../Lib/showerror.pcl"; # include "../Lib/logdata.pcl"; # include "../Lib/testitemsarray.pcl"; # # include "../Lib/dummyfmri.pcl"; # # include "../Lib/getkeyboardinput.pcl"; # # include "../Lib/resetselection.pcl"; # include "../Lib/getselection.pcl"; # include "../Lib/getmouseinput.pcl"; # # include "../Lib/setresponse.pcl"; # # include "../Lib/loadbitmap.pcl"; # include "../Lib/loadsound.pcl"; # # include "../Lib/presentdefault.pcl"; # include "../Lib/presenttrial.pcl"; # include "../Lib/presentsound.pcl"; # include "../Lib/presentbitmap.pcl"; # include "../Lib/presentitem.pcl"; # # include "../Lib/presentquestion.pcl"; # include "../Lib/runquestionnaire.pcl"; # # include "../Lib/runexperiment.pcl"; #

38

Page 39: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Some examples of the implemented functions and their syntax:

5.1 SHOWFILE

Display instructions

# showfile ( # INPUT ARGUMENT(S) # string FileName, # File name # int FontSize) # Font size # # # Description: # # Display instructions #

5.2 DUMMYFMRI

Synchronize with FMRI scanner pulse

# dummyfmri( # INPUT ARGUMENT(S) # int NumPulsesF) # Number of FMRI pulses # # # Description: # # Synchronize with FMRI scanner pulse #

39

Page 40: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

5.3 SETRESPONSE

Update correct response key in stimulus event object StimulusEvent in trial object Trial

# setresponse ( # INPUT ARGUMENT(S) # int Key, # Target buttom key # int StartTime, # Start time # int StopTime) # Stop time (0 == no stop time) # # # Description: # # Update correct response key in stimulus event object # # StimulusEvent in trial object Trial #

5.4 PRESENTTRIAL

Present trial screen

40

Page 41: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

# sub presenttrial ( # INPUT ARGUMENT(S) # int DurationF, # Duration (ms) # string ResponseTypeF, # Response type {"Yes"|"FirstResponse"|"FixedDuration"|"CorrectResponse"|...} # string TextStrF, # Text string {String|"Keep"|...} # int FontSizeF, # Font size # int yPositionF, # Object position y-coordinate # string EventCodeF, # Event log code {String|"Pause"|"Await"|"Response"|...} # string PortCodeF, # Port code # bool SendCodeF) # Send code {true|false} # # # Description: # # Present trial screen #

5.5 RUNEXPERIMENT

Run the main experiment

# runexperiment( # INPUT ARGUMENT(S) # array<string> Trials) # String array Trials for trials # # # Description: # # Run the main experiment #

5.6 RUNQUESTIONNAIRE

41

Page 42: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

Display multiple online questions

# runquestionnaire( # INPUT ARGUMENT(S) # array<string> FileNameF, # FileNameF file name string array # int DelayF, # Delay time (ms) for requested questionnaire response # array<int> ButtonCodesF) # Button codes # # # Description: # # Display multiple online questions #

5.7 LOGDATA

Log data

# logdata ( # INPUT ARGUMENT(S) # string InputData, # Log data # string FileName, # Logfile file name # bool Overwrite) # Overwrite logfile (true) or append (false) # # # Description: # # Log data #

5.8 TRIALORDERRANDOMIZATION

Generate randomized trial order array

42

Page 43: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

# array<int> Out = trialorderrandomization ( # INPUT ARGUMENT(S) # int NumBlock, # Number of blocks in experiment # int NumMax) # Maximum number of trials # # # Description: # # Generate randomized trial order array #

5.9 LOADBITMAP

Load or unload bitmap in bitmap array Bitmaps

# loadbitmap ( # INPUT ARGUMENT(S) # bool LoadF, # Load/unload bitmap(s) # string PosF # Position in bitmap array Bitmaps # # # Description: # # Load or unload bitmap in bitmap array Bitmaps #

5.10 PRESENTBITMAP

Present bitmaps

43

Page 44: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

# presentbitmap ( # INPUT ARGUMENT(S) # int BitmapF, # Bitmap position in bitmap object array Bitmaps # int DurationF, # Duration (ms) # bool PreLoadedBitmapsF, # Bitmap objects preloaded in scenario {true|false} # string EventCodeF, # Event log code # string PortCodeF, # Port code # bool SendCodeF) # Send port code {true|false} # # # Description: # # Present bitmaps #

5.11 LOADSOUND

Load or unload sound in sound array Sounds

# loadsound ( # INPUT ARGUMENT(S) # bool LoadF, # Load/unload sound file # string SoundF, # Sound in SoundAlphabet # array<string> SoundAlphabetF) # Sound alphabet # # # Description: # # Load or unload sound in sound array Sounds #

5.12 PRESENTSOUND

Present sound item

44

Page 45: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

# sub presentsound ( # INPUT ARGUMENT(S) # string SoundF, # Sound item # array<string> AlphabetF[PresentSoundAlphabetSizeF], # Sound alphabet # int DurationF, # Duration (ms) # string EventCodeF, # Event log code # string PortCodeF, # Port code # bool SendCodeF) # Send code {true|false} # # # Description: # # Present sound item #

5.13 PRESENTITEM

Present item

# presentitem ( # INPUT ARGUMENT(S) # int StimDurF, # Duration (ms) # int InterStimDurF, # Duration (ms) # bool VariableStimDurF, # Variable stimulus presentation duration {true|false} # array<string> VarStimDurF, # Variable stimulus presentation times (ms) # array<string> StrF, # Item information in string array StrF # int PosF, # StrF position for item to present # int yPositionF, # Item position y-coordinate # int FontSizeF, # Font size # string ModalityF, # Modality mode # string ItemPresentationF, # Item presentation mode {"Sequential"|"Complete"} # bool SplitItemStructureF, # Split sub item test items structure (true|false) # bool AddPointF, # Add point after last sentence item {true|false} # bool PreLoadedBitmapsF, # Bitmap objects preloaded in scenario {true|false} # array<string> AlphabetF, # Sound alphabet # string LogFileF, # Logfile file name # bool SendCodeF) # Send code {true|false} # # # Description: # # Present item #

45

Page 46: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

5.14 GETKEYBOARDINPUT

Collect keyboard typed input

# string getkeyboardinput ( # INPUT ARGUMENT(S) # string InstrF, # Instruction text # int InstrFontSizeF, # Instruction font size # int InstrPosF, # Instruction position # int StimFontSizeF, # Stimuli font size # int StimPosF, # Stimuli position # array<int> ButtonCodesF) # Button codes # # # Description: # # Collect keyboard typed input #

5.15 GETMOUSEINPUT

Get and classify mouse input

46

Page 47: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

# string Out = getmouseinput ( # INPUT ARGUMENT(S) # int NumResponsesF, # Number of mouse click to collect # int NumItemsF, # Number of positions # int JitterF, # Jitter # int HalfWidthF, # Halfwidth of response area # bool ActiveCentreF, # Centre position to mark skipped reponse # string CentreTextF, # Centre text # array<string> AlphaBetF, # Alphabet # bool FeedbackResponseF, # Response feedback # array<string> PositionsF, # Position coordinates # int FontSizeF) # Font size # # # Description: # # Get and classify mouse input #

47

Page 48: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

6. Experiment Lego

Examples of experiment lego building blocks.

6.1 SAVE LOG

#---SAVE LOG---------------------------------------------------# logdata("Item\tResponse\tTime\n",LogFile,true); # LOG: ONE PRESENTATION logdata("Item#1\tItem#2\tResponse\tTime\n",LogFile,true); # LOG: TWO PRESENTATIONS logdata("PresentedItem\tReportedItem\n",LogFile,true); # LOG: RETYPE

6.2 LOAD/UNLOAD BITMAP FILES

#---LOAD/UNLOAD ALL BITMAP FILES-------------------------------# loadbitmap(true,"All"); # Load/unload all bitmap files into/from memory {true|false}

#---LOAD/UNLOAD BLOCK OF BITMAP FILES--------------------------# loop # int Pos = 1 # until # Pos > Items.count() # begin # loadbitmap(true,Items[Pos][5]); # Load/unload block of bitmap files into/from memory {true|false} Pos = Pos + 1; # Update pici end; #

48

Page 49: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

6.3 SYNCHRONIZE WITH SCANNER AND COLLECT DUMMY SCANS

#---SYNCHRONIZE WITH SCANNER AND COLLECT DUMMY SCANS-----------# dummyfmri(NumPulses); # Collect NumPulses dummy scans

6.4 PRESENT TRIAL (WITH FIXED DURATION, OR AWAIT ANY RESPONSE, OR AWAIT CORRECT

RESPONSE)

#---PRESENT TRIAL----------------------------------------------# #presenttrial(Duration,ResponseType,TextStr,FontSize,yPosition,EventCode,PortCode,SendCode);

#---PRESENT TRIAL WITH FIXED DURATION--------------------------# presenttrial(1000,"FixedDuration","1",20,50,"0","0",false); #

#---PRESENT TRIAL AND AWAIT ANY RESPONSE-----------------------# presenttrial(0,"FirstResponse","2",20,150,"Log","20",false); # Await any response

#---PRESENT TRIAL AND AWAIT CORRECT RESPONSE-------------------# setresponse(3,0,0); # Set target button 3 as correct response presenttrial(0,"CorrectResponse","3",20,150,"Log","20",false); # Await target button 3 response

6.5 PRESENT INSTRUCTIONS

#---PRESENT INSTRUCTIONS---------------------------------------# showfile("PCP-Instruction-Template.txt",15); # Present instruction from file

49

Page 50: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

6.6 RUN PRACTICE EXPERIMENT ITEMS

#---RUN PRACTICE EXPERIMENT ITEMS FROM 2D STRING ARRAY---------# NumItemsPres = 1; # 1:N. Number of presentations of each test item AwaitResponse = true; # Await response int OrigResponseDur = ResponseDur; # Store original response duration time ResponseDur = 0; # 0 ms response duration time ResponseType = "CorrectResponse"; # "FirstResponse"|"FixedDuration"|"CorrectResponse" presenttrial(0,"FirstResponse", # Begin practice screen (await response) "Press any button to begin practice",PeriodFontSize, # RespInstrPos,"Await"," ",SendCode); # runexperiment(PracticeItems); # Run practice items ResponseDur = OrigResponseDur; # Reset to original response duration time

6.7 RUN MAIN EXPERIMENT ITEMS

#---RUN MAIN EXPERIMENT ITEMS FROM 2D STRING ARRAY-------------# NumItemsPres = 1; # 1:N. Number of presentations of each test item AwaitResponse = true; # Reset to not await response ResponseDur = 2000; # Reset to original response duration time ResponseType = "FixedDuration"; # "FirstResponse"|"FixedDuration"|"CorrectResponse" setresponse(3,0,0); # Set target button presenttrial(0,"CorrectResponse", # Begin experiment screen (await response) "Press space bar to start experiment",PeriodFontSize, # RespInstrPos,"Await"," ",SendCode); # presenttrial(2000,"FixedDuration",Asterix,AsterixFontSize, # Present blink fixation for 2 s AsterixPos,"Begin","200",true); # runexperiment(Items); # Run main experiment

50

Page 51: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

6.8 END OF EXPERIMENT

#---END OF EXPERIMENT------------------------------------------# presenttrial(EndDur,"FixedDuration",Instrs[9],EndFontSize, # Present Color word and await response EndPos,"End","200",true); #

6.9 RUN QUESTIONNAIRE

#---RUN QUESTIONNAIRE--------------------------------------------# runquestionnaire(QuestionnaireFileName,1000,ButtonCodes); # Run questionnaire

51

Page 52: PCP Manual Project - neurobs.com · Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27 PCP Manual Project Content 1. Pipeline Code Project - Stimulus Presentation Lab (PCP-SPL).....3

Pipeline Code Project (PCP) – Manual version 1.2 2008-10-27

7. Example experiment

################################################################ # EXPERIMENT ################################################################ #---LOG DATA---------------------------------------------------# logdata("Item\tResponse\tTime\n",LogFile,true); # LOG: ONE PRESENTATION # #---SHOW INSTRUCTIONS------------------------------------------# showfile("PCP-Instruction-Template.txt",15); # Present instruction from file # #---RUN PRACTICE ITEMS-----------------------------------------# NumItemsPres = 1; # 1:N. Number of presentations of each test item AwaitResponse = true; # Await response ResponseDur = 0; # 0 ms response duration time ResponseType = "CorrectResponse"; # "FirstResponse"|"FixedDuration"|"CorrectResponse" # presenttrial(0,"FirstResponse", # Begin practice screen (await response) "Press any button to begin practice",PeriodFontSize, # RespInstrPos,"Await"," ",SendCode); # # runexperiment(PracticeItems); # Run practice items # #---RUN SESSION------------------------------------------------# NumItemsPres = 1; # 1:N. Number of presentations of each test item AwaitResponse = true; # Reset to not await response ResponseDur = 2000; # Reset to original response duration time ResponseType = "FixedDuration"; # "FirstResponse"|"FixedDuration"|"CorrectResponse" setresponse(3,0,0); # Set target button # presenttrial(0,"CorrectResponse", # Begin experiment screen (await response) "Press space bar to start experiment",PeriodFontSize, # RespInstrPos,"Await"," ",SendCode); # # runexperiment(Items); # Run main experiment # #---END OF EXPERIMENT------------------------------------------# presenttrial(10000,"FixedDuration","Wait",20,0,"End", # End EndCode,false); # #--------------------------------------------------------------#

52


Recommended