Attention
To run locally, the code for these interactive demos requires a Jupyter Notebook environment, and the Panel extension.
Annulus (/ Ring)#
stimupy.components.radials.annulus()
import param
class AnnulusParams(param.Parameterized):
# Image size parameters
height = param.Integer(default=10, bounds=(1, 20), doc="Height in degrees")
width = param.Integer(default=10, bounds=(1, 20), doc="Width in degrees")
ppd = param.Integer(default=20, bounds=(1, 40), doc="Pixels per degree")
radius1 = param.Number(default=2, bounds=(1, 4), step=0.01, doc="")
radius2 = param.Number(default=4, bounds=(3, 6), step=0.01, doc="")
intensity_ring = param.Number(default=0.5, bounds=(0, 1), step=0.01, doc="")
intensity_background = param.Number(default=0., bounds=(0, 1), step=0.01, doc="")
origin = param.Selector(default="mean", objects=['mean', 'corner', 'center'], doc="")
mask = param.Boolean(default=False, doc="")
def get_stimulus_params(self):
return {
"visual_size": (self.height, self.width),
"ppd": self.ppd,
"radii": (self.radius1, self.radius2),
"intensity_ring": self.intensity_ring,
"intensity_background": self.intensity_background,
"origin": self.origin,
}
from stimupy.components.radials import annulus
from stimupy._docs.display_stimulus import InteractiveStimDisplay
# Create and display the interactive annulus
annulus_params = AnnulusParams()
disp = InteractiveStimDisplay(annulus, annulus_params)
disp.layout