[vtkusers] what does the "SetLevel" (I mean the level value) do in vtk?

Obada Mahdi omahdi at gmx.de
Fri Jun 23 18:34:53 EDT 2006

Hello zl2k,

"level" and "window" (or "window level" and "window width") are 
parameters used to describe a certain mapping of (arbitrary) real values 
onto a given closed interval.  For values l and w (for level and 
window), the interval [l-(w/2); l+(w/2)] is linearly mapped onto the 
full "target interval" (say, [t0; t1]).  Any values in the domain that 
are less than l-(w/2) or greater than l+(w/2) are mapped to t0 and t1, 

kdsfinger at gmail.com wrote:
 > The SetWindow and SetLeve often come together (or SetWindowLevel). I
 > understand the window gives a range of the color that vtk is going to
 > deal with and cast those out of range to the two ends. Level value is
 > usually set in the middle of that range. But I don't understand what
 > does the level value stands for.

When dealing with colors, the target interval often corresponds to the 
color intensity range your display can handle, and the level/window 
parameters are used to describe how scalar values should be mapped to 
that range.  There is a close relation between level/window and 
brightness/contrast, although they are not exactly the same:

 > If I adjust the level value lower then the image looks brighter.

By lowering the level value and leaving the window width unchanged, 
smaller scalars are effectively mapped to higher values, making the 
image brighter.  "Brightness" and "contrast" can be seen as a more 
intuitive way to describe the same kind of mapping for adjusting the 
overall optical appearance of an image (in the special case where source 
and target intervals are the same).



More information about the vtkusers mailing list