pjhenry1216
December 7th, 2005, 02:57 PM
I'm trying to make a viewer that displays a 16-bit image. However, I don't want to display 16-bits of data. I'm using a window/level algorithm to pick a certain region of the 16-bits of data and then scaling it to 8 bits.
For those of you unfamiliar with windowing and leveling, basically it involves picking a minimum pixel value and a maximum pixel value to display. The range in between is then mapped to 8-bits. So, basically, the window/level algorithm could map all pixel values between 10000 and 30000 to 0 to 255. anything below 10000 would be 0 and anything above 30000 would be 255.
Anyway, this is my problem. I want to give the user the ability to change the window and level on the fly. So, I want to keep the 16-bit data in memory and display the 8-bit image, and as they change the window and level, i want to update the 8-bit image. Does anybody know how i could go about this? Even if its a somewhat different approach. Don't hesitate to ask any questions to clarify the situation. Any help at all is appreciated as would be any information pointing me in the right direction of where i can find help.
For those of you unfamiliar with windowing and leveling, basically it involves picking a minimum pixel value and a maximum pixel value to display. The range in between is then mapped to 8-bits. So, basically, the window/level algorithm could map all pixel values between 10000 and 30000 to 0 to 255. anything below 10000 would be 0 and anything above 30000 would be 255.
Anyway, this is my problem. I want to give the user the ability to change the window and level on the fly. So, I want to keep the 16-bit data in memory and display the 8-bit image, and as they change the window and level, i want to update the 8-bit image. Does anybody know how i could go about this? Even if its a somewhat different approach. Don't hesitate to ask any questions to clarify the situation. Any help at all is appreciated as would be any information pointing me in the right direction of where i can find help.