Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
targetInducerStimulus Class Reference

target inducer stimulus, inherits from baseStimulus More...

Detailed Description

target inducer stimulus, inherits from baseStimulus

Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for targetInducerStimulus:

Public Types

enum  Events { changeScale , changePhaseIncrement }
 
- Public Types inherited from baseStimulus
enum  Events { readPanelUpdate }
 

Public Member Functions

function targetInducerStimulus (in varargin)
 Class constructor.
 
function setup (in obj, in sM)
 Setup this object in preperation for use When displaying a stimulus object, the main properties that are to be modified are copied into cache copies of the property, both to convert from visual description (c/d, Hz, degrees) to computer metrics, and to be animated and modified as independant variables. So xPosition is copied to xPositionOut and converyed from degrees to pixels. The animation and drawing functions use these modified properties, and when they are updated, for example to change to a new xPosition, internal methods ensure reconversion and update any dependent properties. This method initialises the object for display.
 
function set_sfOut (in obj, in value)
 
function set_tfOut (in obj, in value)
 
function set_driftDirectionOut (in obj, in value)
 
function set_sizeOut (in obj, in value)
 
function set_xPositionOut (in obj, in value)
 
function set_yPositionOut (in obj, in value)
 
function update (in obj)
 Update this stimulus object for display.
 
function draw (in obj)
 Draw this stimulus object for display.
 
function animate (in obj)
 Animate this object for runExperiment.
 
function reset (in obj)
 Reset an structure for runExperiment.
 
function set sf (in obj, in value)
 sf Set method
 
function calculatePhase (in obj)
 calculate phase offset
 
- Public Member Functions inherited from baseStimulus
virtual setup (in runObject)
 ALL Children must implement these 5 methods!
 
function baseStimulus (in varargin)
 Class constructor.
 
function set colour (in me, in value)
 colour set method Allow 1 (R=G=B) 3 (RGB) or 4 (RGBA) value colour
 
function set alpha (in me, in value)
 alpha set method
 
function get delta (in me)
 delta Get method delta is the normalised number of pixels per frame to move a stimulus
 
function get dX (in me)
 dX Get method X position increment for a given delta and angle
 
function get dY (in me)
 dY Get method Y position increment for a given delta and angle
 
function show (in me)
 Method to set isVisible=true.
 
function hide (in me)
 Method to set isVisible=false.
 
function setOffTime (in me, in time)
 set offTime
 
function setDelayTime (in me, in time)
 set delayTime
 
function resetTicks (in me)
 reset the various tick counters for our stimulus
 
function getMousePosition (in me)
 get mouse position we make sure this is only called once per animation tick to improve performance and ensure all stimuli that are following mouse position have consistent X and Y per frame update This sets mouseX and mouseY and mouseValid if mouse is within PTB screen (useful for mouse override positioning for stimuli)
 
function run (in me, in benchmark, in runtime, in s, in forceScreen, in showVBL)
 Run stimulus in a window to preview it.
 
function makePanel (in me, in parent)
 make a GUI properties panel for this object
 
function selectFilePanel (in me, in varargin)
 read values from a GUI properties panel for this object
 
function readPanel (in me, in varargin)
 read values from a GUI properties panel for this object
 
function showPanel (in me)
 show GUI properties panel for this object
 
function hidePanel (in me)
 hide GUI properties panel for this object
 
function closePanel (in me, in varargin)
 close GUI panel for this object
 
function cleanHandles (in me, in ignoredArg)
 clean any handles
 
function getP (in me, in name, in range)
 gets a property copy or original property
 
function setP (in me, in name, in value)
 sets a property copy or original property
 
function updateXY (in me, in x, in y, in useDegrees)
 Update only position info, faster and doesn't reset image etc.
 
- Public Member Functions inherited from optickaCore
function optickaCore (in varargin)
 Class constructor.
 
function get fullName (in me)
 
function getALF (in me, in subject, in sessionPrefix, in lab, in create)
 
function findAttributes (in me, in attrName, in attrValue)
 
function findAttributesandType (in me, in attrName, in attrValue, in type)
 find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
 
function findPropertyDefault (in me, in propName)
 
