Skip to content

Artificial Stimuli

load_chirp(normalize=True, trigger_times=None)

The chirp has 2 triggers per repetition

Source code in openretina/data_io/artificial_stimuli.py
83
84
85
86
87
88
89
90
91
92
93
94
def load_chirp(
    normalize: bool = True,
    trigger_times: np.ndarray | None = None,
) -> np.ndarray:
    """The chirp has 2 triggers per repetition"""
    chirp = load_stimulus(
        file_path=_CHIRP_PATH,
        normalize=normalize,
        trigger_times=trigger_times,
        num_triggers_per_repetition=2,
    )
    return chirp

load_moving_bar(normalize=True, trigger_times=None)

Moving bar has 8 triggers, one for each direction. Its directions are [0,180, 45,225, 90,270, 135,315] (in degrees)

Source code in openretina/data_io/artificial_stimuli.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def load_moving_bar(
    normalize: bool = True,
    trigger_times: np.ndarray | None = None,
) -> np.ndarray:
    """Moving bar has 8 triggers, one for each direction.
    Its directions are [0,180, 45,225, 90,270, 135,315] (in degrees)
    """
    moving_bar = load_stimulus(
        file_path=_MOVING_BAR_PATH,
        normalize=normalize,
        trigger_times=trigger_times,
        num_triggers_per_repetition=8,
    )
    # Remove the frames that are not part of the moving bar, i.e. black frames at the beginning and end
    # See: https://github.com/eulerlab/QDSpy/blob/master/Stimuli/RGC_MovingBar_2.py
    frame_rate = 30
    frames_before_first_mb = frame_rate * 3  # 3s before first moving bar
    frames_after_last_mb = frame_rate * 1  # 1s after last moving bar
    moving_bar_content = moving_bar[frames_before_first_mb:-frames_after_last_mb]

    return moving_bar_content

load_moving_bar_30hz_72_64px(normalize=True, trigger_times=None)

Moving bar has 8 triggers, one for each direction. Its directions are [0,180, 45,225, 90,270, 135,315] (in degrees)

Source code in openretina/data_io/artificial_stimuli.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
def load_moving_bar_30hz_72_64px(
    normalize: bool = True,
    trigger_times: np.ndarray | None = None,
) -> np.ndarray:
    """Moving bar has 8 triggers, one for each direction.
    Its directions are [0,180, 45,225, 90,270, 135,315] (in degrees)
    """
    moving_bar = load_stimulus(
        file_path=_MOVING_BAR_72_64_PATH,
        normalize=normalize,
        trigger_times=trigger_times,
        num_triggers_per_repetition=8,
        downsample_t_factor=2,
    )
    # Remove the frames that are not part of the moving bar, i.e. black frames at the beginning and end
    # See: https://github.com/eulerlab/QDSpy/blob/master/Stimuli/RGC_MovingBar_2.py
    frame_rate = 30
    frames_before_first_mb = frame_rate * 3  # 3s before first moving bar
    frames_after_last_mb = frame_rate * 1  # 1s after last moving bar
    moving_bar_content = moving_bar[frames_before_first_mb:-frames_after_last_mb]

    return moving_bar_content