Determines optimal scaling constant for a list of CIs
Arguments
- cis
List of classification images, each a list of pixel matrices holding at least the noise (
$ci), plus the base image ($base) if PNGs are to be written.- save_as_pngs
Boolean: combine each autoscaled noise pattern with its base image and save it as a PNG, named after its key in
cis. Every element then needs a name of its own; withFALSE, names are not needed.- targetpath
Directory to save PNGs to. Required when
save_as_pngs = TRUE; there is no default. The directory is created if it does not exist; to just try the function out, usetempdir().
Value
The input cis list, with each element's $scaled matrix replaced by its
autoscaled version. The scaling constant is printed to the console, and recorded in each
element's scaling attribute, which keeps the earlier record for $combined;
vignette("stored-data", package = "rcicr") lists its fields.
Look at $scaled, not $combined. $combined is returned exactly
as it was passed in, on purpose, so that existing scripts that plot it keep producing the same
image. Only $scaled holds the autoscaled result. To show the autoscaled noise over the
base image, compute (ci$scaled + ci$base) / 2: that is exactly what
save_as_pngs = TRUE writes to disk.
This catches people out after batchGenerateCI or
batchGenerateCI2IFC. Both scale with 'none' before calling this
function, so their $combined overlays the unscaled noise and looks almost blank,
while $scaled is the image you want.
See also
vignette("reverse-correlation-walkthrough", package = "rcicr"), sections "Scaling" and "Several participants at once".
