Window Level in JPEG

42 views
Skip to first unread message

Muhammad Umar Hayat

unread,
Aug 30, 2022, 9:56:39 AM8/30/22
to cornerstone platform
Hi, i am Muhammad Umar Hayat Mobile Application developer. I am building a mobile application in react native. I get data on Medical images in the form of JPEG. I control the brightness and contrast by hand-coded value.  
My Problem is how to calculate window leveling for JPEG images. For the brain, by default value is 80/40.

Alvin Aloshyous

unread,
Aug 30, 2022, 11:00:54 AM8/30/22
to Muhammad Umar Hayat, cornerstone platform
Hi,
If you have access to the pixel data, you can control the brightness contrast using below equation:
  • if (x <= c - 0.5 - (w-1) /2), then y = ymin

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

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

where x is  the input pixel and y is the output pixel.

More details can be found on the following link:


BR


On Tue, Aug 30, 2022 at 5:56 PM Muhammad Umar Hayat <umarha...@gmail.com> wrote:
Hi, i am Muhammad Umar Hayat Mobile Application developer. I am building a mobile application in react native. I get data on Medical images in the form of JPEG. I control the brightness and contrast by hand-coded value.  
My Problem is how to calculate window leveling for JPEG images. For the brain, by default value is 80/40.

--
You received this message because you are subscribed to the Google Groups "cornerstone platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cornerstone-plat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cornerstone-platform/e98225b1-ae29-4ba1-9036-933cea5afbeen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages