Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Support for 16 bit grayscale Images
Qt 6.11 is out! See what's new in the release blog

Support for 16 bit grayscale Images

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 10.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ankush205
    wrote on last edited by
    #1

    I am designing a dicom viewer for a major company for displaying an medical images..and medical images need more image clarity and better depth.So does QT support 1 bit gray scale images?
    Earlier when i wanted gray scale images i simply used RGB32 format with same values applied to all channels..
    So can anyone clarify is there a way to display 16 bit grayscale images in QT
    and yes i cannot reduce 16 bit image to 8 bit image for display as better clarity is d most important need for medical images.

    For 8 bit gray scale image i used

    char *image
    image->setpixel(*imagebuffer,*imagebuffer,*imagebuffer);

    it worked well for gray scale images

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, welcome to devnet.

      There is no direct support for 16bit/channel formats in Qt.

      You say you can't reduce it to 8bit but why not exactly? The monitor that displays the image will most probably be 8bit/channel anyway (even the most hi-end monitors display up to only 10bit/channel color), so it will get downscaled. The question is just where. If there was a 16bit format in Qt either Qt would have to do that or the OS graphics api it uses would.

      So you might just as well do it yourself. This way you'll get at least greater control over how it's done eg. apply some transformation like brightness, contrast etc. to get that clarity you need.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ankush205
        wrote on last edited by
        #3

        yes it is a nice idea.
        i jst make sure about monitor and come back to QT,i changed my platform just because no support of 16 bit image

        Thanks for reply :)

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          To add to Chris Kawa, you could use OpenCV for all the 16bit image processing part and then Qt at the end for the presentation part.

          Hope it helps

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pmh4514
            wrote on last edited by
            #5

            I am doing something similar. First, remember that except for specialized high-end medical grade displays, you will always be displaying 8bit data, so the question is how do you map the native data to the display.

            I use OpenCV to read my native 16bit grayscale medical images (Actually 11bit stored in a 16bit container) and then calculate a lookup table (based on user supplied settings) which remaps the appropriate window within the 16bit data to 8bit for display.

            Then you can use QPixmap or QImage as needed.

            edit: you wrote "i cannot reduce 16 bit image to 8 bit image for display as better clarity is d most important need for medical images."

            Herein is your primary source of confusion. Not only can you, but you MUST unless you know you will always be using displays capable of showing more than 8 bit. This does NOT imply that you are going to lose clarity in your images. What it does imply is that you must map your raw image to 8bits, and this is where the user defined lookup table (LUT) comes into play. Your user will provide values for window level, brightness/contrast/threshold etc.. These settings do not apply directly to pixels, rather, they are used to calculate a lookup table which is then used to quickly transform the image for display (non-destructively)

            last edit: I'd recommend you get a book like this: "Digital Image Processing for Medical Applications":http://www.cambridge.org/us/academic/subjects/engineering/biomedical-engineering/digital-image-processing-medical-applications

            1 Reply Last reply
            1
            • SachinBhatS Offline
              SachinBhatS Offline
              SachinBhat
              wrote on last edited by
              #6

              Qt now supports 16 bit handling in 5.12 version

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved