jspsych/plugins/jspsych-rdk.js
//Function to set the global variables to the current aperture so that the correct dots are updated and drawn

Function to set the global variables to the current aperture so that the correct dots are updated and drawn
Function to set the global variables to the current aperture so that the correct dots are updated and drawn
function initializeCurrentApertureParameters(){
			nDots = nDotsArray[currentApertureNumber];
			nSets = nSetsArray[currentApertureNumber]; 
			coherentDirection = coherentDirectionArray[currentApertureNumber]; 
			coherence = coherenceArray[currentApertureNumber]; 
			oppositeCoherence = oppositeCoherenceArray[currentApertureNumber]; 
			dotRadius = dotRadiusArray[currentApertureNumber]; 
			dotLife = dotLifeArray[currentApertureNumber]; 
			moveDistance = moveDistanceArray[currentApertureNumber]; 
			apertureWidth = apertureWidthArray[currentApertureNumber]; 
			apertureHeight = apertureHeightArray[currentApertureNumber]; 
			dotColor = dotColorArray[currentApertureNumber]; 
			apertureCenterX = apertureCenterXArray[currentApertureNumber]; 
			apertureCenterY = apertureCenterYArray[currentApertureNumber]; 
			RDK = RDKArray[currentApertureNumber];
			apertureType = apertureTypeArray[currentApertureNumber];
			reinsertType = reinsertTypeArray[currentApertureNumber];
			fixationCross = fixationCrossArray[currentApertureNumber];
			fixationCrossWidth = fixationCrossWidthArray[currentApertureNumber];
			fixationCrossHeight = fixationCrossHeightArray[currentApertureNumber];
			fixationCrossColor = fixationCrossColorArray[currentApertureNumber];
			fixationCrossThickness = fixationCrossThicknessArray[currentApertureNumber];
			border = borderArray[currentApertureNumber];
			borderThickness = borderThicknessArray[currentApertureNumber];
			borderColor = borderColorArray[currentApertureNumber];
			coherentJumpSizeX = calculateCoherentJumpSizeX(coherentDirection);
			coherentJumpSizeY = calculateCoherentJumpSizeY(coherentDirection);
			initializeApertureDimensions();
			nCoherentDots = nDots * coherence;
			nOppositeCoherentDots = nDots * oppositeCoherence;
			nIncoherentDots = nDots - (nCoherentDots + nOppositeCoherentDots);
			dotArray2d = dotArray3d.length !==0 ? dotArray3d[currentApertureNumber] : undefined;
		}
function initializeCurrentApertureParameters ( ) { nDots = nDotsArray [ currentApertureNumber ] ; nSets = nSetsArray [ currentApertureNumber ] ; coherentDirection = coherentDirectionArray [ currentApertureNumber ] ; coherence = coherenceArray [ currentApertureNumber ] ; oppositeCoherence = oppositeCoherenceArray [ currentApertureNumber ] ; dotRadius = dotRadiusArray [ currentApertureNumber ] ; dotLife = dotLifeArray [ currentApertureNumber ] ; moveDistance = moveDistanceArray [ currentApertureNumber ] ; apertureWidth = apertureWidthArray [ currentApertureNumber ] ; apertureHeight = apertureHeightArray [ currentApertureNumber ] ; dotColor = dotColorArray [ currentApertureNumber ] ; apertureCenterX = apertureCenterXArray [ currentApertureNumber ] ; apertureCenterY = apertureCenterYArray [ currentApertureNumber ] ; RDK = RDKArray [ currentApertureNumber ] ; apertureType = apertureTypeArray [ currentApertureNumber ] ; reinsertType = reinsertTypeArray [ currentApertureNumber ] ; fixationCross = fixationCrossArray [ currentApertureNumber ] ; fixationCrossWidth = fixationCrossWidthArray [ currentApertureNumber ] ; fixationCrossHeight = fixationCrossHeightArray [ currentApertureNumber ] ; fixationCrossColor = fixationCrossColorArray [ currentApertureNumber ] ; fixationCrossThickness = fixationCrossThicknessArray [ currentApertureNumber ] ; border = borderArray [ currentApertureNumber ] ; borderThickness = borderThicknessArray [ currentApertureNumber ] ; borderColor = borderColorArray [ currentApertureNumber ] ; coherentJumpSizeX = calculateCoherentJumpSizeX ( coherentDirection ) ; coherentJumpSizeY = calculateCoherentJumpSizeY ( coherentDirection ) ; initializeApertureDimensions ( ) ; nCoherentDots = nDots * coherence ; nOppositeCoherentDots = nDots * oppositeCoherence ; nIncoherentDots = nDots - ( nCoherentDots + nOppositeCoherentDots ) ; dotArray2d = dotArray3d . length !== 0 ? dotArray3d [ currentApertureNumber ] : undefined ; }
Function to set the global variables to the current aperture so that the correct dots are updated and drawn
Function to set the global variables to the current aperture so that the correct dots are updated and drawn
//Set the global variables to that relevant to the current aperture
 //Calculate the x and y jump sizes for coherent dots
 //Initialize the aperture parameters
 //Calculate the number of coherent, opposite coherent, and incoherent dots
 //If the 3d array has been made, then choose the 2d array and the current set
 // End of initializeCurrentApertureParameters