function clone (in me)
 Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
 
function checkSuperclasses (in List)
 
function editProperties (in me, in properties)
 method to modify a set of properties
 
function setProp (in me, in property, in value)
 method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
 
function initialiseGlobals (in me, in doReset, in doOpen)
 
function initialiseSaveFile (in me)
 Initialise Save prefix.
 
function checkPaths (in me)
 checks the paths are valid
 

Public Attributes

Property type
 family type
 
Property sf
 spatial frequency
 
Property tf
 temporal frequency
 
Property inducerHeight
 inducer height multiplier
 
Property inducerPosition
 inducer position
 
Property rotationMethod
 rotate the object (0/false) or the texture (1/true)?
 
Property phase
 phase of grating
 
Property phaseOffset
 phase offset between target and inducer
 
Property contrast
 contrast of grating
 
Property inducerContrast
 contrast of inducer
 
Property mask
 use a circular mask?
 
Property driftDirection
 reverse the drift direction?
 
Property direction
 the angle which the direction of the grating patch is moving
 
Property contrastMult
 Contrast Multiplier, 0.5 gives "standard" 0-1 contrast range.
 
Property correctPhase
 do we need to correct the phase to be relative to center not edge?
 
Property phaseReverseTime
 reverse phase of grating X times per second?
 
Property phaseOfReverse
 What phase to use for reverse?
 
Property sigma
 cosine smoothing sigma in pixels for circular masked gratings
 
Property useAlpha
 use colour or alpha channel for smoothing?
 
Property smoothMethod
 use cosine (0) or hermite interpolation (1)
 
Property aspectRatio
 aspect ratio of the grating
 
Property family
 
Property scale
 scale is used when changing size as an independent variable to keep sf accurate
 
Property phaseIncrement
 the phase amount we need to add for each frame of animation
 
- Public Attributes inherited from baseStimulus
Property type
 stimulus type
 
Property xPosition
 
Property yPosition
 
Property size
 
Property colour
 
Property alpha
 Alpha (opacity) [0-1], this gets combined with the RGB colour.
 
Property startPosition
 
Property speed
 
Property angle
 angle in degrees (0 - 360)
 
Property delayTime
 
Property offTime
 time to turn stimulus off, relative to stimulus onset
 
Property isVisible
 true or false, whether to draw() this object
 
Property mouseOverride
 override X and Y position with mouse input? Useful for RF mapping
 
Property showOnTracker
 show the position on the Eyetracker display?
 
Property verbose
 Do we log extra details to the command-line?
 
Property xFinal
 
Property yFinal
 
Property mvRect
 
Property szIsPx
 
Property szPx
 computed size in pixels
 
Property szD
 computed size in °
 
Property xFinalD
 X and Y position in °
 
Property yFinalD
 
Property isRect
 
