Skip to content

Commit

Permalink
Dungeon as toplevel stimulus module
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Mar 20, 2023
1 parent d44417a commit c4449c6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
1 change: 1 addition & 0 deletions stimupy/__init__.py
Expand Up @@ -2,6 +2,7 @@

from . import (
components,
dungeons,
gabors,
illusions,
mondrians,
Expand Down
29 changes: 26 additions & 3 deletions stimupy/illusions/dungeons.py → stimupy/dungeons.py
Expand Up @@ -177,8 +177,31 @@ def resolve_cells_1d(
return n_cells, visual_angle, cell_size


def overview(**kwargs):
"""Generate example stimuli from this module
Returns
-------
stims : dict
dict with all stimuli containing individual stimulus dicts.
"""
default_params = {
"visual_size": 10,
"ppd": 30,
}
default_params.update(kwargs)

# fmt: off
stimuli = {
"Dungeon illusion": dungeon(**default_params, n_cells=5)
}
# fmt: on

return stimuli


if __name__ == "__main__":
from stimupy.utils import plot_stim
from stimupy.utils import plot_stimuli

stim = dungeon(visual_size=10, ppd=10, n_cells=5)
plot_stim(stim, stim_name="dungeon", mask=True, save=None)
stims = overview()
plot_stimuli(stims, mask=True, save=None)
3 changes: 0 additions & 3 deletions stimupy/illusions/__init__.py
Expand Up @@ -6,7 +6,6 @@
cornsweets,
cubes,
delboeufs,
dungeons,
frames,
gratings,
hermanns,
Expand Down Expand Up @@ -63,8 +62,6 @@ def create_overview():
# Delbouef
"delboeuf": delboeufs.delboeuf(**p, outer_radius=4, target_radius=1),
"2sided_delboeuf": delboeufs.two_sided(**p, outer_radii=(2, 1.1), target_radius=1),
# Dungeon
"dungeon": dungeons.dungeon(**p, n_cells=5),
# Frames
"frames": frames.rings(**p, frequency=0.5, target_indices=3),
"frames_general": frames.rings_generalized(**p, radii=(1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5), target_indices=3),
Expand Down
4 changes: 2 additions & 2 deletions stimupy/papers/domijan2015.py
Expand Up @@ -223,13 +223,13 @@ def dungeon(visual_size=VSIZES["dungeon"], ppd=PPD, shape=SHAPES["dungeon"]):
}

# Generate each side
stim1 = illusions.dungeons.dungeon(
stim1 = stimupy.dungeons.dungeon(
**params,
intensity_background=v1,
intensity_grid=v3,
intensity_target=v2,
)
stim2 = illusions.dungeons.dungeon(
stim2 = stimupy.dungeons.dungeon(
**params,
intensity_background=v3,
intensity_grid=v1,
Expand Down

0 comments on commit c4449c6

Please sign in to comment.