Skip to content

sweetbean.stimulus.RO

RandomDotPatterns

Bases: ROK

Source code in sweetbean/stimulus/RO.py
 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
class RandomDotPatterns(ROK):
    def __init__(
        self,
        duration=None,
        number_of_oobs=300,
        number_of_apertures=2,
        coherent_orientation=0,
        coherence_orientation=0,
        aperture_position_left=50,
        aperture_position_top=50,
        oob_color="white",
        background_color="grey",
        stimulus_type=1,
        choices=None,
        correct_key="",
        side_effects=None,
    ):
        """
        Arguments:
            duration: time in ms the stimulus is presented // trial_duration
            number_of_oobs: the number of oriented objects per set in the stimulus
            number_of_apertures: the number of kinematograms
            coherent_orientation: the orientation of the objects in degree
                (0 degree meaning right)
            coherence_orientation: the percentage of oriented objects moving in the coherent
                direction.
            aperture_position_left: position of midpoint of aperture in x direction in percentage
                of window width
            aperture_position_top: position of midpoint of aperture in y direction in percentage
                of window height
            oob_color: the color of the orientated objects
            background_color: the background color
            choices: the valid keys that the subject can press to indicate a response
            correct_key: the correct key to press
            side_effects: a dictionary of side effects
        """
        if choices is None:
            choices = []

        super().__init__(
            duration=duration,
            number_of_oobs=number_of_oobs,
            number_of_apertures=number_of_apertures,
            coherent_movement_direction=0,
            coherent_orientation=coherent_orientation,
            coherence_movement=0,
            coherence_orientation=coherence_orientation,
            movement_speed=0,
            aperture_position_left=aperture_position_left,
            aperture_position_top=aperture_position_top,
            oob_color=oob_color,
            background_color=background_color,
            stimulus_type=stimulus_type,
            choices=choices,
            correct_key=correct_key,
            side_effects=side_effects,
        )

__init__(duration=None, number_of_oobs=300, number_of_apertures=2, coherent_orientation=0, coherence_orientation=0, aperture_position_left=50, aperture_position_top=50, oob_color='white', background_color='grey', stimulus_type=1, choices=None, correct_key='', side_effects=None)

Parameters:

Name Type Description Default
duration

time in ms the stimulus is presented // trial_duration

None
number_of_oobs

the number of oriented objects per set in the stimulus

300
number_of_apertures

the number of kinematograms

2
coherent_orientation

the orientation of the objects in degree (0 degree meaning right)

0
coherence_orientation

the percentage of oriented objects moving in the coherent direction.

0
aperture_position_left

position of midpoint of aperture in x direction in percentage of window width

50
aperture_position_top

position of midpoint of aperture in y direction in percentage of window height

50
oob_color

the color of the orientated objects

'white'
background_color

the background color

'grey'
choices

the valid keys that the subject can press to indicate a response

None
correct_key

the correct key to press

''
side_effects

a dictionary of side effects

None
Source code in sweetbean/stimulus/RO.py
 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
def __init__(
    self,
    duration=None,
    number_of_oobs=300,
    number_of_apertures=2,
    coherent_orientation=0,
    coherence_orientation=0,
    aperture_position_left=50,
    aperture_position_top=50,
    oob_color="white",
    background_color="grey",
    stimulus_type=1,
    choices=None,
    correct_key="",
    side_effects=None,
):
    """
    Arguments:
        duration: time in ms the stimulus is presented // trial_duration
        number_of_oobs: the number of oriented objects per set in the stimulus
        number_of_apertures: the number of kinematograms
        coherent_orientation: the orientation of the objects in degree
            (0 degree meaning right)
        coherence_orientation: the percentage of oriented objects moving in the coherent
            direction.
        aperture_position_left: position of midpoint of aperture in x direction in percentage
            of window width
        aperture_position_top: position of midpoint of aperture in y direction in percentage
            of window height
        oob_color: the color of the orientated objects
        background_color: the background color
        choices: the valid keys that the subject can press to indicate a response
        correct_key: the correct key to press
        side_effects: a dictionary of side effects
    """
    if choices is None:
        choices = []

    super().__init__(
        duration=duration,
        number_of_oobs=number_of_oobs,
        number_of_apertures=number_of_apertures,
        coherent_movement_direction=0,
        coherent_orientation=coherent_orientation,
        coherence_movement=0,
        coherence_orientation=coherence_orientation,
        movement_speed=0,
        aperture_position_left=aperture_position_left,
        aperture_position_top=aperture_position_top,
        oob_color=oob_color,
        background_color=background_color,
        stimulus_type=stimulus_type,
        choices=choices,
        correct_key=correct_key,
        side_effects=side_effects,
    )

RandomObjectKinematogram

Bases: _BaseStimulus

Show a random-object-kinematogram

Source code in sweetbean/stimulus/RO.py
 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
