[gammaTable1, gammaTable2, displayRange. displayGamma] =
A simple calibration script for analog photometers. numMeasures (default: 9)
readings are taken manually, and the readings are fit with a gamma function
and piecewise cubic splines. numMeasures - 1 should be a power of 2, ideally (9, 17, 33, etc.).
The corresponding linearized gamma tables (1 -> gamma,
2 -> splines) are returned, as well as the display baseline, display range in cd/m^2 and
display gamma. Plots of the two fits are created as well. Requires fit
tools.
If the normalized gamma table is not loaded, then the cd/m^2 value of a
screen value can be figured out by the formula: cdm2 =
displayRange*(screenval/255).^(1/displayGamma) + displayBaseline.
Generally, you will want to load the normalized gamma tables and use them
in
Screen('
LoadNormalizedGammaTable'). For example:
[gammaTable1, gammaTable2] =
CalibrateMonitorPhotometer;
%Look at the outputted graphs to see which one gives a better fit
%Then save the corresponding gamma table for later use
gammaTable = gammaTable1;
save
MyGammaTable gammaTable
%Then when you're ready to use the gamma table:
load
MyGammaTable
Screen('
LoadNormalizedGammaTable', win, gammaTable*[1 1 1]);
History:
Version 1.0: Patrick Mineault (patrick.mineault@gmail.com)
22.10.2010 mk Switch numeric input from use of input() to use of
GetNumber(). Restore gamma table after measurement. Make
more robust.
Psychtoolbox/PsychCal/CalibrateMonitorPhotometer.m