Skip to content

Commit 4f95fba

Browse files
committed
doc(trigger): update trigger info
1 parent 9fd12e8 commit 4f95fba

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

readme.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This project is clojurescript that transpiles to javascript (see the [[https://g
4949
* code path: enter in [[https://github.com/LabNeuroCogDevel/choice-landscape/blob/master/src/landscape/core.cljs#L202][core.cljs]] and follow to loop.cljs/run-loop and display-state
5050
* model updating with [[https://github.com/LabNeuroCogDevel/choice-landscape/blob/master/src/landscape/model.cljs#L123][model.cljs/next-step]] and
5151
* displayed with [[https://github.com/LabNeuroCogDevel/choice-landscape/blob/master/src/landscape/view.cljs#L364][view.cljs/display-state]]
52-
* EEG status channel TTL codes are generated with [[https://github.com/LabNeuroCogDevel/choice-landscape/blob/master/src/landscape/model/phase.cljs#L96][phase/gen-ttl]]
52+
* EEG status channel TTL codes are generated with [[https://github.com/LabNeuroCogDevel/choice-landscape/blob/master/src/landscape/model/phase.cljs#L96][phase/gen-ttl]], more is written about them on [[file:results/LoeffEEGPhotoTiming/readme.org][results/LoeffEEGPhotoTiming/readme.org]]
5353

5454
* Debugging
5555
Using e.g. CIDER with figwheel-main:dev (C-c M-J in emacs on core.cljs)

results/LoeffEEGPhotoTiming/readme.org

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,50 @@ Status channel trigger values include
99
- those sent by the button box ~2-4~ (RT, initiates "waiting" event)
1010
- those explicitly sent by the task ~10-230~ (indicating event iti,choice,timeout,waiting,feedback,survey)
1111

12+
See [[file:~/src/tasks/choice-landscape/src/landscape/model/phase.cljs#L96][phase/gen-ttl]].
13+
14+
*** Grouped
1215
They can be grouped like
1316
#+begin_example
1417
1 2 3 4 % PD, buttons
15-
10 % iti
16-
13 14 15 % choice
17-
23 24 25 %
18+
10 13 14 15 % iti (3,4,5 = upcoming choice state)
19+
23 24 25 % choice (20 + {3LU, 4LR, 5 UR})
1820
73 % timeout
1921
128 % start
20-
163 164 166 167 168 % waiting (+150)
21-
213 214 216 217 218 % feedback noscore, score (+200)
22-
223 224 226 227 228
22+
163 164 166 167 168 % waiting (state&key +150)
23+
213 214 216 217 218 % feedback noscore (state&key +200)
24+
223 224 226 227 228 % +10 if score (rewarded)
2325
230 % finished/survey/catchall
2426
#+end_example
2527

28+
*** State & button
29+
State (choice options: ~Left and Up~, ~left and right~, or ~up and right~) is predetermined.
30+
This state is included in trigger values sent for each event (iti, choice, waiting, feedback).
31+
This can be useful for confirming trigger sequence is expected and no values have been corrupted.
32+
33+
When a choice has been made (left, up, right), that value is also included in the trigger.
34+
Combining state and button push choice distributes 13-18 to the six possible combinations.
35+
That is added to the event (waiting: ~150~ + state&choice [ =163-168= ], feedback: ~200~ + state&choice+reward [ =213-228= ])
36+
37+
+------------+-----+--------+---------------------+----------+------------+
38+
| options | iti | choice | waiting (+150) AND feedback (+200 +10? ) |
39+
+------------+-----+--------+--------------------+----------+-------------+
40+
| | | | left | up | right |
41+
+------------+-----+--------+--------------------+----------+-------------+
42+
| left+up | 13 | 23 | 13 | 14 | |
43+
+------------+-----+--------+--------------------+----------+-------------+
44+
| left+right | 14 | 24 | 15 | | 17 |
45+
+------------+-----+--------+--------------------+----------+-------------+
46+
| up+right | 15 | 25 | | 16 | 18 |
47+
+------------+-----+--------+--------------------+----------+-------------+
48+
#+TBLFM:
49+
50+
51+
*** Matlab cut
2652

2753
Or as ~discretized~ in matlab
28-
#+begin_src matlab
29-
cuts = [0, 2, 5, 11, 30, 127, 129, 170, 229, 256];
54+
#+begin_src matlab :eval never
55+
cuts = [0, 2, 5, 19, 30, 127, 129, 170, 229, 256];
3056
labs = {'Photo','Button', 'iti','choice','timeout','start', 'waiting','feedback','survey'}
3157
ttl_label = discretize(event_ttl,cuts,labs);
3258
#+end_src
@@ -36,7 +62,7 @@ The task computer also records it's own history of events into a json file turne
3662
The timing recorded here is expected to be ahead of what is actually displayed due to software (web browser) and hardware (screen refresh rate, wiring) delays.
3763

3864
First onset is the start of the run and of the recording. Baseline all timings to that
39-
#+begin_src matlab
65+
#+begin_src matlab :eval never
4066
% adjust to very first iti_onset. and move from ms to seconds
4167
task_time{:,:} = (table2array(task_time) - task_time{1,1})./1000;
4268
#+end_src

0 commit comments

Comments
 (0)