Skip to content

Commit

Permalink
Cube 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 c4449c6 commit e87a5de
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
1 change: 1 addition & 0 deletions stimupy/__init__.py
Expand Up @@ -2,6 +2,7 @@

from . import (
components,
cubes,
dungeons,
gabors,
illusions,
Expand Down
39 changes: 22 additions & 17 deletions stimupy/illusions/cubes.py → stimupy/cubes.py
Expand Up @@ -301,28 +301,33 @@ def cube(
return stim


if __name__ == "__main__":
from stimupy.utils import plot_stimuli
def overview(**kwargs):
"""Generate example stimuli from this module
p1 = {
"ppd": 10,
"cell_lengths": (2, 4, 2),
Returns
-------
stims : dict
dict with all stimuli containing individual stimulus dicts.
"""
default_params = {
"ppd": 30,
"cell_thickness": 1,
"cell_spacing": 0.5,
"target_indices": 1,
}
default_params.update(kwargs)

p2 = {
"visual_size": 10,
"ppd": 10,
"n_cells": 5,
"target_indices": (1, 2),
"cell_thickness": 1,
"cell_spacing": 0.5,
# fmt: off
stimuli = {
"Cube stimulus": cube(**default_params, visual_size=10, n_cells=5, target_indices=(1,2)),
"Cube - varying cells": varying_cells(**default_params, cell_lengths=(2,4,2), target_indices=1),
}
# fmt: on

stims = {
"varying cells": varying_cells(**p1),
"cube": cube(**p2),
}
return stimuli


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

stims = overview()
plot_stimuli(stims, mask=True, save=None)
4 changes: 0 additions & 4 deletions stimupy/illusions/__init__.py
Expand Up @@ -4,7 +4,6 @@
checkerboards,
circulars,
cornsweets,
cubes,
delboeufs,
frames,
gratings,
Expand Down Expand Up @@ -56,9 +55,6 @@ def create_overview():
"circular_bullseye_two_sided": circulars.two_sided_bullseye(**p, frequency=1.0),
# Cornsweet
"cornsweet": cornsweets.cornsweet(**p, ramp_width=3),
# Cube
"cube_variable": cubes.varying_cells(ppd=20, cell_lengths=(1, 1.5, 1), cell_thickness=0.5, cell_spacing=0.5, target_indices=1),
"cube": cubes.cube(**p, n_cells=5, target_indices=(1, 2), cell_thickness=1, cell_spacing=0.5),
# 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),
Expand Down
4 changes: 2 additions & 2 deletions stimupy/papers/domijan2015.py
Expand Up @@ -293,13 +293,13 @@ def cube(visual_size=VSIZES["cube"], ppd=PPD, shape=SHAPES["cube"]):
"cell_spacing": 0.5 * visual_resize,
}

stim1 = illusions.cubes.varying_cells(
stim1 = stimupy.cubes.varying_cells(
**params,
intensity_background=v1,
intensity_cells=v3,
intensity_target=v2,
)
stim2 = illusions.cubes.varying_cells(
stim2 = stimupy.cubes.varying_cells(
**params,
intensity_background=v3,
intensity_cells=v1,
Expand Down

0 comments on commit e87a5de

Please sign in to comment.