# How WW/WL and ColorTransferFunction influence the visilization of the image.

**URL:** https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258
**Category:** Web
**Created:** [February 10, 2025, 3:59pm UTC](https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258 "2025-02-10T15:59:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![iris\_Li](https://discourse.vtk.org/user_avatar/discourse.vtk.org/iris_li/32/9798_2.png) [@iris\_Li](https://discourse.vtk.org/u/iris_Li)
#### Post date: [February 10, 2025, 3:59pm UTC](https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258/1 "2025-02-10T15:59:40Z")

</div>

I set both ww/wl and ColorTransferFunction for a image property. I find when I adjust the ww/wl by mouse the appearence of the image change. I want to know the underline math of WW/WL and the ColorTransferFunction. Thanks.

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [February 10, 2025, 4:39pm UTC](https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258/2 "2025-02-10T16:39:03Z")

</div>

Hi Iris,

You can find some information about window leveling here:  
[https://radiopaedia.org/articles/windowing-ct](https://radiopaedia.org/articles/windowing-ct)

Regarding ColorTransferFunction, it is the same idea, you create a color mapping function that converts the image scalar values into an RGB color. To do so, you associate an RGB color to a given scalar value and the color transfer function does interpolation between the colors you added (i.e. AddRGBPoint)

Hth,  
Julien.

---

<div class="post-metadata">

### Author: ![iris\_Li](https://discourse.vtk.org/user_avatar/discourse.vtk.org/iris_li/32/9798_2.png) [@iris\_Li](https://discourse.vtk.org/u/iris_Li)
#### Post date: [February 10, 2025, 5:15pm UTC](https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258/3 "2025-02-10T17:15:46Z")

</div>

Thanks for your answer. I understand the idea of the window level, window width and colorTransferFunction. I want to know the exact intensity map function. Does the WW/WL convert the image intensity into the range of [0,1] by clip((i-WL+0.5WW)/WW,0,1). Does the input of the colorTransferFunction is the WW/WL transfered intensity, i.e. the output of clip((i-WL+0.5WW)/WW,0,1).

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [February 10, 2025, 7:07pm UTC](https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258/4 "2025-02-10T19:07:50Z")

</div>

what actor/mapper are you using ?

---

<div class="post-metadata">

### Author: ![iris\_Li](https://discourse.vtk.org/user_avatar/discourse.vtk.org/iris_li/32/9798_2.png) [@iris\_Li](https://discourse.vtk.org/u/iris_Li)
#### Post date: [February 11, 2025, 12:06am UTC](https://discourse.vtk.org/t/how-ww-wl-and-colortransferfunction-influence-the-visilization-of-the-image/15258/5 "2025-02-11T00:06:00Z")

</div>

Just vtkImageResliceMapper and vtkImageSlice.
