本文整理汇总了C++中BoxNoiseStimulus类的典型用法代码示例。如果您正苦于以下问题:C++ BoxNoiseStimulus类的具体用法?C++ BoxNoiseStimulus怎么用?C++ BoxNoiseStimulus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BoxNoiseStimulus类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initVariables
void initVariables()
{
interoculardistance = str2num<double>(parameters.find("IOD"));
// Create the factors-staircase object TrialGenerator
trial.init(parameters);
maxTotalTrials = trial.getRemainingTrials();
cerr << "There are " << maxTotalTrials << " total trials to do..." << endl;
factors = trial.getNext();
redDotsPlane.setNpoints(300);
redDotsPlane.setDimensions(50,50,0.1);
redDotsPlane.compute();
//stimDrawer.drawSpecialPoints();
stimDrawer.setStimulus(&redDotsPlane);
stimDrawer.setSpheres(false);
stimDrawer.initList(&redDotsPlane,glRed,3);
// Set the maximum x displacement of head
maxXOscillation = util::str2num<double>(parameters.find("MaxXOscillation"));
nOscillationsFixation = util::str2num<int>(parameters.find("NOscillationsFixation"));
minOscTime = util::str2num<double>(parameters.find("MinOscillationTime"));
maxOscTime = util::str2num<double>(parameters.find("MaxOscillationTime"));
centerTolerance = util::str2num<double>(parameters.find("CenterTolerance"));
totalTimer.start();
}
示例2: initVariables
void initVariables()
{
interoculardistance = str2num<double>(parameters.find("IOD"));
stimulusEmiCycles= atoi(parameters.find("StimulusEmiCycles").c_str());
trial.init(parameters);
factors = trial.getNext(); // Initialize the factors in order to start from trial 1
if ( atoi(parameters.find("DrawOccluder").c_str()) ==1 )
{
redDotsPlane.setNpoints(500); //XXX controllare densita di distribuzione dei punti
redDotsPlane.setDimensions(200,200,0.1);
}
else
{
redDotsPlane.setNpoints(75); //XXX controllare densita di distribuzione dei punti
redDotsPlane.setDimensions(50,50,0.1);
}
//redDotsPlane.setSlantTilt( factors["Slant"], (int) factors["Tilt"] );
redDotsPlane.compute();
stimDrawer.setStimulus(&redDotsPlane);
stimDrawer.initList(&redDotsPlane);
/** Bound check things **/
signsX.push_back(false);
signsX.push_back(false);
signsY.push_back(false);
signsY.push_back(false);
headEyeCoords.init(Vector3d(-32.5,0,0),Vector3d(32.5,0,0), Vector3d(0,0,0),Vector3d(0,10,0),Vector3d(0,0,10),interoculardistance );
eyeCalibration=headEyeCoords.getRightEye();
model.load("../data/objmodels/occluder.obj");
}
示例3: mouseFunc
void mouseFunc(int button, int state, int _x , int _y)
{
if ( trialMode == PROBEMODE )
{
glutWarpPointer(SCREEN_WIDTH/2,SCREEN_HEIGHT/2);
if ( button == GLUT_LEFT_BUTTON && (state==GLUT_DOWN) )
probeAngle+=90;
if ( button == GLUT_RIGHT_BUTTON && (state==GLUT_DOWN) )
probeAngle-=90;
if( button== GLUT_MIDDLE_BUTTON )
{
double responseTime=responseTimer.getElapsedTimeInMilliSec();
double clickDelay=100; //milliseconds before the click is valid
if ( responseTime > clickDelay )
{
timeFrame=0.0; //this put the stimulus in the center each central time mouse is clicked in
bool contraction = ( factors["Tilt"]==90 ) || (factors["Tilt"]==0);
double angleResponse = (mod(probeAngle+probeStartingAngle,360));
if ( trial.getRemainingTrials()==0 )
{
responseFile << setw(6) << left << trialNumber << " " << factors["Def"] <<" " << factors["Tilt"] <<" " << factors["Slant"] << " " << factors["Anchored"] << " " << factors["FollowingSpeed"] << " " << factors["Onset"] << " " << (focalDistance - eyeCalibration.z()) << " " << angleResponse << " " << responseTime << " " << contraction << endl;
cleanup();
exit(0);
}
else
{
responseFile << setw(6) << left << trialNumber << " " << factors["Def"] <<" " << factors["Tilt"] <<" " << factors["Slant"] << " " << factors["Anchored"] << " " << factors["FollowingSpeed"] << " " << factors["Onset"] << " " << (focalDistance - eyeCalibration.z()) << " " << angleResponse << " " << responseTime << " " << contraction << endl;
factors = trial.getNext();
trialNumber++;
}
advanceTrial();
double possibleAngles[]= {0,90,180,270};
probeStartingAngle=possibleAngles[rand()%4];
probeAngle=0;
if ( atoi(parameters.find("DrawOccluder").c_str()) ==1 )
{
redDotsPlane.setNpoints(500); //XXX controllare densita di distribuzione dei punti
redDotsPlane.setDimensions(200,200,0.1);
}
else
{
redDotsPlane.setNpoints(75); //XXX controllare densita di distribuzione dei punti
redDotsPlane.setDimensions(50,50,0.1);
}
//redDotsPlane.setSlantTilt( factors["Slant"], (int) factors["Tilt"] );
redDotsPlane.compute();
stimDrawer.initList(&redDotsPlane);
mouseButton=0;
}
}
}
glutPostRedisplay();
}
示例4: build_two_planes
void build_two_planes()
{
// BOX left
boxLeft.setDimensions(40.0, 50.0, 0.1);
boxLeft.setNpoints(450);
boxLeft.compute();
boxLeftDrawer.setStimulus(&boxLeft);
boxLeftDrawer.setSpheres(true);
boxLeftDrawer.initList(&boxLeft, glRed);
// BOX right
boxRight.setDimensions(40.0, 50.0, 0.1);;
boxRight.setNpoints(450);
boxRight.compute();
boxRightDrawer.setStimulus(&boxRight);
boxRightDrawer.setSpheres(true);
boxRightDrawer.initList(&boxRight, glRed);
// fixation rod
rodMiddle.setDimensions(10.0, 5.0, 0.5);;
rodMiddle.setNpoints(100);
rodMiddle.compute();
rodMiddleDrawer.setStimulus(&rodMiddle);
rodMiddleDrawer.setSpheres(true);
rodMiddleDrawer.initList(&rodMiddle, glRed);
}
示例5: initVariables
void initVariables()
{
interoculardistance = str2num<double>(parameters.find("IOD"));
redDotsPlane.setNpoints(75); //XXX controllare densita di distribuzione dei punti
redDotsPlane.setDimensions(50,50,0.1);
redDotsPlane.compute();
stimDrawer.setSpheres(true);
stimDrawer.setStimulus(&redDotsPlane);
stimDrawer.initList(&redDotsPlane);
}
示例6: keyPressed
void keyPressed()
{
// Reset the translation of strip
stripDisplacementIncrement = 0;
double responseTime=responseTimer.getElapsedTimeInMilliSec();
timeFrame=0.0; //this put the stimulus in the center each central time mouse is clicked in
advanceTrial();
// Imposta stimolo e drawer
redDotsPlane.setNpoints(75);
redDotsPlane.setDimensions(50,50,0.1);
redDotsPlane.compute();
stimDrawer.initList(&redDotsPlane,glRed,2);
}
示例7: build_three_rods
void build_three_rods()
{
// Ora inizializza i 3 rods (stimoli)
for (int i=0; i<3; i++)
{
cylinder[i].setNpoints(150);
cylinder[i].setRadiusAndHeight(0.1,50.0); // raggio (mm) altezza (mm)
// Dispone i punti random sulla superficie cilindrica
cylinder[i].compute();
stimDrawer[i].setStimulus(&cylinder[i]);
// seguire questo ordine altrimenti setspheres non ha effetto se chiamata dopo StimulusDrawer::initList
stimDrawer[i].setSpheres(true);
stimDrawer[i].initList(&cylinder[i], glRed);
}
// BOX pedestal
boxPedestal.setDimensions(objwidth+10.0, 55.0, depth_pedestal+5.0);
boxPedestal.setNpoints(150);
boxPedestal.compute();
boxPedestalDrawer.setStimulus(&boxPedestal);
boxPedestalDrawer.setSpheres(true);
boxPedestalDrawer.initList(&boxPedestal, glRed);
// BOX stimulus
boxStimulus.setDimensions(objwidth+10.0, 55.0, depth_stimulus+5.0);;
boxStimulus.setNpoints(150);
boxStimulus.compute();
boxStimulusDrawer.setStimulus(&boxStimulus);
boxStimulusDrawer.setSpheres(true);
boxStimulusDrawer.initList(&boxStimulus, glRed);
}
示例8: keyPressed
void keyPressed()
{
if ( trialMode == PROBEMODE )
{
if ( trialNumber==0)
{ responseFile << setw(6) << left <<
"TrialNumber" << "Tilt Slant Rotation RotationSpeed FollowingSpeed Onset EyeCal.x EyeCal.y EyeCal.z StimFrames ProbeAngle" << endl;
}
responseFile << setw(6) << left <<
trialNumber << " " <<
factors["Tilt"] << " " <<
factors["Slant"] << " " <<
factors["Rotation"] << " " <<
factors["RotationSpeed"] << " " <<
factors["FollowingSpeed"] << " " <<
factors["Onset"] << " " <<
eyeCalibration.transpose() << " " <<
stimulusFrames << " " <<
probeAngle << endl;
double possibleAngles[]= {0,90,180,270};
probeStartingAngle=possibleAngles[rand()%4];
redDotsPlane.compute();
stimDrawer.initList(&redDotsPlane);
isReading=true;
// Winds down the file until probemode isn't finished
while ( trialMode == PROBEMODE || trialMode == CALIBRATIONMODE )
{ if ( readline(inputStream, trialNumber, headCalibration, trialMode, pointMatrix ) )
{
cleanup();
exit(0);
}
}
#ifdef _WIN32
beepOk();
#endif
}
}
示例9: keyPressed
void keyPressed()
{
if ( trialMode == PROBEMODE )
{
if ( trialNumber==0)
{ responseFile << setw(6) << left <<
"TrialNumber Tilt Slant Translation Onset TranslationConstant EyeCalx EyeCaly EyeCalz StimFrames ProbeAngle" << endl;
}
stimulusDuration.stop();
responseFile << setw(6) << left <<
trialNumber << " " <<
factors["Tilt"] << " " <<
factors["Slant"] << " " <<
factors["Translation"] << " " <<
factors["Onset"] << " " <<
factors["TranslationConstant"] << " " <<
eyeCalibration.transpose() << " " <<
stimulusFrames << " " <<
probeAngle << endl;
if ( trial.getRemainingTrials()==0 )
{
cleanup();
exit(0);
}
else
{
factors = trial.getNext();
trialNumber++;
}
trialMode++;
trialMode=trialMode%4;
double possibleAngles[]= {0,90,180,270};
probeStartingAngle=possibleAngles[rand()%4];
redDotsPlane.compute();
stimDrawer.initList(&redDotsPlane);
}
}
示例10: build_oblique_plane
void build_oblique_plane(double length_pedestal, double length_stimulus)
{
// pedestal
boxOblique_pedestal.setDimensions(length_pedestal, 50.0, 0.1);;
boxOblique_pedestal.setNpoints(length_pedestal*40.0*0.225);
boxOblique_pedestal.compute();
boxOblique_pedestalDrawer.setStimulus(&boxOblique_pedestal);
boxOblique_pedestalDrawer.setSpheres(true);
boxOblique_pedestalDrawer.initList(&boxOblique_pedestal, glRed);
// stimulus
boxOblique_stimulus.setDimensions(length_stimulus, 50.0, 0.1);;
boxOblique_stimulus.setNpoints(length_stimulus*40.0*0.225);
boxOblique_stimulus.compute();
boxOblique_stimulusDrawer.setStimulus(&boxOblique_stimulus);
boxOblique_stimulusDrawer.setSpheres(true);
boxOblique_stimulusDrawer.initList(&boxOblique_stimulus, glRed);
}
示例11: updateStimulus
/**
* @brief updateStimulus
*/
void updateStimulus()
{
double stimSize = parameters.get("StimulusSize");
double stimPeriod = parameters.get("StimulusPeriod");
double zWidth = trial.getCurrent().at("ZWidth");
int nStimulusPoints = (int)(stimSize*stimSize*parameters.get("StimulusDensity"));
// Generate the plane stimulus
if (parameters.find("StimulusType")=="Plane")
{
stimulus.setDimensions(stimSize,stimSize,0.001);
stimulus.setNpoints(nStimulusPoints);
stimulus.setFluffiness(0.001);
stimulus.compute();
}
else if (parameters.find("StimulusType")=="Sinusoid")
{
stimulus.setDimensions(stimSize,stimSize,0.001);
stimulus.setNpoints(nStimulusPoints);
stimulus.setFluffiness(0.001);
for (PointsRandIterator iter = stimulus.pointsRand.begin(); iter!=stimulus.pointsRand.end();++iter)
{
(*iter)->x = mathcommon::unifRand(-stimSize/2,stimSize/2);
(*iter)->y = mathcommon::unifRand(-stimSize/2,stimSize/2);
(*iter)->z = 0.5*zWidth*sin(((*iter)->x)/stimPeriod*M_PI);
}
}
else
{
throw std::runtime_error("Wrong argument! Must be Sinusoid or Plane");
}
// Generate the front stimulus
stimDrawer.setSpheres(false);
stimDrawer.setStimulus(&stimulus);
stimDrawer.initList(&stimulus,glRed,parameters.get("PointsSize"));
}
示例12: initVariables
void initVariables()
{
totalTimer.start();
interoculardistance = str2num<double>(parameters.find("IOD"));
trial.init(parameters);
factors = trial.getNext(); // Initialize the factors in order to start from trial 1
// Imposta stimolo e drawer
redDotsPlane.setNpoints(75);
redDotsPlane.setDimensions(50,50,0.1);
redDotsPlane.compute();
stimDrawer.initList(&redDotsPlane,glRed);
// Imposta striscia del fixation e drawer
stripPlane.setNpoints(N_STRIP_POINTS);
stripPlane.setDimensions(STRIP_WIDTH,STRIP_HEIGHT,0.01);
stripPlane.compute();
stripDrawer.initList(&stripPlane,glRed);
stimMotion=SINUSOIDAL_MOTION;
headEyeCoords.init(Vector3d(-32.5,0,0),Vector3d(32.5,0,0), Vector3d(0,0,0),Vector3d(0,10,0),Vector3d(0,0,10),interoculardistance );
eyeCalibration=headEyeCoords.getRightEye();
}