# Re: Algorithm for "Windows Center" and "Windows Width"

Hi kevin.

I know these ,yesterday i was trying to use these staements..

i hav some of questions related to the below lines

1)what is x,is it each pixel in the image array?

2)what is ymin and ymax,is these are the min and max pixel value within
that array?

3)do i have to match resultant y, to some look up table(I donot have
any right now).

or how can i use this y to supply as parameter to brightness or
contrast matrice.

or how to find new w/l value from the y.

Kevin Osborn wrote:
From the DICOM specification PS 3.3-2004 C11.2.1.2, (p. 698):

where x is the input value, y is an output value with a range from ymin
to ymax, c is window center and w is window width:

if (x <= c - 0.5 - (w-1)/2), then y = ymin

elseif (x > c - 0.5 + (w-1)/2), then y = ymax

else y = ((x - (c - 0.5))/(w - 1) + 0.5) * (ymax - ymin) + ymin

See discussion of VOI LUT module for a more detailed explanation.

Kevin

Neeraj wrote:
Hi Peter,

Now i am able to find Houns field value,and it is working fine,as
you hava mentioned in your previous mail that there is no relation
between W/L and Houns field,now my real problem is how to find W/l, i
tried everywhere but got no answer.

Is there any standard formula exists?,now i have the Cener and width
value(taken from the Tag). how can i make use of these value to
calculate W/l and apply to the contrast and brightness?.

I have two matrices brightness and contrast matrix.which i used for
brightness and contrast upon a trakbar move, instead of trackbar value
is it possible to apply w or l value
to the same matrices.

Please kindly help,i am totally halted here.

bye
Neeraj.

Peter B Schmidt wrote:
Hello Neeraj,

The Hounsfield Values are not affected by the Center/Window (C/W)
settings, these are affected by "Rescale Intercept" and "Rescale Slope".

C/W tells you, which values have been found eligible to display by the
one who generated the image.

IIRC, you map (Center - 0.5 * window width) to the darkest pixel value
(black), and the brightest value (255 gray = white) to (Center + 0.5 *
window width) - which gives you a span of the width of window width
grayscale values mapped to the range of displayed grays.

I hope this helps to get started, further suggested reading is the DICOM
Standard Display Function explained in Part 14 of the standard.

Kind regards,

Peter

.

## Relevant Pages

• Re: Algorithm for "Windows Center" and "Windows Width"
... where x is the input value, y is an output value with a range from ymin to ymax, c is window center and w is window width: ... calculate W/l and apply to the contrast and brightness?. ... Standard Display Function explained in Part 14 of the standard. ...
(comp.protocols.dicom)
• Postcscript: Hi-tech Accessibility Catch-22
... >> and contrast for you. ... > brightness from the '80' default, ... Having used the Samsung flat panel for a week now, ... over its advantages vs. the flat CRT monitor I used before. ...
(uk.people.disability)
• Re: real plasma "contrast ratio" ??
... does...I see many around Contrast at 3000:1 and Brightness at 1500 ... Viewing angle: Forget what the manufacturer claims and just walk back ...
(alt.tv.tech.hdtv)
• What Are the Important Display Specs?
... Starting with Brightness: Plasmas are listed as being considerably ... Contrast ratio: My computer monitor is listed at about 800:1 while ... My TV set advertises 178 degrees viewing angle. ...
(alt.tv.tech.hdtv)
• Re: HDV to HD-DVD
... If the preview is adequate for contrast and brightness adjustment, ... HC3?) ... preview it in HDV is either to add a Blackmagic Decklink or AJA card ...
(rec.video.desktop)