Skip to content

Commit

Permalink
adapted post-rotation treatment of triangles to ensure straight lines…
Browse files Browse the repository at this point in the history
… in benarys cross
  • Loading branch information
LynnSchmittwilken committed Jul 25, 2022
1 parent 4437ea2 commit e8abeaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions stimuli/illusions/benary_cross.py
Expand Up @@ -85,8 +85,9 @@ def benarys_cross(

# Rotate, resize to original shape and clean
tpatch = rotate(tpatch, angle=target_ori[i])
tpatch[tpatch < vtarget * 0.9] = 0.0
tpatch[tpatch > vtarget * 0.9] = vtarget
thresh = 0.7
tpatch[tpatch < vtarget * thresh] = 0.0
tpatch[tpatch > vtarget * thresh] = vtarget
tpatch = tpatch[
~np.all(tpatch == 0, axis=1)
] # Remove all rows with only zeros
Expand Down Expand Up @@ -205,8 +206,9 @@ def todorovic_benary(

# Rotate, resize to original shape and clean
tpatch = rotate(tpatch, angle=target_ori[i])
tpatch[tpatch < vtarget * 0.9] = 0.0
tpatch[tpatch > vtarget * 0.9] = vtarget
thresh = 0.7
tpatch[tpatch < vtarget * thresh] = 0.0
tpatch[tpatch > vtarget * thresh] = vtarget
tpatch = tpatch[
~np.all(tpatch == 0, axis=1)
] # Remove all rows with only zeros
Expand Down
8 changes: 4 additions & 4 deletions stimuli/papers/RHS2007.py
Expand Up @@ -841,7 +841,7 @@ def benary_cross(ppd=PPD, pad=True):
target_type=("t", "t"),
target_ori=(45.0, 0.0),
target_size=(2.5, 2.5),
target_posx=(9.5 - np.sqrt(11.25), 13.5),
target_posx=(9.5 - np.sqrt(12.5)+2/ppd, 13.5),
target_posy=(4.5, 2.0),
vback=vback,
vcross=0.0,
Expand Down Expand Up @@ -892,7 +892,7 @@ def todorovic_benary3_4(ppd=PPD, pad=True):
target_type=("t", "t"),
target_ori=(45.0, 225.0),
target_posx=(9.5, 18.0),
target_posy=(6.5, 6.5 - np.sqrt(11.25) / 2.0),
target_posy=(6.5, 6.5 - np.sqrt(12.5)/2.+1/ppd),
vback=vback,
vcross=0.0,
vtarget=vtarget,
Expand All @@ -916,7 +916,7 @@ def todorovic_benary1_2_3_4(ppd=PPD, pad=True):
target_type=("t", "t", "t", "t"),
target_ori=(0.0, 45.0, 225.0, 180.0),
target_posx=(2.5, 9.5, 18.0, 26.0),
target_posy=(4.0, 6.5, 6.5 - np.sqrt(11.25) / 2.0, 6.5),
target_posy=(4.0, 6.5, 6.5 - np.sqrt(12.5)/2.+1/ppd, 6.5),
vback=vback,
vcross=0.0,
vtarget=vtarget,
Expand Down Expand Up @@ -1022,4 +1022,4 @@ def bullseye_thick(ppd=PPD, pad=True):
from stimuli.utils import plot_stimuli

stims = gen_all(pad=False, skip=True)
plot_stimuli(stims, mask=False)
plot_stimuli(stims, mask=True)

0 comments on commit e8abeaf

Please sign in to comment.