Skip to content

Commit

Permalink
renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
denispelli committed Jun 24, 2020
1 parent d6d6eab commit fd79ca9
Show file tree
Hide file tree
Showing 75 changed files with 1,179 additions and 878 deletions.
26 changes: 13 additions & 13 deletions CheckSecRun.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
o.pThreshold=0.75;
o.isNoiseDynamic=true;
o.moviePreAndPostSecs=[0.2 0.2];
o.fixationCrossDeg=3;
o.blankingRadiusReEccentricity=0;
o.blankingRadiusReTargetHeight=0;
o.fixationMarkDeg=3;
o.fixationBlankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.targetMarkDeg=1;
o.noiseType='gaussian'; % 'gaussian' or 'uniform' or 'binary'
if 1
Expand Down Expand Up @@ -68,7 +68,7 @@
ooo={};
% THREE DOMAINS: photon, cortical, ganglion
for domain=0:1
o.blankingRadiusReTargetHeight=nan;
o.fixationBlankingRadiusReTargetHeight=nan;
switch domain
case 0
% photon
Expand All @@ -79,8 +79,8 @@
o.desiredLuminanceAtEye=10; % cd/m^2
o.desiredLuminanceFactor=[];
o.useFilter=true;
o.fixationCrossWeightDeg=0.05; % Typically 0.03. Use 0.05 for scotopic testing.
o.blankingRadiusReTargetHeight=3;
o.fixationThicknessDeg=0.05; % Typically 0.03. Use 0.05 for scotopic testing.
o.fixationBlankingRadiusReTargetHeight=3;
o.noiseCheckFrames=3;
o.noiseType='binary';
case 1
Expand All @@ -92,8 +92,8 @@
o.desiredLuminanceAtEye=10; % cd/m^2
o.desiredLuminanceFactor=[];
o.useFilter=true;
o.fixationCrossWeightDeg=0.05; % Typically 0.03. Use 0.05 for scotopic testing.
o.blankingRadiusReTargetHeight=3;
o.fixationThicknessDeg=0.05; % Typically 0.03. Use 0.05 for scotopic testing.
o.fixationBlankingRadiusReTargetHeight=3;
o.noiseCheckFrames=3;
o.noiseType='binary';
case 2
Expand All @@ -105,7 +105,7 @@
o.desiredLuminanceAtEye=[];
o.desiredLuminanceFactor=1;
o.useFilter=false;
o.fixationCrossWeightDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.fixationThicknessDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.noiseType='binary';
case 3
% ganglion
Expand All @@ -117,17 +117,17 @@
o.desiredLuminanceAtEye=[];
o.desiredLuminanceFactor=1;
o.useFilter=false;
o.fixationCrossWeightDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.fixationThicknessDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.noiseType='binary';
end
o.targetHeightDeg=o.targetGaborCycles/o.targetCyclesPerDeg;
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=false;
o.fixationCrossDeg=inf;
o.fixationMarkDeg=inf;
else
o.isTargetLocationMarked=true;
o.blankingRadiusReTargetHeight=0;
o.fixationCrossDeg=3;
o.fixationBlankingRadiusReTargetHeight=0;
o.fixationMarkDeg=3;
end
switch o.noiseType
case 'gaussian'
Expand Down
6 changes: 3 additions & 3 deletions December2017.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
% o.useFractionOfScreenToDebug=0.4; % 0: normal, 0.5: small for debugging.
o.experimenter='';
o.observer='';
o.blankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReEccentricity=0;
if 0
o.targetKind='letter';
o.targetFont='Sloan';
Expand All @@ -138,11 +138,11 @@
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=0;
end
o.blankingRadiusReTargetHeight=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.moviePreSec = 0.2;
o.moviePostSec = 0.2;
o.targetMarkDeg=1;
o.fixationCrossDeg=3;
o.fixationMarkDeg=3;
o=NoiseDiscrimination(o);
if o.quitExperiment
break
Expand Down
46 changes: 18 additions & 28 deletions MeasurePupil.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,9 @@
error('This screen has not yet been calibrated. Please use CalibrateScreenLuminance to calibrate it.\n');
end

