-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfacename.py
executable file
·66 lines (54 loc) · 1.99 KB
/
facename.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/python2
# -*- coding: utf-8 -*-
###############################################################################
# Written by: Forrest Koch ([email protected])
# Organization: Centre for Healthy Brain Ageing (UNSW)
# PyschoPy Version: 1.85.3
# Python Version: 2.7.5
###############################################################################
import os
import serial
from psychopy import core, gui, data, logging, visual, clock
import const
import experiment
from colls import *
if (__name__ == '__main__'):
app = experiment.Experiment('facename')
# add routines to the app
app.addRoutine(FacenameInstructions(app))
app.addRoutine(CountdownSequence(app))
# build the trial sequence and add to the app
runCSV = data.importConditions('facename/runs/run1.csv')
firstBlock = True
for line in runCSV:
if firstBlock:
firstBlock = False
else:
# after each block there should be a rest block
app.addRoutine(RestBlock(app))
blockCSV = data.importConditions(line['blockFile'])
# discriminate between known and novel trials
if (int(line['isKnown']) == 1):
isKnown = True
app.addRoutine(KnownCue(app))
else:
isKnown = False
app.addRoutine(NovelCue(app))
firstTrial = True
for trial in blockCSV:
image = os.path.join(const.DEFAULT_STIMULI_FOLDER,trial['image'])
if isKnown:
trialRoutine = KnownTrial(app, image, trial['name1'], trial['name2'], None)
else:
trialRoutine = NovelTrial(app, image, trial['name'])
# after each trial there should be a brief fixation
if firstTrial:
firstTrial = False
else:
app.addRoutine(Fixation(app))
app.addRoutine(trialRoutine)
# ready freddy go!
app.run()
print('hello')
# write out the logfile
logging.flush()