Dr.Ashoka G K wrote:

> Many DICOM related softwares have a feature to alter window level and
> window width of the images. Is this the same as changing the
> brightness and contrast of the image?

my guess is that the "window" is the range of levels in the source image 
that's being mapped to the 256 levels supported by most displays.

if "image" is an "L" or "I" image, you can use the "point" method to do 
linear windowing:

    scale = 256.0 / window_width
    offset = -window_level * scale

    out = image.point(lambda i: i * scale + offset, "L")

to implement non-linear transforms, use a lookup table instead (see the 
"point" documentation for details).

hope this helps!

</F>

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to