%% Must call Brightness while no window is open.
useBrightnessFunction=true;
if useBrightnessFunction
Brightness(cal.screen,cal.brightnessSetting); % Set brightness.
cal.brightnessReading=Brightness(cal.screen); % Read brightness.
if cal.brightnessReading==-1
% If it failed, try again. The first attempt sometimes fails.
% Not sure why. Maybe it times out.
cal.brightnessReading=Brightness(cal.screen); % Read brightness.
end
if isfinite(cal.brightnessReading) && abs(cal.brightnessSetting-cal.brightnessReading)>0.01
error('Set brightness to %.2f, but read back %.2f',cal.brightnessSetting,cal.brightnessReading);
end
end
if ~useBrightnessFunction
if false && cal.ScreenConfigureDisplayBrightnessWorks
try
% [Brightness.m has now grown to become MacDisplaySettings.m]
% Caution: Screen ConfigureDisplay Brightness gives a fatal error
% if not supported, and is unsupported on many devices, including
% a video projector under macOS. We use try-catch to recover.
Expand Down Expand Up @@ -108,18 +95,21 @@
cal.brightnessReading=NaN;
end
end
if cal.ScreenConfigureDisplayBrightnessWorks
s=GetSecs;
ffprintf(ff,'Calling MacDisplaySettings. ... ');
newSettings.brightness=cal.brightnessSetting;
newSettings.automatically=false;
newSettings.trueTone=false;
newSettings.nightShiftSchedule='Off';
newSettings.nightShiftManual=false;
oldDisplaySettings=MacDisplaySettings(cal.screen,newSettings);
ffprintf(ff,'Done (%.1f s)\n',GetSecs-s);
ffprintf(ff,'Setting "brightness" to %.2f, on a scale of 0.0 to 1.0;\n',cal.brightnessSetting);

s=GetSecs;
ffprintf(ff,'Calling MacDisplaySettings. ... ');
newSettings.brightness=cal.brightnessSetting;
newSettings.automatically=false;
newSettings.trueTone=false;
newSettings.nightShiftSchedule='Off';
newSettings.nightShiftManual=false;
oldDisplaySettings=MacDisplaySettings(cal.screen,newSettings);
cal.brightnessReading=MacDisplaySettings(cal.screen); % Read brightness.
if isfinite(cal.brightnessReading) && abs(cal.brightnessSetting-cal.brightnessReading)>0.01
error('MacDisplaySettings set brightness to %.2f, but read back %.2f',cal.brightnessSetting,cal.brightnessReading);
end
ffprintf(ff,'Done (%.1f s)\n',GetSecs-s);
ffprintf(ff,'Setting "brightness" to %.2f, on a scale of 0.0 to 1.0;\n',cal.brightnessSetting);

%% TRY-CATCH BLOCK CONTAINS ALL CODE IN WHICH WINDOW IS OPEN
try
Expand Down Expand Up @@ -468,7 +458,7 @@
sca; % Screen('CloseAll'); ShowCursor;
RestoreCluts;
if ismac
AutoBrightness(cal.screen,1); % Restore autobrightness.
MacDisplaySettings(cal.screen,oldSettings);
end
if ~isempty(window)
Screen('Preference','VisualDebugLevel',oldVisualDebugLevel);
Expand All @@ -483,7 +473,7 @@
if exist('cal','var') && isfield(cal,'old') && isfield(cal.old,'gamma')
Screen('LoadNormalizedGammaTable',0,cal.old.gamma);
end
MacDisplaySettings(cal.screen,oldSettings);
MacDisplaySettings(cal.screen,oldSettings);
if dataFid>-1
fclose(dataFid);
dataFid=-1;
Expand Down
8 changes: 4 additions & 4 deletions NeqOfCrowdingRun.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
o.annularNoiseSD=0;
o.noiseRadiusDeg=inf;
o.isTargetLocationMarked=true;
o.fixationCrossWeightDeg=0.09;
o.fixationCrossDeg=3;
o.blankingRadiusReEccentricity=0; % No blanking.
o.blankingRadiusReTargetHeight=2;
o.fixationThicknessDeg=0.09;
o.fixationMarkDeg=3;
o.fixationBlankingRadiusReEccentricity=0; % No blanking.
o.fixationBlankingRadiusReTargetHeight=2;
o.targetMarkDeg=15;
if true
% Target letter
Expand Down
8 changes: 4 additions & 4 deletions NvsPixels.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
o.viewingDistanceCm=40;
o.isLuminanceRangeSymmetric=true;
o.alphabetPlacement='right'; % 'top' or 'right';
o.fixationCrossWeightDeg=0.09;
o.blankingRadiusReEccentricity=0; % No blanking.
o.blankingRadiusReTargetHeight=0;
o.fixationThicknessDeg=0.09;
o.fixationBlankingRadiusReEccentricity=0; % No blanking.
o.fixationBlankingRadiusReTargetHeight=0;
o.targetMarkDeg=2;
o.fixationCrossDeg=3;
o.fixationMarkDeg=3;
if true
% Target letter
o.targetKind='letter';
Expand Down
6 changes: 3 additions & 3 deletions checkSize2Run.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
if oi>1 && isempty(o.experimenter)
o.experimenter=oOut.experimenter;
end
o.blankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReEccentricity=0;
if 0
o.targetKind='letter';
o.targetFont='Sloan';
Expand All @@ -123,11 +123,11 @@
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=0;
end
o.blankingRadiusReTargetHeight=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.moviePreSec = 0.2;
o.moviePostSec = 0.2;
o.targetMarkDeg=1;
o.fixationCrossDeg=3;
o.fixationMarkDeg=3;
oOut=NoiseDiscrimination(o);
if oOut.quitExperiment
break
Expand Down
6 changes: 3 additions & 3 deletions checkSizeRun.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
if oi>1 && isempty(o.experimenter)
o.experimenter=oOut.experimenter;
end
o.blankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReEccentricity=0;
if 0
o.targetKind='letter';
o.targetFont='Sloan';
Expand All @@ -111,11 +111,11 @@
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=0;
end
o.blankingRadiusReTargetHeight=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.moviePreSec = 0.2;
o.moviePostSec = 0.2;
o.targetMarkDeg=1;
o.fixationCrossDeg=3;
o.fixationMarkDeg=3;
oOut=NoiseDiscrimination(o);
if oOut.quitExperiment
break
Expand Down
6 changes: 3 additions & 3 deletions criterion2Run.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
if oi>1 && isempty(o.experimenter)
o.experimenter=oOut.experimenter;
end
o.blankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReEccentricity=0;
if 0
o.targetKind='letter';
o.targetFont='Sloan';
Expand All @@ -135,11 +135,11 @@
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=0;
end
o.blankingRadiusReTargetHeight=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.moviePreSec = 0.2;
o.moviePostSec = 0.2;
o.targetMarkDeg=1;
o.fixationCrossDeg=3;
o.fixationMarkDeg=3;
oOut=NoiseDiscrimination(o);
if oOut.quitExperiment
break
Expand Down
18 changes: 9 additions & 9 deletions csfDemos.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
o.pThreshold=0.75;
o.isNoiseDynamic=false;
o.moviePreAndPostSecs=[0.2 0.2];
o.fixationCrossDeg=3;
o.blankingRadiusReEccentricity=0;
o.blankingRadiusReTargetHeight=0;
o.fixationMarkDeg=3;
o.fixationBlankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.targetMarkDeg=1;
o.noiseType='gaussian'; % 'gaussian' or 'uniform' or 'binary' or 'ternary'
if 1
Expand Down Expand Up @@ -68,12 +68,12 @@

