-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGRF.h
More file actions
270 lines (234 loc) · 7.76 KB
/
GRF.h
File metadata and controls
270 lines (234 loc) · 7.76 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*
* GRF.h
* GaborRFMap
*
* Copyright (c) 2006. All rights reserved.
*
*/
@class GRFDigitalOut;
#define kPI (atan(1) * 4)
#define k2PI (atan(1) * 4 * 2)
#define kRadiansPerDeg (kPI / 180.0)
#define kDegPerRadian (180.0 / kPI)
// The following should be changed to be unique for each application
enum {kTaskGabor = 0, kMapGabor0, kMapGabor1, kGabors};
enum {kAttend0 = 0, kAttend1, kLocations};
enum {kLinear = 0, kLogarithmic};
enum {kUniform = 0, kExponential};
enum {kAuto = 0, kManual};
enum {kRewardFixed = 0, kRewardVariable};
enum {kNullStim = 0, kValidStim, kTargetStim, kFrontPadding, kBackPadding};
enum {kMyEOTCorrect = 0, kMyEOTMissed, kMyEOTEarlyToValid, kMyEOTEarlyToInvalid, kMyEOTBroke,
kMyEOTIgnored, kMyEOTQuit, kMyEOTTypes};
enum { kTrialStartDigitOutCode = 0x0010,
kFixateDigitOutCode = 0x0020,
kStimulusOnDigitOutCode = 0x0030,
kStimulusOffDigitOutCode = 0x0040,
kTargetOnDigitOutCode = 0x0050,
kSaccadeDigitOutCode = 0x0060,
kTrialEndDigitOutCode = 0x0070};
enum {kOpenTask = 0, kCloseTask}; // [Vinay] - added this for the Transfer Function Protocol
long taskSelectTFP; // [Vinay] - added this for the Transfer Function Protocol
BOOL eyesClosed;
#define kMaxOriChanges 12
#define kMaxMapValues 6
typedef struct {
long levels; // number of active stimulus levels
float maxValue; // maximum stimulus value (i.e., direction change in degree)
float minValue; // minimum stimulus value
} StimParams;
typedef struct StimDesc {
long gaborIndex;
long sequenceIndex;
long stimOnFrame;
long stimOffFrame;
short stimType;
float orientationChangeDeg;
float contrastPC;
float azimuthDeg;
float elevationDeg;
float sigmaDeg;
float radiusDeg;
float spatialFreqCPD;
float directionDeg;
float temporalFreqHz;
long azimuthIndex;
long elevationIndex;
long sigmaIndex;
long spatialFreqIndex;
long directionIndex;
long contrastIndex;
long temporalFreqIndex;
long temporalModulation;
} StimDesc;
typedef struct TrialDesc {
BOOL instructTrial;
BOOL catchTrial;
long numStim;
long targetIndex; // index (count) of target in stimulus sequence
long targetOnTimeMS; // time from first stimulus (start of stimlist) to the target
long orientationChangeIndex;
float orientationChangeDeg;
} TrialDesc;
typedef struct BlockStatus {
long changes;
float orientationChangeDeg[kMaxOriChanges];
float validReps[kMaxOriChanges];
long validRepsDone[kMaxOriChanges];
float invalidReps[kMaxOriChanges];
long invalidRepsDone[kMaxOriChanges];
long instructDone; // number of instruction trials done
long instructTrials; // number of instruction trials to be done
long sidesDone; // number of sides (out of kLocations) done
long blockLimit; // number of blocks before stopping
long blocksDone; // number of blocks completed
} BlockStatus;
typedef struct MappingBlockStatus {
long stimDone; // number of stim done in this block
long stimLimit; // number of stim in block
long blocksDone; // number of blocks completed
long blockLimit; // number of blocks before stopping
} MappingBlockStatus;
typedef struct MapParams {
long n; // number of different conditions
float minValue; // smallest value tested
float maxValue; // largest value tested
} MapParams;
typedef struct MapSettings {
MapParams azimuthDeg;
MapParams elevationDeg;
MapParams directionDeg;
MapParams spatialFreqCPD;
MapParams sigmaDeg;
MapParams contrastPC;
MapParams temporalFreqHz;
} MapSettings;
// put parameters set in the behavior controller
typedef struct BehaviorSetting {
long blocks;
long intertrialMS;
long acquireMS;
long fixGraceMS;
long fixateMS;
long fixateJitterPC;
long responseTimeMS;
long tooFastMS;
long minSaccadeDurMS;
long breakPunishMS;
long rewardSchedule;
long rewardMS;
float fixWinWidthDeg;
float respWinWidthDeg;
BOOL tfuncProtocol; // [Vinay] - added for the transfer function protocol
} BehaviorSetting;
// put parameters set in the Stimulus controller
typedef struct StimSetting {
long stimDurationMS;
long stimDurJitterPC;
long interStimMS;
long interStimJitterPC;
long stimLeadMS;
float stimSpeedHz;
long stimDistribution;
long minTargetOnTimeMS;
long meanTargetOnTimeMS;
long maxTargetOnTimeMS;
float eccentricityDeg;
float polarAngleDeg;
float driftDirectionDeg;
float contrastPC;
short numberOfSurrounds;
long changeScale;
long orientationChanges;
float maxChangeDeg;
float minChangeDeg;
long changeRemains;
} StimSetting;
#ifndef NoGlobals
// Behavior settings dialog
extern NSString *GRFAcquireMSKey;
extern NSString *GRFAlphaTargetDetectionTaskKey;
extern NSString *GRFBlockLimitKey;
extern NSString *GRFBreakPunishMSKey;
extern NSString *GRFCatchTrialPCKey;
extern NSString *GRFCatchTrialMaxPCKey;
extern NSString *GRFCueMSKey;
//extern NSString *GRFChageScaleKey;
extern NSString *GRFDoSoundsKey;
extern NSString *GRFFixateKey;
extern NSString *GRFFixateMSKey;
extern NSString *GRFFixateOnlyKey;
extern NSString *GRFFixGraceMSKey;
extern NSString *GRFFixJitterPCKey;
extern NSString *GRFFixWindowWidthDegKey;
extern NSString *GRFIntertrialMSKey;
extern NSString *GRFInstructionTrialsKey;
extern NSString *GRFInvalidRewardFactorKey;
extern NSString *GRFMaxTargetMSKey;
extern NSString *GRFMinTargetMSKey;
extern NSString *GRFMeanTargetMSKey;
extern NSString *GRFNontargetContrastPCKey;
//extern NSString *GRFNumInstructTrialsKey;
extern NSString *GRFRandTaskGaborDirectionKey;
extern NSString *GRFRespSpotSizeDegKey;
extern NSString *GRFRespTimeMSKey;
extern NSString *GRFRespWindowWidthDegKey;
extern NSString *GRFRewardMSKey;
extern NSString *GRFMinRewardMSKey;
extern NSString *GRFRewardScheduleKey;
extern NSString *GRFSaccadeTimeMSKey;
extern NSString *GRFStimDistributionKey;
extern NSString *GRFStimRepsPerBlockKey;
extern NSString *GRFTaskStatus;
extern NSString *GRFTooFastMSKey;
extern NSString *GRFTFProtocolKey; // [Vinay] - for the transfer function protocol
// Stimulus settings dialog
extern NSString *GRFInterstimMSKey;
extern NSString *GRFMapInterstimDurationMSKey;
extern NSString *GRFInterstimJitterPCKey;
extern NSString *GRFStimDurationMSKey;
extern NSString *GRFMapStimDurationMSKey;
extern NSString *GRFMappingBlocksKey;
extern NSString *GRFStimJitterPCKey;
extern NSString *GRFChangeScaleKey;
extern NSString *GRFOrientationChangesKey;
extern NSString *GRFMaxDirChangeDegKey;
extern NSString *GRFMinDirChangeDegKey;
extern NSString *GRFChangeRemainKey;
extern NSString *GRFChangeArrayKey;
extern NSString *GRFTargetAlphaKey;
extern NSString *GRFTargetRadiusKey;
extern NSString *GRFMapStimContrastPCKey;
extern NSString *GRFMapStimRadiusSigmaRatioKey;
extern NSString *GRFKdlPhiDegKey;
extern NSString *GRFKdlThetaDegKey;
extern NSString *GRFRadiusDegKey;
extern NSString *GRFSeparationDegKey;
extern NSString *GRFSpatialFreqCPDKey;
extern NSString *GRFSpatialPhaseDegKey;
extern NSString *GRFTemporalFreqHzKey;
extern NSString *GRFChangeKey;
extern NSString *GRFInvalidRepsKey;
extern NSString *GRFValidRepsKey;
extern NSString *GRFHideLeftKey;
extern NSString *GRFHideRightKey;
extern NSString *GRFHideLeftDigitalKey;
extern NSString *GRFHideRightDigitalKey;
extern NSString *GRFConvertToGratingKey;
extern NSString *GRFUseSingleITC18Key;
extern NSString *GRFHideTaskGaborKey;
extern NSString *GRFIncludeCatchTrialsinDoneListKey;
extern NSString *GRFMapTemporalModulationKey;
long argRand;
#import "GRFStimuli.h"
BlockStatus blockStatus;
BehaviorSetting behaviorSetting;
BOOL brokeDuringStim;
MappingBlockStatus mappingBlockStatus;
BOOL resetFlag;
LLScheduleController *scheduler;
GRFStimuli *stimuli;
GRFDigitalOut *digitalOut;
long trialCounter;
#endif
LLTaskPlugIn *task;