06-18-2008, 11:30
|
GregR

Joined on 05-31-2006
In House
Posts 1,502
|
Re: How can i get and set window level value and contrast/brightness?
|
 
 
|
|
|
Window leveling is a purely logical concept. It only tells the viewing
application how to interpret the 12 or 16bpp data because windows can
only display 256 (8bpp) shades of gray.
Brightness and Contrast can be physically applied to the image, but once it is done it is permanent and there isn't a way to calculate what brightness and contrast changes have been made. LEADTOOLS also provides the ability to just change the brightness and contrast in the way it gets painted rather than physically changing the image. To do this, use RasterImage.PaintContrast and PaintIntensity. These are values that you can get and set and then save them out to a file as well.
It is possible to store the window center and width in a Dicom dataset (0028:0050 and 0028:0051), but TIF files do not have the same concept. In this case you'll need to just keep track of the values the user has selected each time they ever change them and then save them to a separate file.
If there isn't a Window center and width values set either in your separate file or in the dataset, then you'll need to calculate it based on the bpp to set the width as the maximum width, and then divide that by two in order to get the center.
Greg Ross LEADTOOLS Technical Support
|
|
|
|
|
Report
|
|
|
|