class RandomObjectKinematogram(_BaseStimulus):
    """
    Show a random-object-kinematogram
    """

    type = "jsPsychRok"

    def __init__(
        self,
        duration=None,
        number_of_oobs=300,
        number_of_apertures=1,
        coherent_movement_direction=180,
        coherent_orientation=180,
        coherence_movement=100,
        coherence_orientation=100,
        movement_speed=10,
        aperture_position_left=50,
        aperture_position_top=50,
        oob_color="white",
        background_color="black",
        stimulus_type=0,
        choices=None,
        correct_key="",
        side_effects=None,
    ):
        """
        Arguments:
            duration: time in ms the stimulus is presented // trial_duration
            number_of_oobs: the number of oriented objects per set in the stimulus
            number_of_apertures: the number of kinematograms
            coherent_movement_direction: the direction of coherent motion in degrees
                (0 degre meaning right)
            coherent_orientation: the orientation of the objects in degree
                (0 degree meaning right)
            coherence_movement: the percentage of oriented objects moving in the coherent direction.
            coherence_orientation: the percentage of oriented objects moving in the coherent
                direction.
            movement_speed: the movement speed of the oobs in (percentage of aperture_width)/second
            aperture_position_left: position of midpoint of aperture in x direction in percentage
                of window width
            aperture_position_top: position of midpoint of aperture in y direction in percentage
                of window height
            oob_color: the color of the orientated objects
            background_color: the background color
            choices: the valid keys that the subject can press to indicate a response
            correct_key: the correct key to press
            side_effects: a dictionary of side effects
        """
        if choices is None:
            choices = []
        correct_choice = [correct_key]
        super().__init__(locals(), side_effects)

    def _add_special_param(self):
        pass

    def _process_response(self):
        self.js_data += 'data["bean_correct"]=data["correct"];'

    def _set_before(self):
        pass

    def process_l(self, prompts, get_input, multi_turn, datum=None):
        raise NotImplementedError

__init__(duration=None, number_of_oobs=300, number_of_apertures=1, coherent_movement_direction=180, coherent_orientation=180, coherence_movement=100, coherence_orientation=100, movement_speed=10, aperture_position_left=50, aperture_position_top=50, oob_color='white', background_color='black', stimulus_type=0, choices=None, correct_key='', side_effects=None)

Parameters:

Name Type Description Default
duration

time in ms the stimulus is presented // trial_duration

None
number_of_oobs

the number of oriented objects per set in the stimulus

300
number_of_apertures

the number of kinematograms

1
coherent_movement_direction

the direction of coherent motion in degrees (0 degre meaning right)

180
coherent_orientation

the orientation of the objects in degree (0 degree meaning right)

180
coherence_movement

the percentage of oriented objects moving in the coherent direction.

100
coherence_orientation

the percentage of oriented objects moving in the coherent direction.

100
movement_speed

the movement speed of the oobs in (percentage of aperture_width)/second

10
aperture_position_left

position of midpoint of aperture in x direction in percentage of window width

50
aperture_position_top

position of midpoint of aperture in y direction in percentage of window height

50
oob_color

the color of the orientated objects

'white'
background_color

the background color

'black'
choices

the valid keys that the subject can press to indicate a response

None
correct_key

the correct key to press

''
side_effects

a dictionary of side effects

None
Source code in sweetbean/stimulus/RO.py
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
def __init__(
    self,
    duration=None,
    number_of_oobs=300,
    number_of_apertures=1,
    coherent_movement_direction=180,
    coherent_orientation=180,
    coherence_movement=100,
    coherence_orientation=100,
    movement_speed=10,
    aperture_position_left=50,
    aperture_position_top=50,
    oob_color="white",
    background_color="black",
    stimulus_type=0,
    choices=None,
    correct_key="",
    side_effects=None,
):
    """
    Arguments:
        duration: time in ms the stimulus is presented // trial_duration
        number_of_oobs: the number of oriented objects per set in the stimulus
        number_of_apertures: the number of kinematograms
        coherent_movement_direction: the direction of coherent motion in degrees
            (0 degre meaning right)
        coherent_orientation: the orientation of the objects in degree
            (0 degree meaning right)
        coherence_movement: the percentage of oriented objects moving in the coherent direction.
        coherence_orientation: the percentage of oriented objects moving in the coherent
            direction.
        movement_speed: the movement speed of the oobs in (percentage of aperture_width)/second
        aperture_position_left: position of midpoint of aperture in x direction in percentage
            of window width
        aperture_position_top: position of midpoint of aperture in y direction in percentage
            of window height
        oob_color: the color of the orientated objects
        background_color: the background color
        choices: the valid keys that the subject can press to indicate a response
        correct_key: the correct key to press
        side_effects: a dictionary of side effects
    """
    if choices is None:
        choices = []
    correct_choice = [correct_key]
    super().__init__(locals(), side_effects)