Property tick
 tick updates +1 on each call of draw (even if delay or off is true and no stimulus is drawn, resets on each update
 
Property drawTick
 draw tick only updates when a draw is actually performed, resets on each update
 
Property ppd
 pixels per degree (normally inhereted from screenManager)
 
Property delta
 What our per-frame motion delta is.
 
Property dX
 X update which is computed from our speed and angle.
 
Property dY
 X update which is computed from our speed and angle.
 
- Public Attributes inherited from optickaCore
Property name
 object name
 
Property comment
 comment
 
Property verbose
 verbose logging, subclasses must assign this. This is normally logical true/false
 
Property dateStamp
 clock() dateStamp set on construction
 
Property uuid
 universal ID
 
Property paths
 storage of various paths
 
Property fullName
 The fullName is the object name combined with its uuid and class name.
 

Protected Member Functions

function setRect (in obj)
 setRect setRect makes the PsychRect based on the texture and screen values this is modified over parent method as gratings have slightly different requirements.
 
function calculateScale (in obj, in ignoredArg, in ignoredArg)
 calculateScale Use an event to recalculate scale as get method is slower (called many more times), than an event which is only called on update
 
function calculatePhaseIncrement (in obj, in ignoredArg, in ignoredArg)
 calculatePhaseIncrement Use an event to recalculate as get method is slower (called many more times), than an event which is only called on update
 
- Protected Member Functions inherited from baseStimulus
function addRuntimeProperties (in me)
 These are transient properties that specify actions during runtime.
 
function updateRuntimeProperties (in me)
 Update transient properties that specify actions during runtime.
 
function computePosition (in me)
 compute xFinal and yFinal (in pixels) taking startPosition, xPosition, yPosition and direction/angle into account
 
function setAnimationDelta (in me)
 
function setRect (in me)
 
function toStructure (in me, in tmp)
 Converts properties to a structure.
 
function removeTmpProperties (in me)
 Finds and removes dynamic properties.
 
function delete (in me)
 
- Protected Member Functions inherited from optickaCore
function parseArgs (in me, in args, in allowedProperties)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function addArgs (in me, in args)
 
function setPaths (in me)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function getFonts (in me)
 set paths for object
 
function toStructure (in me)
 Converts properties to a structure.
 
function getType (in me, in in)
 
function logOutput (in me, in in, in message, in override)
 Give a metaproperty return the likely property class.
 
function salutation (in me, in varargin)
 Prints messages dependent on verbosity.
 

Protected Attributes

Property sfCache
 
Property sfRecurse
 to stop a loop between set method and an event
 
Property allowedProperties
 allowed properties passed to object upon construction
 
Property ignoreProperties
 properties to not create transient copies of during setup phase
 
Property phaseCounter
 how many frames between phase reverses
 
Property squareWave
 do we generate a square wave?
 
Property gabor
 do we generate a square wave?
 
Property maskValue
 mask value
 
- Protected Attributes inherited from baseStimulus
Property family
 the stimulus family (grating, dots etc.)
 
Property texture
 Our texture pointer for texture-based stimuli.
 
Property handles
 handles for the GUI
 
Property sM
 our screen manager
 
Property animator
 animation manager
 
Property screenVals
 screen settings generated by sM on setup
 
Property isSetup
 
Property isGUI
 is panel constructed?
 
Property dstRect
 initial screen rectangle position [LEFT TOP RIGHT BOTTOM]
 
Property mouseValid
 is mouse position within screen co-ordinates?
 
Property mouseX
 mouse X position
 
Property mouseY
 mouse Y position
 
Property delayTicks
 delay ticks to wait until display
 
Property offTicks
 ticks before stimulus turns off
 
Property inSetup
 are we setting up?
 
Property delta_
 delta cache
 
Property dX_
 dX cache
 
Property dY_
 dY cache
 
Property isInSetColour
 deal with interaction of colour and alpha
 
Property setLoop
 
Property ignorePropertiesBase
 Which properties to ignore cloning when making transient copies in setup.
 
Property ignorePropertiesUIBase
 Which properties to not draw in the UI panel.
 
- Protected Attributes inherited from optickaCore
Property cloning
 are we cloning this from another object
 
Property mversion
 Matlab version number, this is transient so it is not saved.
 
Property sansFont
 sans font
 
Property monoFont
 monoFont
 
Property className
 class name
 
Property savePrefix
 save prefix generated from clock time
 
Property fullName_
 cached full name
 

Additional Inherited Members

- Static Public Member Functions inherited from baseStimulus
static function d2r (in degrees)
 degrees2radians
 
static function r2d (in r)
 radians2degrees
 
static function findDistance (in x1, in y1, in x2, in y2)
 findDistance in X and Y coordinates
 
static function updatePosition (in delta, in angle)
 updatePosition returns dX and dY given an angle and delta
 
- Static Public Member Functions inherited from optickaCore
static function makeArgs (in args)
 Converts cell args to structure array.
 
static function addDefaults (in args, in defs)
 add default options to arg input
 
static function hasKey (in in, in key)
 check if a struct / object has a propery / field
 
static function getKeys (in device)
 PTB Get key presses, stops key bouncing.
 

Member Enumeration Documentation

◆ Events

Enumerator
changeScale 

triggered when changing size, so we can change sf etc to compensate

changePhaseIncrement 

triggered when changing tf or drift direction

157 :numel(fn)
158 if ~matches(fn{j}, me.ignoreProperties)%create a temporary dynamic property
159 p = addprop(me, [fn{j} 'Out']);
160 if strcmp(fn{j},'sf');p.SetMethod = @set_sfOut;end
161 if strcmp(fn{j},'tf');p.SetMethod = @set_tfOut;end
162 if strcmp(fn{j},'driftDirection');p.SetMethod = @set_driftDirectionOut;end
163 if strcmp(fn{j},'size');p.SetMethod = @set_sizeOut;end
164 if strcmp(fn{j},'xPosition');p.SetMethod = @set_xPositionOut;end
165 if strcmp(fn{j},'yPosition');p.SetMethod = @set_yPositionOut;end
166 obj.([fn{j} 'Out']) = obj.(fn{j}); %copy our property value to our tempory copy
167 end
168 end
169
171
172 if isempty(obj.findprop('rotateMode'));p=obj.addprop('rotateMode');p.Transient=true;p.Hidden=true;end
173 if obj.rotationMethod==1
174 obj.rotateMode = kPsychUseTextureMatrixForRotation;
175 else
176 obj.rotateMode = [];
177 end
178
179 if isempty(obj.findprop('gratingSize'));p=obj.addprop('gratingSize');p.Transient=true;p.Hidden=true;end
180 obj.gratingSize = round(obj.ppd*obj.size);
181
182 if isempty(obj.findprop('phaseIncrement'));
183 p=obj.addprop('phaseIncrement');
184 end
185
186 if isempty(obj.findprop('driftPhase'));p=obj.addprop('driftPhase');p.Transient=true;end
187 if obj.correctPhase
188 ps=obj.calculatePhase;
189 obj.driftPhase=obj.phaseOut-ps;
190 else
191 obj.driftPhase=obj.phaseOut;
192 end
193
194 if isempty(obj.findprop('res'));p=obj.addprop('res');p.Transient=true;end
195 if obj.aspectRatio < 1
196 obj.res = round([obj.gratingSize*obj.aspectRatio obj.gratingSize]);
197 else
198 obj.res = round([obj.gratingSize*obj.aspectRatio obj.gratingSize]);
199 end
200
201 if obj.mask == true
202 obj.maskValue = floor((obj.ppd*obj.size)/2);
203 else
204 obj.maskValue = [];
205 end
206
207 if isempty(obj.findprop('texture'));p=obj.addprop('texture');p.Transient=true;end
208
209 if obj.phaseReverseTime > 0
210 obj.phaseCounter = round(obj.phaseReverseTime / obj.sM.screenVals.ifi);
211 end
212
213 if strcmpi(obj.type,'square')
214 obj.texture{1} = CreateProceduralSineSquareGrating(obj.sM.win, obj.res(1),...
215 obj.res(2), obj.colourOut, obj.mask, obj.contrastMult);
216 obj.texture = CreateProceduralSineSquareGrating(obj.sM.win, obj.res(1),...
217 obj.res(2)*obj.inducerHeight, obj.colourOut, obj.mask, obj.contrastMult);
218 else
219 if obj.sigmaOut > 0
220 obj.texture{1} = CreateProceduralSineSmoothedGrating(obj.sM.win, obj.res(1), ...
221 obj.res(2), obj.colourOut, obj.mask, obj.contrastMult, obj.sigmaOut, ...
222 obj.useAlpha, obj.smoothMethod);
223 obj.texture{2} = CreateProceduralSineSmoothedGrating(obj.sM.win, obj.res(1), ...
224 obj.res(2)*obj.inducerHeight, obj.colourOut, obj.mask, obj.contrastMult, obj.sigmaOut, ...
225 obj.useAlpha, obj.smoothMethod);
226 else
227 obj.texture{1} = CreateProceduralSineGrating(obj.sM.win, obj.res(1),...
228 obj.res(2), obj.colourOut, obj.mask, obj.contrastMult);
229 obj.texture{2} = CreateProceduralSineGrating(obj.sM.win, obj.res(1),...
230 obj.res(2)*obj.inducerHeight, obj.colourOut, obj.mask, obj.contrastMult);
231 end
232 end
233
234 obj.inSetup = false;
235 obj.setRect();
236
237 function set_sfOut(obj,value)
238 if obj.sfRecurse == false
239 obj.sfCache = (value/obj.ppd);
240 obj.sfOut = obj.sfCache * obj.scale;
241 else
242 obj.sfOut = value;
243 obj.sfRecurse = false;
244 end
245 %fprintf('\nSET SFOut: %d | cachce: %d | in: %d\n', obj.sfOut, obj.sfCache, value);
246 end
247 function set_tfOut(obj,value)
248 obj.tfOut = value;
249 notify(obj,'changePhaseIncrement');
250 end
251 function set_driftDirectionOut(obj,value)
252 obj.driftDirectionOut = value;
253 notify(obj,'changePhaseIncrement');
254 end
255 function set_sizeOut(obj,value)
256 obj.sizeOut = value*obj.ppd;
257 notify(obj,'changeScale');
258 end
259 function set_xPositionOut(obj,value)
260 obj.xPositionOut = value*obj.ppd;
261 if ~isempty(obj.texture);obj.setRect;end
262 end
263 function set_yPositionOut(obj,value)
264 obj.yPositionOut = value*obj.ppd;
265 if ~isempty(obj.texture);obj.setRect;end
266 end
267
268 end
269
270 % ===================================================================
271 %> @brief Update this stimulus object for display
272 %>
273 % ===================================================================
274 function update(obj)
275 resetTicks(obj);
276 if obj.correctPhase
277 ps=obj.calculatePhase;
278 obj.driftPhase=obj.phaseOut-ps;
279 else
280 obj.driftPhase=obj.phaseOut;
281 end
282 obj.setRect();
283 end
284
285 % ===================================================================
286 %> @brief Draw this stimulus object for display
287 %>
288 %>
289 % ===================================================================
290 function draw(obj)
291 if obj.isVisible == true && obj.tick > obj.delayTicks
292
293 dstRect = Screen('Rect',obj.texture{2});
294 dstRect = AlignRect(dstRect, obj.mvRect, 'left');
295 dstRect = AdjoinRect(dstRect, obj.mvRect, obj.inducerPosition);
296
297 Screen('DrawTexture', obj.sM.win, obj.texture{1}, [], obj.mvRect,...
298 obj.angleOut, [], [], [], [], obj.rotateMode,...
299 [obj.driftPhase, obj.sfOut, obj.contrastOut, obj.sigmaOut]);
300 Screen('DrawTexture', obj.sM.win, obj.texture{2}, [], dstRect,...
301 obj.angleOut, [], [], [], [], obj.rotateMode,...
302 [obj.driftPhase+obj.phaseOffset, obj.sfOut, obj.inducerContrastOut, obj.sigmaOut]);
303 obj.tick = obj.tick + 1;
304 end
305 end
306
307 % ===================================================================
308 %> @brief Animate this object for runExperiment
309 %>
310 % ===================================================================
311 function animate(obj)
312 if obj.mouseOverride
313 getMousePosition(obj);
314 if obj.mouseValid
315 obj.mvRect = CenterRectOnPointd(obj.mvRect, obj.mouseX, obj.mouseY);
316 end
317 end
318 if obj.doMotion == true
319 obj.mvRect=OffsetRect(obj.mvRect,obj.dX_,obj.dY_);
320 end
321 if obj.doDrift == true
322 obj.driftPhase = obj.driftPhase + obj.phaseIncrement;
323 end
324 if mod(obj.tick,obj.phaseCounter) == 0
325 obj.driftPhase = obj.driftPhase + obj.phaseOfReverse;
326 end
327 end
328
329 % ===================================================================
330 %> @brief Reset an structure for runExperiment
331 %>
332 %> @param rE runExperiment object for reference
333 %> @return stimulus structure.
334 % ===================================================================
335 function reset(obj)
336 resetTicks(obj);
337 obj.texture=[];
338 if obj.mask > 0
339 obj.mask = true;
340 end
341 obj.maskValue = [];
342 obj.removeTmpProperties;
343 end
344
345 % ===================================================================
346 %> @brief sf Set method
347 %>
348 % ===================================================================
349 function set.sf(obj,value)
350 if value <= 0
351 value = 0.05;
352 end
353 obj.sf = value;
354 obj.salutation(['set sf: ' num2str(value)],'Custom set method')
355 end
356
357 % ===================================================================
358 %> @brief calculate phase offset
359 %>
360 % ===================================================================
361 function phase = calculatePhase(obj)
362 phase = 0;
363 if obj.correctPhase > 0
364 ppd = obj.ppd;
365 size = (obj.sizeOut/2); %divide by 2 to get the 0 point
366 sfTmp = (obj.sfOut/obj.scale)*obj.ppd;
367 md = size / (ppd/sfTmp);
368 md=md-floor(md);
369 phase = (360*md);
370 end
371 end
372
373 end %---END PUBLIC METHODS---%
374
375
376 %=======================================================================
377 methods ( Access = protected ) %-------PROTECTED METHODS-----%
378 %=======================================================================
379
380 % ===================================================================
381 %> @brief setRect
382 %> setRect makes the PsychRect based on the texture and screen values
383 %> this is modified over parent method as gratings have slightly different
384 %> requirements.
385 % ===================================================================
386 function setRect(obj)
387 if isempty(obj.findprop('directionOut'));
388 [sx sy]=pol2cart(obj.d2r(obj.direction),obj.startPosition);
389 else
390 [sx sy]=pol2cart(obj.d2r(obj.directionOut),obj.startPosition);
391 end
392 obj.dstRect=Screen('Rect',obj.texture{1});
393 obj.dstRect=ScaleRect(obj.dstRect,obj.scale,obj.scale);
394 obj.dstRect=CenterRectOnPointd(obj.dstRect,obj.sM.xCenter,obj.sM.yCenter);
395 if isempty(obj.findprop('xPositionOut'));
396 obj.dstRect=OffsetRect(obj.dstRect,(obj.xPosition)*obj.ppd,(obj.yPosition)*obj.ppd);
397 else
398 obj.dstRect=OffsetRect(obj.dstRect,obj.xPositionOut+(sx*obj.ppd),obj.yPositionOut+(sy*obj.ppd));
399 end
400 obj.mvRect=obj.dstRect;
401 obj.setAnimationDelta();
402 end
403
404 % ===================================================================
405 %> @brief calculateScale
406 %> Use an event to recalculate scale as get method is slower (called
407 %> many more times), than an event which is only called on update
408 % ===================================================================
409 function calculateScale(obj,~,~)
410 obj.scale = obj.sizeOut/(obj.size*obj.ppd);
411 obj.sfRecurse = true;
412 obj.sfOut = obj.sfCache * obj.scale;
413 %fprintf('\nCalculate SFOut: %d | in: %d | scale: %d\n', obj.sfOut, obj.sfCache, obj.scale);
414 end
415
416 % ===================================================================
418 %> Use an event to recalculate as get method is slower (called
419 %> many more times), than an event which is only called on update
420 % ===================================================================
421 function calculatePhaseIncrement(obj,~,~)
422 if ~isempty(obj.findprop('tfOut'))
423 obj.phaseIncrement = (obj.tfOut * 360) * obj.sM.screenVals.ifi;
424 if ~isempty(obj.findprop('driftDirectionOut'))
425 if obj.driftDirectionOut == false
427 end
428 end
429 end
430 end
431
432 end
433end
function CreateProceduralSineSmoothedGrating(in windowPtr, in width, in height, in backgroundColorOffset, in radius, in contrastPreMultiplicator, in sigma, in useAlpha, in method)
function CreateProceduralSineSquareGrating(in windowPtr, in width, in height, in backgroundColorOffset, in radius, in contrastPreMultiplicator)
Property size
Definition baseStimulus.m:46
function getMousePosition(in me)
get mouse position we make sure this is only called once per animation tick to improve performance an...
Property sM
our screen manager
Definition baseStimulus.m:165
Property ppd
pixels per degree (normally inhereted from screenManager)
Definition baseStimulus.m:139
function resetTicks(in me)
reset the various tick counters for our stimulus
Property texture
Our texture pointer for texture-based stimuli.
Definition baseStimulus.m:159
Property screenVals
screen settings generated by sM on setup
Definition baseStimulus.m:171
Property dstRect
initial screen rectangle position [LEFT TOP RIGHT BOTTOM]
Definition baseStimulus.m:184
function addRuntimeProperties(in me)
These are transient properties that specify actions during runtime.
The main experiment manager.
Definition runExperiment.m:3
function set_driftDirectionOut(in obj, in value)
function update(in obj)
Update this stimulus object for display.
function set_yPositionOut(in obj, in value)
function set_xPositionOut(in obj, in value)
function draw(in obj)
Draw this stimulus object for display.
Property scale
scale is used when changing size as an independent variable to keep sf accurate
Definition targetInducerStimulus.m:83
function setRect(in obj)
setRect setRect makes the PsychRect based on the texture and screen values this is modified over pare...
function calculatePhase(in obj)
calculate phase offset
Property sfCache
Definition targetInducerStimulus.m:98
Property sf
spatial frequency
Definition targetInducerStimulus.m:17
function animate(in obj)
Animate this object for runExperiment.
Property phase
phase of grating
Definition targetInducerStimulus.m:32
function set_tfOut(in obj, in value)
Property phaseIncrement
the phase amount we need to add for each frame of animation
Definition targetInducerStimulus.m:86
Property sfRecurse
to stop a loop between set method and an event
Definition targetInducerStimulus.m:101
function set_sfOut(in obj, in value)
function reset(in obj)
Reset an structure for runExperiment.
function calculatePhaseIncrement(in obj, in ignoredArg, in ignoredArg)
calculatePhaseIncrement Use an event to recalculate as get method is slower (called many more times),...
function calculateScale(in obj, in ignoredArg, in ignoredArg)
calculateScale Use an event to recalculate scale as get method is slower (called many more times),...
function set_sizeOut(in obj, in value)

Constructor & Destructor Documentation

◆ targetInducerStimulus()

function targetInducerStimulus::targetInducerStimulus ( in  varargin)

Class constructor.

More detailed description of what the constructor does.

Parameters
argsare passed as a structure of properties which is parsed.
Returns
instance of class.

Member Function Documentation

◆ animate()

function targetInducerStimulus::animate ( in  obj)
virtual

Animate this object for runExperiment.

Reimplemented from baseStimulus.

◆ calculatePhase()

function targetInducerStimulus::calculatePhase ( in  obj)

calculate phase offset

◆ calculatePhaseIncrement()

function targetInducerStimulus::calculatePhaseIncrement ( in  obj,
in  ignoredArg,
in  ignoredArg 
)
protected

calculatePhaseIncrement Use an event to recalculate as get method is slower (called many more times), than an event which is only called on update

◆ calculateScale()

function targetInducerStimulus::calculateScale ( in  obj,
in  ignoredArg,
in  ignoredArg 
)
protected

calculateScale Use an event to recalculate scale as get method is slower (called many more times), than an event which is only called on update

◆ draw()

function targetInducerStimulus::draw ( in  obj)
virtual

Draw this stimulus object for display.

Reimplemented from baseStimulus.

◆ reset()

function targetInducerStimulus::reset ( in  obj)
virtual

Reset an structure for runExperiment.

Parameters
rErunExperiment object for reference
Returns
stimulus structure.

Reimplemented from baseStimulus.

◆ set_driftDirectionOut()

function targetInducerStimulus::set_driftDirectionOut ( in  obj,
in  value 
)

◆ set_sfOut()

function targetInducerStimulus::set_sfOut ( in  obj,
in  value 
)

◆ set_sizeOut()

function targetInducerStimulus::set_sizeOut ( in  obj,
in  value 
)

◆ set_tfOut()

function targetInducerStimulus::set_tfOut ( in  obj,
in  value 
)

◆ set_xPositionOut()

function targetInducerStimulus::set_xPositionOut ( in  obj,
in  value 
)

◆ set_yPositionOut()

function targetInducerStimulus::set_yPositionOut ( in  obj,
in  value 
)

◆ setRect()

function targetInducerStimulus::setRect ( in  obj)
protected

setRect setRect makes the PsychRect based on the texture and screen values this is modified over parent method as gratings have slightly different requirements.

◆ setup()

function targetInducerStimulus::setup ( in  obj,
in  sM 
)

Setup this object in preperation for use When displaying a stimulus object, the main properties that are to be modified are copied into cache copies of the property, both to convert from visual description (c/d, Hz, degrees) to computer metrics, and to be animated and modified as independant variables. So xPosition is copied to xPositionOut and converyed from degrees to pixels. The animation and drawing functions use these modified properties, and when they are updated, for example to change to a new xPosition, internal methods ensure reconversion and update any dependent properties. This method initialises the object for display.

Parameters
rErunExperiment object for reference

◆ sf()

function set targetInducerStimulus::sf ( in  obj,
in  value 
)

sf Set method

◆ update()

function targetInducerStimulus::update ( in  obj)
virtual

Update this stimulus object for display.

Reimplemented from baseStimulus.

Member Data Documentation

◆ allowedProperties

Property targetInducerStimulus::allowedProperties
protected

allowed properties passed to object upon construction

◆ aspectRatio

Property targetInducerStimulus::aspectRatio

aspect ratio of the grating

◆ contrast

Property targetInducerStimulus::contrast

contrast of grating

◆ contrastMult

Property targetInducerStimulus::contrastMult

Contrast Multiplier, 0.5 gives "standard" 0-1 contrast range.

◆ correctPhase

Property targetInducerStimulus::correctPhase

do we need to correct the phase to be relative to center not edge?

◆ direction

Property targetInducerStimulus::direction

the angle which the direction of the grating patch is moving

◆ driftDirection

Property targetInducerStimulus::driftDirection

reverse the drift direction?

◆ family

Property targetInducerStimulus::family

◆ gabor

Property targetInducerStimulus::gabor
protected

do we generate a square wave?

◆ ignoreProperties

Property targetInducerStimulus::ignoreProperties
protected

properties to not create transient copies of during setup phase

◆ inducerContrast

Property targetInducerStimulus::inducerContrast

contrast of inducer

◆ inducerHeight

Property targetInducerStimulus::inducerHeight

inducer height multiplier

◆ inducerPosition

Property targetInducerStimulus::inducerPosition

inducer position

◆ mask

Property targetInducerStimulus::mask

use a circular mask?

◆ maskValue

Property targetInducerStimulus::maskValue
protected

mask value

◆ phase

Property targetInducerStimulus::phase

phase of grating

◆ phaseCounter

Property targetInducerStimulus::phaseCounter
protected

how many frames between phase reverses

◆ phaseIncrement

Property targetInducerStimulus::phaseIncrement

the phase amount we need to add for each frame of animation

◆ phaseOffset

Property targetInducerStimulus::phaseOffset

phase offset between target and inducer

◆ phaseOfReverse

Property targetInducerStimulus::phaseOfReverse

What phase to use for reverse?

◆ phaseReverseTime

Property targetInducerStimulus::phaseReverseTime

reverse phase of grating X times per second?

◆ rotationMethod

Property targetInducerStimulus::rotationMethod

rotate the object (0/false) or the texture (1/true)?

◆ scale

Property targetInducerStimulus::scale

scale is used when changing size as an independent variable to keep sf accurate

◆ sf

Property targetInducerStimulus::sf

spatial frequency

◆ sfCache

Property targetInducerStimulus::sfCache
protected

as get methods are slow, we cache sf, then recalculate sf whenever changeScale event is called

◆ sfRecurse

Property targetInducerStimulus::sfRecurse
protected

to stop a loop between set method and an event

◆ sigma

Property targetInducerStimulus::sigma

cosine smoothing sigma in pixels for circular masked gratings

◆ smoothMethod

Property targetInducerStimulus::smoothMethod

use cosine (0) or hermite interpolation (1)

◆ squareWave

Property targetInducerStimulus::squareWave
protected

do we generate a square wave?

◆ tf

Property targetInducerStimulus::tf

temporal frequency

◆ type

Property targetInducerStimulus::type

family type

◆ useAlpha

Property targetInducerStimulus::useAlpha

use colour or alpha channel for smoothing?


The documentation for this class was generated from the following file: