Section: Handle-Based Graphics
winlev(window,level)
where window is the new window, and level is the new level, or
winlev
in which case it returns a vector containing the current window and level for the active image.
[0,1], and must
therefor map an arbitrary image x to this range before it can
be displayed. By default, the image command chooses
and
This ensures that the entire range of image values in x are
mapped to the screen. With the winlev function, you can change
the range of values mapped. In general, before display, a pixel x
is mapped to [0,1] via:
--> t = linspace(-1,1,256); --> xmat = ones(256,1)*t; ymat = xmat'; --> A = exp(-(xmat.^2 + ymat.^2)*100); --> image(A);
The data range of A is [0,1], as we can verify numerically:
--> min(A(:)) ans = <double> - size: [1 1] 1.3838965267367376e-87 --> max(A(:)) ans = <double> - size: [1 1] 0.9969289851428387
To see the tail behavior, we use the winlev command to force FreeMat
to map a smaller range of A to the colormap.
--> image(A); --> winlev(1e-4,0.5e-4)
The result is a look at more of the tail behavior of A.
We can also use the winlev function to find out what the
window and level are once set, as in the following example.
--> image(A); --> winlev(1e-4,0.5e-4) --> winlev ans = <double> - size: [1 1] 0.0001