From f6c7636ac63d3965b5fe813cbf452f93c963ddd7 Mon Sep 17 00:00:00 2001 From: lynnschmittwilken Date: Fri, 24 Mar 2023 14:58:03 -0400 Subject: [PATCH] closes #13; renamed shape_masks and grating_masks in checkerboard --- docs/reference/demos/stimuli/benarys.md | 12 ++++----- docs/reference/demos/stimuli/checkerboards.md | 4 +-- stimupy/components/gaussians.py | 2 +- stimupy/components/lines.py | 6 ++--- stimupy/components/shapes.py | 26 ++++++++++--------- stimupy/stimuli/benarys.py | 8 +++--- stimupy/stimuli/checkerboards.py | 8 +++--- stimupy/stimuli/gratings.py | 8 +++--- stimupy/stimuli/mondrians.py | 2 +- stimupy/stimuli/pinwheels.py | 2 +- stimupy/stimuli/sbcs.py | 12 ++++----- stimupy/stimuli/todorovics.py | 10 +++---- stimupy/stimuli/waves.py | 8 +++--- stimupy/stimuli/whites.py | 16 ++++++------ 14 files changed, 64 insertions(+), 60 deletions(-) diff --git a/docs/reference/demos/stimuli/benarys.md b/docs/reference/demos/stimuli/benarys.md index 9eae4062..8e8a360a 100644 --- a/docs/reference/demos/stimuli/benarys.md +++ b/docs/reference/demos/stimuli/benarys.md @@ -53,7 +53,7 @@ w_trot = iw.IntSlider(value=0, min=0, max=360, description="target rotation [deg w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int cross") w_int_back = iw.FloatSlider(value=0, min=0, max=1, description="int background") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'shape_mask'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'cross_mask'], description="add mask") # Layout b_im_size = iw.HBox([w_height, w_width, w_ppd]) @@ -141,7 +141,7 @@ w_tint = iw.FloatSlider(value=0.5, min=0, max=1, description="target int") w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int cross") w_int_back = iw.FloatSlider(value=0, min=0, max=1, description="int background") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'shape_mask'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'cross_mask'], description="add mask") # Layout b_im_size = iw.HBox([w_height, w_width, w_ppd]) @@ -215,7 +215,7 @@ w_tint = iw.FloatSlider(value=0.5, min=0, max=1, description="target int") w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int cross") w_int_back = iw.FloatSlider(value=0, min=0, max=1, description="int background") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'shape_mask'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'cross_mask'], description="add mask") # Layout b_im_size = iw.HBox([w_height, w_width, w_ppd]) @@ -293,7 +293,7 @@ w_trot = iw.IntSlider(value=0, min=0, max=360, description="target rotation [deg w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int cross") w_int_back = iw.FloatSlider(value=0, min=0, max=1, description="int background") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'shape_mask'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'L_mask'], description="add mask") # Layout b_im_size = iw.HBox([w_height, w_width, w_ppd]) @@ -381,7 +381,7 @@ w_tint = iw.FloatSlider(value=0.5, min=0, max=1, description="target int") w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int cross") w_int_back = iw.FloatSlider(value=0, min=0, max=1, description="int background") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'shape_mask'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'L_mask'], description="add mask") # Layout b_im_size = iw.HBox([w_height, w_width, w_ppd]) @@ -455,7 +455,7 @@ w_tint = iw.FloatSlider(value=0.5, min=0, max=1, description="target int") w_int1 = iw.FloatSlider(value=1, min=0, max=1, description="int cross") w_int_back = iw.FloatSlider(value=0, min=0, max=1, description="int background") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'shape_mask'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'L_mask'], description="add mask") # Layout b_im_size = iw.HBox([w_height, w_width, w_ppd]) diff --git a/docs/reference/demos/stimuli/checkerboards.md b/docs/reference/demos/stimuli/checkerboards.md index 2a65af36..1f28a818 100644 --- a/docs/reference/demos/stimuli/checkerboards.md +++ b/docs/reference/demos/stimuli/checkerboards.md @@ -48,7 +48,7 @@ w_int2 = iw.FloatSlider(value=0., min=0, max=1, description="int2") w_period = iw.Dropdown(value="ignore", options=['ignore', 'even', 'odd', 'either'], description="period") w_round = iw.ToggleButton(value=False, disabled=False, description="round check width") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'checker_mask', 'grating_mask', 'grating_mask2'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'checker_mask', 'row_mask', 'col_mask'], description="add mask") w_tidxx = iw.IntSlider(value=0, min=0, max=10, description="target x-idx") w_tidxy = iw.IntSlider(value=0, min=0, max=10, description="target y-idx") @@ -142,7 +142,7 @@ w_int2 = iw.FloatSlider(value=0., min=0, max=1, description="int2") w_period = iw.Dropdown(value="ignore", options=['ignore', 'even', 'odd', 'either'], description="period") w_round = iw.ToggleButton(value=False, disabled=False, description="round check width") -w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'checker_mask', 'grating_mask', 'grating_mask2'], description="add mask") +w_mask = iw.Dropdown(value=None, options=[None, 'target_mask', 'checker_mask', 'row_mask', 'col_mask'], description="add mask") w_tidxy = iw.IntSlider(value=5, min=0, max=10, description="target height") w_tidxx = iw.IntSlider(value=5, min=0, max=10, description="target width") diff --git a/stimupy/components/gaussians.py b/stimupy/components/gaussians.py index 772bd138..f4d3aace 100644 --- a/stimupy/components/gaussians.py +++ b/stimupy/components/gaussians.py @@ -82,7 +82,7 @@ def gaussian( rotation=rotation, origin=origin, restrict_size=False, - )["shape_mask"] + )["ellipse_mask"] stim = { "img": gaussian, diff --git a/stimupy/components/lines.py b/stimupy/components/lines.py index 91b58ce7..4f914fc2 100644 --- a/stimupy/components/lines.py +++ b/stimupy/components/lines.py @@ -290,9 +290,9 @@ def ellipse( origin="mean", ) - stim["img"] = np.where(stim2["shape_mask"] == 1, intensity_background, stim["img"]) - stim["line_mask"] = np.where(stim2["shape_mask"] == 1, 0, stim["shape_mask"]) - del stim["shape_mask"] + stim["img"] = np.where(stim2["ellipse_mask"] == 1, intensity_background, stim["img"]) + stim["line_mask"] = np.where(stim2["ellipse_mask"] == 1, 0, stim["ellipse_mask"]) + del stim["ellipse_mask"] return stim diff --git a/stimupy/components/shapes.py b/stimupy/components/shapes.py index b77bba97..2c8019d8 100644 --- a/stimupy/components/shapes.py +++ b/stimupy/components/shapes.py @@ -55,7 +55,7 @@ def rectangle( ------- dict[str, Any] dict with the stimulus (key: "img"), - mask with integer index for the shape (key: "shape_mask"), + mask with integer index for the shape (key: "rectangle_mask"), and additional keys containing stimulus parameters """ if rectangle_size is None: @@ -125,7 +125,7 @@ def rectangle( return { "img": img * (intensity_rectangle - intensity_background) + intensity_background, - "shape_mask": img.astype(int), + "rectangle_mask": img.astype(int), "visual_size": base["visual_size"], "ppd": base["ppd"], "shape": base["shape"], @@ -170,7 +170,7 @@ def triangle( ------- dict[str, Any] dict with the stimulus (key: "img"), - mask with integer index for the shape (key: "shape_mask"), + mask with integer index for the shape (key: "triangle_mask"), and additional keys containing stimulus parameters """ if triangle_size is None: @@ -209,11 +209,11 @@ def triangle( rectangle_size=triangle_size, rotation=rotation, ) - img = img * rect["shape_mask"] + img = img * rect["rectangle_mask"] return { "img": img * (intensity_triangle - intensity_background) + intensity_background, - "shape_mask": img.astype(int), + "triangle_mask": img.astype(int), "visual_size": base["visual_size"], "ppd": base["ppd"], "shape": base["shape"], @@ -262,7 +262,7 @@ def cross( ------- dict[str, Any] dict with the stimulus (key: "img"), - mask with integer index for the shape (key: "shape_mask"), + mask with integer index for the shape (key: "cross_mask"), and additional keys containing stimulus parameters """ if cross_size is None: @@ -319,7 +319,7 @@ def cross( return { "img": img * (intensity_cross - intensity_background) + intensity_background, - "shape_mask": img.astype(int), + "cross_mask": img.astype(int), "shape": shape, "visual_size": visual_size, "ppd": ppd, @@ -364,7 +364,7 @@ def parallelogram( ------- dict[str, Any] dict with the stimulus (key: "img"), - mask with integer index for the shape (key: "shape_mask"), + mask with integer index for the shape (key: "parallelogram_mask"), and additional keys containing stimulus parameters """ if parallelogram_size is None: @@ -433,7 +433,7 @@ def parallelogram( return { "img": img * (intensity_parallelogram - intensity_background) + intensity_background, - "shape_mask": img.astype(int), + "parallelogram_mask": img.astype(int), "shape": base["shape"], "visual_size": base["visual_size"], "ppd": base["ppd"], @@ -484,7 +484,7 @@ def ellipse( ------- dict[str, Any] dict with the stimulus (key: "img"), - mask with integer index for the shape (key: "shape_mask"), + mask with integer index for the shape (key: "ellipse_mask"), and additional keys containing stimulus parameters """ if radius is None: @@ -525,7 +525,7 @@ def ellipse( return { "img": img * (intensity_ellipse - intensity_background) + intensity_background, - "shape_mask": img.astype(int), + "ellipse_mask": img.astype(int), "shape": base["shape"], "visual_size": base["visual_size"], "ppd": base["ppd"], @@ -573,7 +573,7 @@ def circle( ---------- dict[str, Any] dict with the stimulus (key: "img"), - mask with integer index for the shape (key: "shape_mask"), + mask with integer index for the shape (key: "circle_mask"), and additional keys containing stimulus parameters """ if radius is None: @@ -592,6 +592,8 @@ def circle( origin=origin, restrict_size=restrict_size, ) + stim["circle_mask"] = stim["ellipse_mask"] + stim.pop("ellipse_mask") return stim diff --git a/stimupy/stimuli/benarys.py b/stimupy/stimuli/benarys.py index 46fd0b8f..5449c663 100644 --- a/stimupy/stimuli/benarys.py +++ b/stimupy/stimuli/benarys.py @@ -393,7 +393,7 @@ def todorovic_generalized( stim["L_width"] = L_width stim["intensity_background"] = intensity_background stim["intensity_cross"] = intensity_cross - stim["shape_mask"] = mask + stim["L_mask"] = mask return stim @@ -677,6 +677,8 @@ def add_targets( intensity_background=0, rotation=target_rotation[i], ) + mpatch = target["rectangle_mask"][~np.all(target["rectangle_mask"] == 0, axis=1)] + tpatch = target["img"][~np.all(target["rectangle_mask"] == 0, axis=1)] elif target_type[i] == "t": target = triangle( @@ -688,13 +690,13 @@ def add_targets( rotation=target_rotation[i], include_corners=True, ) + mpatch = target["triangle_mask"][~np.all(target["triangle_mask"] == 0, axis=1)] + tpatch = target["img"][~np.all(target["triangle_mask"] == 0, axis=1)] else: raise Exception("You can only use r or t as shapes") # Remove zero-rows and -columns - mpatch = target["shape_mask"][~np.all(target["shape_mask"] == 0, axis=1)] - tpatch = target["img"][~np.all(target["shape_mask"] == 0, axis=1)] tpatch = tpatch[:, ~np.all(mpatch == 0, axis=0)] mpatch = mpatch[:, ~np.all(mpatch == 0, axis=0)] theight_, twidth_ = tpatch.shape diff --git a/stimupy/stimuli/checkerboards.py b/stimupy/stimuli/checkerboards.py index ad1b3ab7..758bab3c 100644 --- a/stimupy/stimuli/checkerboards.py +++ b/stimupy/stimuli/checkerboards.py @@ -38,8 +38,8 @@ def mask_from_idx(checkerboard_stim, check_idc): for i, coords in enumerate(check_idc): if coords[0] < 0 or coords[0] > coords[0] or coords[1] < 0 or coords[1] > board_shape[1]: raise ValueError(f"Cannot provide mask for check {coords} outside board {board_shape}") - m1 = np.where(checkerboard_stim["grating_mask"] == coords[1] + 1, 1, 0) - m2 = np.where(checkerboard_stim["grating_mask2"] == coords[0] + 1, 1, 0) + m1 = np.where(checkerboard_stim["col_mask"] == coords[1] + 1, 1, 0) + m2 = np.where(checkerboard_stim["row_mask"] == coords[0] + 1, 1, 0) mask = np.where(m1 + m2 == 2, i + 1, mask) if len(np.unique(mask)) == 1: @@ -281,8 +281,8 @@ def checkerboard( stim = { "img": img, "checker_mask": mask.astype(int), - "grating_mask": sw1["grating_mask"], - "grating_mask2": sw2["grating_mask"], + "col_mask": sw1["grating_mask"], + "row_mask": sw2["grating_mask"], "visual_size": sw1["visual_size"], "ppd": sw1["ppd"], "shape": sw1["shape"], diff --git a/stimupy/stimuli/gratings.py b/stimupy/stimuli/gratings.py index 4f8ee4fa..0efba557 100644 --- a/stimupy/stimuli/gratings.py +++ b/stimupy/stimuli/gratings.py @@ -453,8 +453,8 @@ def grating_induction( ) # Superimpose - stim["img"] = np.where(target_mask["shape_mask"], intensity_target, stim["img"]) - stim["target_mask"] = np.where(target_mask["shape_mask"], stim["grating_mask"], 0) + stim["img"] = np.where(target_mask["rectangle_mask"], intensity_target, stim["img"]) + stim["target_mask"] = np.where(target_mask["rectangle_mask"], stim["grating_mask"], 0) return stim @@ -569,8 +569,8 @@ def grating_induction_blur( ) # Superimpose - stim["img"] = np.where(target_mask["shape_mask"], intensity_target, stim["img"]) - stim["target_mask"] = np.where(target_mask["shape_mask"], stim["grating_mask"], 0) + stim["img"] = np.where(target_mask["rectangle_mask"], intensity_target, stim["img"]) + stim["target_mask"] = np.where(target_mask["rectangle_mask"], stim["grating_mask"], 0) return stim diff --git a/stimupy/stimuli/mondrians.py b/stimupy/stimuli/mondrians.py index 6e3804ba..9469ece3 100644 --- a/stimupy/stimuli/mondrians.py +++ b/stimupy/stimuli/mondrians.py @@ -123,7 +123,7 @@ def mondrian( if (ypos + yshape > shape[0]) or (xpos + xshape > shape[1]): raise ValueError("Not all Mondrians fit into the stimulus") mask_large = np.zeros(shape) - mask_large[ypos : ypos + yshape, xpos : xpos + xshape] = patch["shape_mask"] + mask_large[ypos : ypos + yshape, xpos : xpos + xshape] = patch["parallelogram_mask"] img[mask_large == 1] = next(ints) mask[mask_large == 1] = m + 1 diff --git a/stimupy/stimuli/pinwheels.py b/stimupy/stimuli/pinwheels.py index 494f0bf8..4049abb5 100644 --- a/stimupy/stimuli/pinwheels.py +++ b/stimupy/stimuli/pinwheels.py @@ -108,7 +108,7 @@ def pinwheel( shape=shape, radius=radius, origin=origin, - )["shape_mask"] + )["circle_mask"] stim["img"] = np.where(circle_mask, stim["img"], intensity_background) diff --git a/stimupy/stimuli/sbcs.py b/stimupy/stimuli/sbcs.py index aaee666a..802371ca 100644 --- a/stimupy/stimuli/sbcs.py +++ b/stimupy/stimuli/sbcs.py @@ -68,12 +68,12 @@ def generalized( intensity_rectangle=intensity_target, ) - stim["target_mask"] = stim["shape_mask"] + stim["target_mask"] = stim["rectangle_mask"] stim["target_size"] = stim["rectangle_size"] stim["target_position"] = stim["rectangle_position"] stim["intensity_target"] = stim["intensity_rectangle"] del ( - stim["shape_mask"], + stim["rectangle_mask"], stim["rectangle_size"], stim["rectangle_position"], stim["intensity_rectangle"], @@ -308,11 +308,11 @@ def with_dots( intensity_rectangle=intensity_target, ) img = sbc["img"] - mask = sbc["shape_mask"] + mask = sbc["rectangle_mask"] patch = np.tile(patch, (int(n_dots[0]), int(n_dots[1]))) img = np.where(patch == 1, intensity_dots, sbc["img"]) - mask = np.where(patch == 1, 0, sbc["shape_mask"]) + mask = np.where(patch == 1, 0, sbc["rectangle_mask"]) try: img = pad_to_shape(img, shape, intensity_background) @@ -537,8 +537,8 @@ def dotted( patch = np.tile(patch, (int(n_dots[0]), int(n_dots[1]))) img = np.where(patch, intensity_dots, intensity_background) - img = np.where(patch + sbc["shape_mask"] == 2, intensity_target, img) - mask = np.where(patch + sbc["shape_mask"] == 2, 1, 0) + img = np.where(patch + sbc["rectangle_mask"] == 2, intensity_target, img) + mask = np.where(patch + sbc["rectangle_mask"] == 2, 1, 0) try: img = pad_to_shape(img, shape, intensity_background) diff --git a/stimupy/stimuli/todorovics.py b/stimupy/stimuli/todorovics.py index 72f2fb16..4e3fd435 100644 --- a/stimupy/stimuli/todorovics.py +++ b/stimupy/stimuli/todorovics.py @@ -110,7 +110,7 @@ def rectangle_generalized( intensity_rectangle=intensity_target, ) img = stim["img"] - mask = stim["shape_mask"] + mask = stim["rectangle_mask"] # Add covers cheight, cwidth = resolution.lengths_from_visual_angles_ppd( @@ -442,7 +442,7 @@ def cross_generalized( stim = pad_dict_to_shape(stim, shape=shape, pad_value=intensity_background) img = stim["img"] - mask = stim["shape_mask"] + mask = stim["cross_mask"] cheight, cwidth = resolution.lengths_from_visual_angles_ppd( covers_size, np.unique(ppd), round=False @@ -480,7 +480,7 @@ def cross_generalized( stim["visual_size"] = visual_size stim["ppd"] = ppd stim["shape"] = shape - del (stim["cross_size"], stim["intensity_cross"], stim["shape_mask"]) + del (stim["cross_size"], stim["intensity_cross"], stim["cross_mask"]) return stim @@ -757,8 +757,8 @@ def equal( rectangle_size=cross_size, ) - stim["img"] = np.where(window["shape_mask"], stim["img"], intensity_background) - stim["target_mask"] = np.where(window["shape_mask"], stim["target_mask"], 0).astype(int) + stim["img"] = np.where(window["rectangle_mask"], stim["img"], intensity_background) + stim["target_mask"] = np.where(window["rectangle_mask"], stim["target_mask"], 0).astype(int) return stim diff --git a/stimupy/stimuli/waves.py b/stimupy/stimuli/waves.py index bab2e100..2650c889 100644 --- a/stimupy/stimuli/waves.py +++ b/stimupy/stimuli/waves.py @@ -823,8 +823,8 @@ def sine_rectilinear( ppd=stim["ppd"], rectangle_size=rsize, ) - stim["img"] = np.where(rect["shape_mask"], stim["img"], intensity_background) - stim["grating_mask"] = np.where(rect["shape_mask"], stim["grating_mask"], 0) + stim["img"] = np.where(rect["rectangle_mask"], stim["img"], intensity_background) + stim["grating_mask"] = np.where(rect["rectangle_mask"], stim["grating_mask"], 0) # Add targets(?) if target_indices is not None and target_indices != (): @@ -952,8 +952,8 @@ def square_rectilinear( ppd=stim["ppd"], rectangle_size=rsize, ) - stim["img"] = np.where(rect["shape_mask"], stim["img"], intensity_background) - stim["grating_mask"] = np.where(rect["shape_mask"], stim["grating_mask"], 0) + stim["img"] = np.where(rect["rectangle_mask"], stim["img"], intensity_background) + stim["grating_mask"] = np.where(rect["rectangle_mask"], stim["grating_mask"], 0) # Add targets(?) if target_indices is not None and target_indices != (): diff --git a/stimupy/stimuli/whites.py b/stimupy/stimuli/whites.py index 82789a8a..faec8e75 100644 --- a/stimupy/stimuli/whites.py +++ b/stimupy/stimuli/whites.py @@ -152,7 +152,7 @@ def generalized( # Find where strip intersects with the target bar if bar_idx < 0: bar_idx = int(stim["n_bars"]) + bar_idx - mask = (stim["grating_mask"] == bar_idx + 1) & rect["shape_mask"] + mask = (stim["grating_mask"] == bar_idx + 1) & rect["rectangle_mask"] targets_mask = np.where(mask, target_idx + 1, targets_mask) # Draw target @@ -489,8 +489,8 @@ def anderson( for bar_idx in stim["target_indices_top"]: if bar_idx < 0: bar_idx = int(stim["n_bars"]) + bar_idx - stripe_top["shape_mask"] = np.where( - stim["grating_mask"] == bar_idx + 1, 0, stripe_top["shape_mask"] + stripe_top["rectangle_mask"] = np.where( + stim["grating_mask"] == bar_idx + 1, 0, stripe_top["rectangle_mask"] ) stripe_bottom = rectangle( @@ -503,12 +503,12 @@ def anderson( for bar_idx in stim["target_indices_bottom"]: if bar_idx < 0: bar_idx = int(stim["n_bars"]) + bar_idx - stripe_bottom["shape_mask"] = np.where( - stim["grating_mask"] == bar_idx + 1, 0, stripe_bottom["shape_mask"] + stripe_bottom["rectangle_mask"] = np.where( + stim["grating_mask"] == bar_idx + 1, 0, stripe_bottom["rectangle_mask"] ) try: - stripes_mask = combine_masks(stripe_top["shape_mask"], stripe_bottom["shape_mask"]) + stripes_mask = combine_masks(stripe_top["rectangle_mask"], stripe_bottom["rectangle_mask"]) except ValueError: raise ValueError("Stripes overlap. Increase stripe offset or decrease stripe size.") @@ -734,7 +734,7 @@ def yazdanbakhsh( # Reduce to just this bar: intersection between rect mask and bar mask if bar_idx < 0: bar_idx = int(stim["n_bars"]) + bar_idx - stim["gap_mask"] = (stim["grating_mask"] == bar_idx + 1) & rect["shape_mask"] + stim["gap_mask"] = (stim["grating_mask"] == bar_idx + 1) & rect["rectangle_mask"] # Remove everywhere it intersects with target mask stim["gap_mask"] = np.where(stim["target_mask"] == t_idx + 1, 0, stim["gap_mask"]) @@ -758,7 +758,7 @@ def yazdanbakhsh( # Reduce to just this bar: intersection between rect mask and bar mask if bar_idx < 0: bar_idx = int(stim["n_bars"]) + bar_idx - stim["gap_mask"] = (stim["grating_mask"] == bar_idx + 1) & rect["shape_mask"] + stim["gap_mask"] = (stim["grating_mask"] == bar_idx + 1) & rect["rectangle_mask"] # Remove everywhere it intersects with target mask stim["gap_mask"] = np.where(stim["target_mask"] == t_idx + 1, 0, stim["gap_mask"])