This feature branch introduces corrections of primaries/directions to contrast
Major changes:
The original spectral correction can now be found in OLCorrectToSPD; this function takes in a target SPD, and seeks primary values that minimize error between the measured SPD and the target SPD.
A new core OLLibrary function OLCorrectToContrast is introduced, which takes in a background SPD and initial direction SPD, and receptors and target contrasts. It iteratively adjusts the direction SPD, minimizing error between the measured contrast and the target contrasts
Both OLCorrectToContrast and OLCorrectToSPD now take in a keyword argument lightlevelScaleFactor. As we are generally less concerned with changes in the overall lightlevel rather than changes in the spectrum, you can tell the corrections routines how much light we lost with this scale factor. The corrections routines then scale up all the measurements by this scale factor, pretending all the SPDs are in the same lightlevel range in as the calibration. The #dev branch already has the function OLMeasureLightlevelScalar which will return this scale factor. Usage of this scale factor in corrections is highly recommended!
OLCorrectDirection (both for unipolar and bipolar direction objects) will correct to contrast when provided with the optional receptors keyword argument. If this is provided, it will use the core library OLCorrectToContrast routine. If no receptors are provided, it will use OLCorrectToSPD. In both cases, OLCorrectDirection still requires both a direction and a background.
Note on receptors:
Any receptor argument can take in either the flat T_receptor matrix, or an SSTReceptor object, to calculate contrast. In the latter case, contrast is calculated with respect to the T_energyNormalized matrix in the receptor.T.T_energyNormalized field. This is part of a push to use the SSTReceptor objects more, for integration with the SilentSubstitutionToolbox and ultimately splatter calculations. If you need to calculate receptor excitations or contrasts, it's best to use the SST routines SPDToReceptorExcitation or SPDToReceptorContrast, respectively, which can also handle either SSTReceptor objects, or flat T_receptor matrices.
Minor changes
legacyMode has been removed.
Corrections can be fully simulated.
Smoothness parameter passed through pipeline for both unipolar and bipolar corrections.
Corresponding updates to OLCheckPrimaryCorrection debugging routine.
Corrections will always pick the best iteration, i.e., the iteration with lowest RMSE (on SPD or contrast), rather than the final iteration.
This feature branch introduces corrections of primaries/directions to contrast
Major changes:
OLCorrectToSPD
; this function takes in a target SPD, and seeks primary values that minimize error between the measured SPD and the target SPD.OLCorrectToContrast
is introduced, which takes in a background SPD and initial direction SPD, and receptors and target contrasts. It iteratively adjusts the direction SPD, minimizing error between the measured contrast and the target contrastsOLCorrectToContrast
andOLCorrectToSPD
now take in a keyword argumentlightlevelScaleFactor
. As we are generally less concerned with changes in the overall lightlevel rather than changes in the spectrum, you can tell the corrections routines how much light we lost with this scale factor. The corrections routines then scale up all the measurements by this scale factor, pretending all the SPDs are in the same lightlevel range in as the calibration. The #dev branch already has the functionOLMeasureLightlevelScalar
which will return this scale factor. Usage of this scale factor in corrections is highly recommended!OLCorrectDirection
(both for unipolar and bipolar direction objects) will correct to contrast when provided with the optionalreceptors
keyword argument. If this is provided, it will use the core libraryOLCorrectToContrast
routine. If no receptors are provided, it will useOLCorrectToSPD
. In both cases,OLCorrectDirection
still requires both a direction and a background.Note on receptors:
Any
receptor
argument can take in either the flatT_receptor
matrix, or anSSTReceptor
object, to calculate contrast. In the latter case, contrast is calculated with respect to theT_energyNormalized
matrix in thereceptor.T.T_energyNormalized
field. This is part of a push to use theSSTReceptor
objects more, for integration with the SilentSubstitutionToolbox and ultimately splatter calculations. If you need to calculate receptor excitations or contrasts, it's best to use the SST routinesSPDToReceptorExcitation
orSPDToReceptorContrast
, respectively, which can also handle either SSTReceptor objects, or flatT_receptor
matrices.Minor changes
legacyMode
has been removed.OLCheckPrimaryCorrection
debugging routine.