Skip to content

Commit

Permalink
docs(rectilinear): demo rotation of rectilinear stimuli
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Apr 4, 2023
1 parent 0670d6b commit 2bd7b98
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/reference/demos/stimuli/bullseyes.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ w_int2 = iw.FloatSlider(value=0, min=0, max=1, description="int-ring2")
w_int_back = iw.FloatSlider(value=0.5, min=0, max=1, description="intensity background")
w_ori = iw.Dropdown(value="center", options=['mean', 'corner', 'center'], description="origin")
w_rot = iw.FloatSlider(value=0, min=0, max=360, description="rotation [deg]")
w_clip = iw.ToggleButton(value=False, disabled=False, description="clip")
w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'frame_mask'], description="add mask")
Expand All @@ -220,7 +221,7 @@ b_im_size = iw.HBox([w_height, w_width, w_ppd])
b_geometry = iw.HBox([w_freq, w_phase])
b_intensities = iw.HBox([w_int1, w_int2, w_int_back])
b_target = iw.HBox([w_tint])
b_add = iw.HBox([w_ori, w_clip, w_mask])
b_add = iw.HBox([w_ori, w_rot, w_clip, w_mask])
ui = iw.VBox([b_im_size, b_geometry, b_intensities, b_target, b_add])
# Function for showing stim
Expand All @@ -237,6 +238,7 @@ def show_rectangular(
clip=False,
add_mask=False,
intensity_target=None,
rotation=0.0,
):
stim = rectangular(
visual_size=(height, width),
Expand All @@ -248,6 +250,7 @@ def show_rectangular(
origin=origin,
clip=clip,
intensity_target=intensity_target,
rotation=rotation,
)
plot_stim(stim, mask=add_mask)
Expand All @@ -267,6 +270,7 @@ out = iw.interactive_output(
"clip": w_clip,
"add_mask": w_mask,
"intensity_target": w_tint,
"rotation": w_rot,
},
)
Expand Down Expand Up @@ -295,6 +299,7 @@ w_int3 = iw.FloatSlider(value=0.8, min=0, max=1, description="int-ring3")
w_int_back = iw.FloatSlider(value=0., min=0, max=1, description="intensity background")
w_ori = iw.Dropdown(value="center", options=['mean', 'corner', 'center'], description="origin")
w_rot = iw.FloatSlider(value=0, min=0, max=360, description="rotation [deg]")
w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'frame_mask'], description="add mask")
w_tint = iw.FloatSlider(value=0.5, min=0, max=1, description="target int")
Expand All @@ -304,7 +309,7 @@ b_im_size = iw.HBox([w_height, w_width, w_ppd])
b_geometry = iw.HBox([w_radius1, w_radius2, w_radius3])
b_intensities = iw.HBox([w_int1, w_int2, w_int3, w_int_back])
b_target = iw.HBox([w_tint])
b_add = iw.HBox([w_ori, w_mask])
b_add = iw.HBox([w_ori, w_rot, w_mask])
ui = iw.VBox([b_im_size, b_geometry, b_intensities, b_target, b_add])
# Function for showing stim
Expand All @@ -322,6 +327,7 @@ def show_rectangular_generalized(
origin=None,
add_mask=False,
intensity_target=None,
rotation=0.0,
):
stim = rectangular_generalized(
visual_size=(height, width),
Expand All @@ -331,6 +337,7 @@ def show_rectangular_generalized(
intensity_background=intensity_background,
origin=origin,
intensity_target=intensity_target,
rotation=rotation,
)
plot_stim(stim, mask=add_mask)
Expand All @@ -351,6 +358,7 @@ out = iw.interactive_output(
"origin": w_ori,
"add_mask": w_mask,
"intensity_target": w_tint,
"rotation": w_rot,
},
)
Expand All @@ -376,6 +384,8 @@ w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int-ring1")
w_int2 = iw.FloatSlider(value=0, min=0, max=1, description="int-ring2")
w_int_back = iw.FloatSlider(value=0.5, min=0, max=1, description="intensity background")
w_rot = iw.FloatSlider(value=0, min=0, max=360, description="rotation [deg]")
w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'frame_mask'], description="add mask")
w_tint = iw.FloatSlider(value=0.5, min=0, max=1, description="target int")
Expand All @@ -385,7 +395,7 @@ b_im_size = iw.HBox([w_height, w_width, w_ppd])
b_geometry = iw.HBox([w_freq, w_phase])
b_intensities = iw.HBox([w_int1, w_int2, w_int_back])
b_target = iw.HBox([w_tint])
b_add = iw.HBox([w_mask])
b_add = iw.HBox([w_rot, w_mask])
ui = iw.VBox([b_im_size, b_geometry, b_intensities, b_target, b_add])
# Function for showing stim
Expand All @@ -400,6 +410,7 @@ def show_rectangular_two_sided(
intensity_background=None,
add_mask=False,
intensity_target=None,
rotation=0.0,
):
stim = rectangular_two_sided(
visual_size=(height, width),
Expand All @@ -409,6 +420,7 @@ def show_rectangular_two_sided(
intensity_frames=(int1, int2),
intensity_background=intensity_background,
intensity_target=intensity_target,
rotation=rotation,
)
plot_stim(stim, mask=add_mask)
Expand All @@ -426,6 +438,7 @@ out = iw.interactive_output(
"intensity_background": w_int_back,
"add_mask": w_mask,
"intensity_target": w_tint,
"rotation": w_rot,
},
)
Expand Down

0 comments on commit 2bd7b98

Please sign in to comment.