Skip to content

Commit

Permalink
Domijan (2015) stimuli generating in papers/domijan2015
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Jun 14, 2022
1 parent c9d16fe commit 8e49d99
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 231 deletions.
18 changes: 1 addition & 17 deletions stimuli/illusions/benary_cross.py
Expand Up @@ -73,24 +73,8 @@ def benarys_cross(

return {"img": img, "mask": mask}

def domijan2015():
"""
Generates Benary Cross illusion as used in the Domijan 2015 paper.
"""

return benarys_cross(
ppd=10,
cross_size=(3, 3, 3, 3),
cross_thickness=2.1,
padding=(0.9, 1.0, 0.9, 1.0),
target_size=1.1,
back=9.0,
cross=1.0,
target=5.0,
)


if __name__ == '__main__':
if __name__ == "__main__":
import matplotlib.pyplot as plt
stim = benarys_cross()
plot_stim(stim, mask=True)
18 changes: 0 additions & 18 deletions stimuli/illusions/bullseye.py
Expand Up @@ -46,24 +46,6 @@ def bullseye_illusion(ppd=10, n_rings=8, ring_width=.5, target_pos_l=0, target_p
return {"img": img, "mask": mask}


def domijan2015():
"""
Generates Bullseye illusion as used in the Domijan 2015 paper.
"""

img = bullseye_illusion(
n_rings=8,
ring_width=0.5,
target_pos_l=0,
target_pos_r=0,
padding=(0.9, 1.0, 0.9, 1.0),
back=1.0,
rings=9.0,
target=5.0,
)
return img


def RHS2007_bullseye_thin():
"""
Generates Bullseye thin illusion as used in the Robinson, Hammon and de Sa 2007 paper.
Expand Down
19 changes: 1 addition & 18 deletions stimuli/illusions/checkerboard_contrast_contrast.py
Expand Up @@ -88,24 +88,7 @@ def checkerboard_contrast_contrast_effect(
return {"img": img, "mask": mask}


def domijan2015():
"""
Generates checkerboard contrast contrast illusion as used in Domijan 2015 paper.
"""
return checkerboard_contrast_contrast_effect(
ppd=10,
n_checks=8,
check_size=1.0,
target_length=4,
padding=(0.9, 1.1, 0.9, 1.1),
check1=1.0,
check2=9.0,
tau=5,
alpha=0.5,
)


if __name__ == '__main__':
if __name__ == "__main__":
import matplotlib.pyplot as plt
stim = checkerboard_contrast_contrast_effect()
plot_stim(stim, mask=True)
42 changes: 0 additions & 42 deletions stimuli/illusions/checkerboard_sbc.py
Expand Up @@ -71,48 +71,6 @@ def checkerboard_contrast(ppd=10, board_shape=(8,8), check_size=1.0, targets_coo
return {"img": img, "mask": mask}


def domijan2015():
"""
Generates checkerboard_sbc illusion as used in Domijan 2015 paper.
"""
stim = checkerboard_contrast(
ppd=10,
board_shape=(8, 8),
check_size=1.0,
targets_coords=((3, 2), (5, 5)),
extend_targets=False,
check1=1.0,
check2=9.0,
target=5.0,
)
padding = (0.9, 1.1, 0.9, 1.1)
img = pad_img(stim['img'], padding, ppd=10, val=5.0)
mask = pad_img(stim['mask'], padding, ppd=10, val=0)

return {"img": img, "mask": mask}


def domijan2015_extended():
"""
Generates checkerboard_sbc extended illusion as used in Domijan 2015 paper.
"""
stim = checkerboard_contrast(
ppd=10,
board_shape=(8, 8),
check_size=1.0,
targets_coords=((3, 2), (5, 5)),
extend_targets=True,
check1=1.0,
check2=9.0,
target=5.0,
)
padding = (0.9, 1.1, 0.9, 1.1)
img = pad_img(stim['img'], padding, ppd=10, val=5.0)
mask = pad_img(stim['mask'], padding, ppd=10, val=0)

return {"img": img, "mask": mask}


def RHS2007_Checkerboard016():
"""
Generates checkerboard 0.16 illusion as used in Robinson, Hammon and de Sa 2007 paper.
Expand Down
21 changes: 1 addition & 20 deletions stimuli/illusions/cube.py
Expand Up @@ -181,26 +181,7 @@ def cube_illusion(
return {"img": img, "mask": mask}


def domijan2015():
return cube_illusion(
ppd=10,
n_cells=4,
target_length=2,
cell_long=1.5,
cell_short=1.1,
corner_cell_width=1.8,
corner_cell_height=1.8,
cell_spacing=0.5,
padding=(0.9, 1.0, 0.9, 1.0),
occlusion_overlap=(0.7, 0.7, 0.7, 0.7),
back=1.0,
grid=9.0,
target=5.0,
double=True,
)


if __name__ == '__main__':
if __name__ == "__main__":
import matplotlib.pyplot as plt
stim = cube_illusion()
plot_stim(stim, mask=True)
14 changes: 0 additions & 14 deletions stimuli/illusions/dungeon.py
Expand Up @@ -94,20 +94,6 @@ def dungeon_illusion(



def domijan2015():
return dungeon_illusion(
ppd=10,
n_cells=5,
target_radius=1,
cell_size=1.0,
padding=(0.9, 1.1, 0.9, 1.1),
back=1.0,
grid=9.0,
target=5.0,
double=True,
)


if __name__ == '__main__':
import matplotlib.pyplot as plt
stim = dungeon_illusion()
Expand Down
16 changes: 1 addition & 15 deletions stimuli/illusions/grating.py
Expand Up @@ -95,21 +95,7 @@ def grating_illusion(
return {"img": img, "mask": mask}


def domijan2015():
return grating_illusion(
ppd=10,
n_bars=5,
target_length=1,
bar_width=1.0,
bar_height=8.1,
padding=(0.9, 1.0, 0.9, 1.1),
back=1,
grid=9,
target=5,
double=True,
)


if __name__ == "__main__":
if __name__ == '__main__':
import matplotlib.pyplot as plt
stim = grating_illusion()
Expand Down
19 changes: 1 addition & 18 deletions stimuli/illusions/rings.py
Expand Up @@ -114,24 +114,7 @@ def ring_pattern(
return {"img": img, "mask": mask}


def domijan2015():
img = ring_pattern(
ppd=10,
n_rings=8,
target_pos_l=4,
target_pos_r=3,
ring_width=0.5,
padding=(0.9, 1.0, 0.9, 1.0),
back=1.0,
rings=9.0,
target=5.0,
invert_rings=False,
double=True,
)
return img


if __name__ == '__main__':
if __name__ == "__main__":
import matplotlib.pyplot as plt
stim = ring_pattern()
plot_stim(stim, mask=True)
12 changes: 0 additions & 12 deletions stimuli/illusions/sbc.py
Expand Up @@ -59,18 +59,6 @@ def simultaneous_brightness_contrast(
return {"img": img, "mask": mask}


def domijan2015():
return simultaneous_brightness_contrast(
ppd=10,
target_shape=(2.1, 2.1),
inner_padding=(3.9, 4.0, 3.9, 4.0),
padding=(0, 0, 0, 0),
left=9.0,
right=1.0,
target=5.0,
)


def RHS2007_sbc_large():
total_height, total_width, ppd = (32,)*3
height, width = 12, 15
Expand Down
13 changes: 0 additions & 13 deletions stimuli/illusions/todorovic.py
Expand Up @@ -144,19 +144,6 @@ def todorovic_illusion(
return {"img": img, "mask": mask}


def domijan2015():
return todorovic_illusion(
target_shape=(4.1, 4.1),
ppd=10,
covers_shape=(3.1, 3.1),
spacing=(1.5, 1.5, 1.5, 1.5),
padding=(2.9, 3.0, 2.9, 3.0),
grid=9.0,
back=1.0,
target=5.0,
)


def RHS2007_todorovic_equal():
total_height, total_width, ppd = (32,) * 3
height, width = 12, 15
Expand Down
22 changes: 0 additions & 22 deletions stimuli/illusions/whites.py
Expand Up @@ -754,28 +754,6 @@ def RHS2007_WE_circular025():
return {"img": img, "mask": mask}


def domijan2015_white():
height, width, ppd = 8.1, 8.0, 10
n_cycles = 4
frequency = n_cycles / width
return white(
shape=(height, width),
ppd=ppd,
frequency=frequency,
high=9.0,
low=1.0,
target=5.0,
period="ignore",
start="low",
target_indices=(3, 6),
target_height=2.1,
targets_offset=0,
orientation="horizontal",
padding=(0.9, 1.0, 0.9, 1.1),
padding_val=5.0,
)


if __name__ == "__main__":
stim = white()
plt.subplot(4, 2, 1)
Expand Down

0 comments on commit 8e49d99

Please sign in to comment.