3 Replies Latest reply on Aug 10, 2011 2:07 AM by er453r

    Display 16 bits grayscale image

    XaviBis345

      Hi all

       

      I'm trying to display a 16 bits grayscale image in a Bitmap but I have some problems. The Bitmap class uses 8 bits per color so I have to convert the 16 bits grayscale to 8 bit grayscale.

       

      I have develop an algortihm what uses 2 values, called window center and window width. This algorithm is described in several papers. It works fine with unsigned pixel values but I have problems with signed pixel values.

       

      My question is ... are there any component in flex / actionscript what can display a 16 bit grayscale image?

       

      If there aren't any component, do you know how to convert signed data to unsigned? I mean, 16 bit signed pixel range is -32000 to 32000 (more or less) and I want to conver to 0 - 64000.

       

      How can I do that?

       

      Thanks a lot!!!

        • 1. Re: Display 16 bits grayscale image
          er453r Level 1

          Sounds like you are trying to display a DICOM image

           

          Currently this is not possible. You have to scale down the image depth to 8bits/channel. Just modify your window function to return values from range 0 -255. We discussed various solutions here http://forums.adobe.com/thread/875413. Vote on this issue in the bug tracker

          • 2. Re: Display 16 bits grayscale image
            XaviBis345 Level 1

            I have seen this discussion yet but I still have a problem. I need to store the original pixel values because I have to modify the brightness of the image in real time so I need to work with the original pixel values (in 16 bits) and apply the brightness algorithm and after that convert to 8 bits

             

            My problem is work with signed pixel values. My image pixel are signed, so a pixel value can be -100 and I have to display in Bitmap

             

            Does anyone know how to do it?

            • 3. Re: Display 16 bits grayscale image
              er453r Level 1

              I think there are 2 ways to do this.

               

              1. You can store original pixel values in a vector, and after each window change modify pixels in the image.

              2. If you need speed - split your 16 bit pixel value to 2 8bit parts, save them in a standard image channels, and write a pixelbender shader.