Interface: MagnitudeOpacity
Defined in: layers/magnitudeOpacity.ts:25
Magnitude-graded opacity for scalar maps.
A map coloured by value can also fade by |value|, so weak effects recede toward the anatomy beneath them and strong effects read as solid. This is the "dual coding" of effect size and evidence advocated by Allen, Erhardt and Calhoun (2012) and Taylor et al. (2023): nothing is hidden by the fade, and a threshold mask, when one is set, still hides values outright.
Opacity is evaluated separately for each sign. For a value v with magnitude m = |v| on the side of zero it lies:
start = max(low, threshold edge on that side) end = high, or the colour-range end on that side when high is 'range' alpha = 0 when m < start = floor' + (1 - floor') * clamp((m - start) / (end - start))^gamma
where floor' is floor when start > 0 and 0 when start is 0, so an unthresholded map fades all the way to transparent at zero while a thresholded map keeps its weakest shown values visible. With low = 0, gamma = 1 and floor = 0.6 this reproduces neuroim2's "ramp" overlay alpha; a positive low (a knee) and a fitted gamma reproduce its "soft" mode.
Properties
low?
low?: number;Defined in: layers/magnitudeOpacity.ts:27
Magnitude below which values are transparent. Defaults to 0.
high?
high?: number | "range";Defined in: layers/magnitudeOpacity.ts:29
Magnitude at which opacity reaches 1, or 'range' for the colour-range end. Defaults to 'range'.
gamma?
gamma?: number;Defined in: layers/magnitudeOpacity.ts:31
Exponent applied to the normalized magnitude. Defaults to 1 (linear).
floor?
floor?: number;Defined in: layers/magnitudeOpacity.ts:33
Opacity at a positive start magnitude, in [0, 1]. Defaults to 0.