Skip to content

Commit

Permalink
Grating component outputs stim_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Dec 6, 2022
1 parent ce11bd4 commit ba65627
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 1 addition & 10 deletions stimuli/components/grating.py
Expand Up @@ -297,16 +297,7 @@ def square_wave(
for bar_idx, intensity in zip(np.unique(mask), ints):
img = np.where(mask == bar_idx, intensity, img)

stim = {
"img": img,
"ppd": ppd,
"visual_size": np.array(img.shape) / ppd,
"shape": img.shape,
"frequency": frequency,
"intensity_bars": intensity_bars,
"period": period,
}
return stim
return {"img": img, **stim}


def square_wave_grating(
Expand Down
6 changes: 4 additions & 2 deletions stimuli/illusions/whites.py
Expand Up @@ -83,12 +83,14 @@ def white_generalized(
if len(target_sizes) != len(target_indices):
raise ValueError("# of target indices != # of target sizes")

img = square_wave(
stim = square_wave(
visual_size=visual_size,
ppd=ppd,
frequency=grating_frequency,
intensity_bars=intensity_bars,
period=period)["img"]
period=period,
)
img = stim["img"]
mask = np.zeros((height_px, width_px))
height, width = img.shape

Expand Down

0 comments on commit ba65627

Please sign in to comment.