Attention
To run locally, the code for these interactive demos requires a Jupyter Notebook environment, and the Panel extension.
Sine, radial#
stimupy.stimuli.waves.sine_radial()
import param
class SineRadialParams(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")
frequency = param.Number(default=1, bounds=(0, 2), step=0.1, doc="Frequency in cpd")
phase_shift = param.Number(default=0, bounds=(0, 360), step=1, doc="Phase shift in degrees")
rotation = param.Number(default=0, bounds=(0, 360), step=1, doc="Rotation in degrees")
intensities_low = param.Number(default=0, bounds=(0, 1), step=0.01, doc="Low intensity")
intensities_high = param.Number(default=1, bounds=(0, 1), step=0.01, doc="High intensity")
clip = param.Boolean(default=False, doc="Clip stimulus")
intensity_background = param.Number(default=0.5, bounds=(0, 1), step=0.01, doc="Background intensity")
origin = param.Selector(default="mean", objects=["mean", "corner", "center"], doc="Origin")
def get_stimulus_params(self):
return {
"visual_size": (self.height, self.width),
"ppd": self.ppd,
"frequency": self.frequency,
"phase_shift": self.phase_shift,
"rotation": self.rotation,
"intensities": (self.intensities_low, self.intensities_high),
"clip": self.clip,
"intensity_background": self.intensity_background,
"origin": self.origin,
}
from stimupy.stimuli.waves import sine_radial
from stimupy._docs.display_stimulus import InteractiveStimDisplay
# Create and display the interactive sine_radial
sine_radial_params = SineRadialParams()
disp = InteractiveStimDisplay(sine_radial, sine_radial_params)
disp.layout