%% SPECIFY CONDITIONS IN ooo STRUCT
ooo={};
o.blankingRadiusReTargetHeight=nan;
o.fixationBlankingRadiusReTargetHeight=nan;
o.targetDurationSecs=0.2;
o.desiredLuminanceAtEye=[];
o.desiredLuminanceFactor=1;
o.useFilter=false;
o.fixationCrossWeightDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.fixationThicknessDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.noiseType='ternary';
% o.saveStimulus=false;
o.noiseCheckFrames=2;
Expand All @@ -98,12 +98,12 @@

if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=false;
o.blankingRadiusReTargetHeight=0.6;
o.fixationCrossDeg=inf;
o.fixationBlankingRadiusReTargetHeight=0.6;
o.fixationMarkDeg=inf;
else
o.isTargetLocationMarked=true;
o.blankingRadiusReTargetHeight=0;
o.fixationCrossDeg=3;
o.fixationBlankingRadiusReTargetHeight=0;
o.fixationMarkDeg=3;
end
switch o.targetKind
case 'gabor'
Expand Down
18 changes: 9 additions & 9 deletions csfFovealLettersStaticRun.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
o.pThreshold=0.75;
o.isNoiseDynamic=false;
o.moviePreAndPostSecs=[0.2 0.2];
o.fixationCrossDeg=3;
o.blankingRadiusReEccentricity=0;
o.blankingRadiusReTargetHeight=0;
o.fixationMarkDeg=3;
o.fixationBlankingRadiusReEccentricity=0;
o.fixationBlankingRadiusReTargetHeight=0;
o.targetMarkDeg=1;
o.noiseType='gaussian'; % 'gaussian' or 'uniform' or 'binary' or 'ternary'
if 1
Expand Down Expand Up @@ -69,12 +69,12 @@

%% SPECIFY CONDITIONS IN ooo STRUCT
ooo={};
o.blankingRadiusReTargetHeight=nan;
o.fixationBlankingRadiusReTargetHeight=nan;
o.targetDurationSecs=0.2;
o.desiredLuminanceAtEye=[];
o.desiredLuminanceFactor=1;
o.useFilter=false;
o.fixationCrossWeightDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.fixationThicknessDeg=0.03; % Typically 0.03. Make it thicker for scotopic testing.
o.noiseType='ternary';
o.noiseType='gaussian';
o.saveStimulus=false;
Expand All @@ -98,12 +98,12 @@
o.noiseCheckDeg=o.targetHeightDeg/20;
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=false;
o.blankingRadiusReTargetHeight=0.6;
o.fixationCrossDeg=inf;
o.fixationBlankingRadiusReTargetHeight=0.6;
o.fixationMarkDeg=inf;
else
o.isTargetLocationMarked=true;
o.blankingRadiusReTargetHeight=0;
o.fixationCrossDeg=3;
o.fixationBlankingRadiusReTargetHeight=0;
o.fixationMarkDeg=3;
end
switch o.targetKind
case 'gabor'
Expand Down
Loading

0 comments on commit fd79ca9

Please sign in to comment.