@@ -29,72 +29,85 @@ def getParameters(
2929 ----------
3030 participant : str
3131 Subject ID. Default is 'exteroStairCase'.
32- session : int
33- Session number. Default to '001'.
32+ resultPath : str or None
33+ Where to save the results.
34+ screenNb : int
35+ Screen number. Used to parametrize py:func:`psychopy.visual.Window`.
36+ Default is set to 0.
3437 serialPort: str
3538 The USB port where the pulse oximeter is plugged. Should be written as
3639 a string e.g., 'COM3', 'COM4'. If set to *None*, the pulse oximeter
3740 will be automatically detected. using the
3841 :py:func:`systole.recording.findOximeter()` function.
39- taskVersion : str or None
40- Task version to run. Can be 'Garfinkel', 'Shandry', 'test' or None.
41- resultPath : str or None
42- Where to save the results.
42+ session : int
43+ Session number. Default to '001'.
4344 setup : str
4445 Context of oximeter recording. Behavioral will record through a Nonin
4546 pulse oximeter, *fMRI* will record through BrainVision amplifier
4647 through TCP/IP conneciton. *test* will use pre-recorded pulse time
4748 series (for testing only).
4849 systole_kw : dict
4950 Additional keyword arguments for :py:class:`systole.recorder.Oxmeter`.
51+ taskVersion : str or None
52+ Task version to run. Can be 'Garfinkel', 'Shandry', 'test' or None.
5053
5154 Attributes
5255 ----------
53- restPeriod : bool
54- If *True*, a resting period will be proposed before the task.
55- restLength : int
56- The length of the resting period (seconds). Default is 300 seconds.
57- screenNb : int
58- The screen number (Psychopy parameter). Default set to 0.
59- randomize : bool
60- If `True` (default), will randomize the order of the conditions. If
61- taskVersion is not None, will use the default task parameter instead.
62- startKey : str
63- The key to press to start the task and go to next steps.
64- rating : bool
65- If `True` (default), will add a rating scale after the evaluation.
56+ conditions : 1d array-like of str
57+ The conditions. Can be 'Rest', 'Training' or 'Count'.
6658 confScale : list
6759 The range of the confidence rating scale.
60+ heartLogo : `psychopy.visual.ImageStim`
61+ Image presented during resting conditions.
6862 labelsRating : list
6963 The labels of the confidence rating scale.
70- taskVersion : str or None
71- Task version to run. Can be 'Garfinkel', 'Shandry' or None.
72- times : 1d array-like of int
73- Length of trials, in seconds.
74- conditions : 1d array-like of str
75- The conditions. Can be 'Rest', 'Training' or 'Count'.
76- subjectID : str
77- Subject identifiant.
78- subjectNumber : int
79- Subject reference number.
64+ noteStart : psychopy.sound.Sound instance
65+ The sound that will be played when trial starts.
66+ noteStop : psychopy.sound.Sound instance
67+ The sound that will be played when trial ends.
8068 path : str
8169 The task working directory.
82- results : str
70+ randomize : bool
71+ If `True` (default), will randomize the order of the conditions. If
72+ taskVersion is not None, will use the default task parameter instead.
73+ rating : bool
74+ If `True` (default), will add a rating scale after the evaluation.
75+ restLength : int
76+ The length of the resting period (seconds). Default is 300 seconds.
77+ restLogo : `psychopy.visual.ImageStim`
78+ Image presented during resting conditions.
79+ restPeriod : bool
80+ If *True*, a resting period will be proposed before the task.
81+ resultPath : str
8382 The subject result directory.
84- note : `psychopy.sound`
85- The sound played at trial start and trial end.
86- win : `psychopy.visual.Window`
87- Window where to present stimuli.
83+ screenNb : int
84+ The screen number (Psychopy parameter). Default set to 0.
8885 serial : `serial.Serial`
8986 The serial port used to record the PPG activity.
90- restLogo : `psychopy.visual.ImageStim`
91- Image presented during resting conditions .
92- heartLogo : `psychopy.visual.ImageStim`
93- Image presented during resting conditions .
87+ startKey : str
88+ The key to press to start the task and go to next steps .
89+ taskVersion : str or None
90+ Task version to run. Can be 'Garfinkel', 'Shandry', 'test' or None .
9491 texts : dict
9592 Dictionnary containing the texts to be presented.
9693 textSize : float
9794 Text size.
95+ triggers : dict
96+ Dictionary {str, callable or None}. The function will be executed
97+ before the corresponding trial sequence. The default values are
98+ `None` (no trigger sent).
99+ * `"trialStart"`
100+ * `"trialStop"`
101+ * `"listeningStart"`
102+ * `"listeningStop"`
103+ * `"decisionStart"`
104+ * `"decisionStop"`
105+ * `"confidenceStart"`
106+ * `"confidenceStop"`
107+ times : 1d array-like of int
108+ Length of trials, in seconds.
109+ win : `psychopy.visual.window`
110+ The window in which to draw objects.
98111 """
99112 parameters : Dict [str , Any ] = {}
100113 parameters ["restPeriod" ] = True
@@ -106,6 +119,21 @@ def getParameters(
106119 parameters ["labelsRating" ] = ["Guess" , "Certain" ]
107120 parameters ["taskVersion" ] = taskVersion
108121 parameters ["results_df" ] = pd .DataFrame ({})
122+ parameters ["setup" ] = setup
123+
124+ # Initialize triggers dictionary with None
125+ # Some or all can later be overwrited with callable
126+ # sending the information needed.
127+ parameters ["triggers" ] = {
128+ "trialStart" : None ,
129+ "trialStop" : None ,
130+ "listeningStart" : None ,
131+ "listeningStop" : None ,
132+ "decisionStart" : None ,
133+ "decisionStop" : None ,
134+ "confidenceStart" : None ,
135+ "confidenceStop" : None ,
136+ }
109137
110138 # Experimental design - can choose between a version based on recent
111139 # papers from Sarah Garfinkel's group, or the classic Schandry approach.
@@ -149,30 +177,32 @@ def getParameters(
149177 parameters ["noteStart" ] = sound .Sound (
150178 pkg_resources .resource_filename ("cardioception.HBC" , "Sounds/start.wav" )
151179 )
152- parameters ["noteEnd" ] = sound .Sound (
180+
181+ parameters ["noteStop" ] = sound .Sound (
153182 pkg_resources .resource_filename ("cardioception.HBC" , "Sounds/stop.wav" )
154183 )
155184
156185 # Open window
186+ if parameters ["setup" ] == "test" :
187+ fullscr = False
157188 parameters ["win" ] = visual .Window (screen = screenNb , fullscr = fullscr , units = "height" )
158189 parameters ["win" ].mouseVisible = False
159190
160191 parameters ["restLogo" ] = visual .ImageStim (
161192 win = parameters ["win" ],
162193 units = "height" ,
163- image = os . path . dirname ( __file__ ) + "/ Images/rest.png" ,
194+ image = pkg_resources . resource_filename ( __name__ , " Images/rest.png") ,
164195 pos = (0.0 , - 0.2 ),
165196 )
166197 parameters ["restLogo" ].size *= 0.15
167198 parameters ["heartLogo" ] = visual .ImageStim (
168199 win = parameters ["win" ],
169200 units = "height" ,
170- image = os . path . dirname ( __file__ ) + "/ Images/heartbeat.png" ,
201+ image = pkg_resources . resource_filename ( __name__ , " Images/heartbeat.png") ,
171202 pos = (0.0 , - 0.2 ),
172203 )
173204 parameters ["heartLogo" ].size *= 0.05
174205
175- parameters ["setup" ] = setup
176206 if setup == "behavioral" :
177207 # PPG recording
178208 if serialPort is None :
0 commit comments