RGB byte order - DICOM

This is a discussion on RGB byte order - DICOM ; Hi, I have an RGB ELE image but I am not sure if the byte ordering in the pixel data tag is correct. bits stored 8 bits allocated 8 high bit 7 samples per pixel 3 planar configuration 0 Because ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: RGB byte order

  1. RGB byte order

    Hi,

    I have an RGB ELE image but I am not sure if the byte ordering in the
    pixel data tag is correct.

    bits stored 8
    bits allocated 8
    high bit 7
    samples per pixel 3
    planar configuration 0

    Because it's little endian I would expect the following order
    {B1G1R1, B2G2R2, ....} first the blue value, green value and at last
    the red value

    Am I correct?


  2. Re: RGB byte order

    You're right.

    See C.7.6.3.1.3 ("Planar Configuration") DICOM Part 3 (p.282)


  3. Re: RGB byte order

    You are right about the interleaving but wrong about the order.

    It is R1G1B1R2G2B2, not B1G1R1B2G2R2.

    See PS 3.3 C.7.6.3.1.3.

    Also, since they are 8 bit values, little or big endian makes no
    difference.

    David


  4. Re: RGB byte order

    Thanks for the info,

    If I have the following image

    little endian
    RGB
    bits stored 16
    bits allocated 16
    high bit 15
    samples per pixel 3
    planar configuration 0

    Would the pixel data tag contain:
    {R1 LSB,R1 MSB,B1 LSB,B1 MSB,G1 LSB, G1 MSB, R2 LSB,R2 MSB,B2 LSB,B2
    MSB,G2 LSB, G2 MSB}
    LSB =Least significant byte
    MSB =Most significant byte


  5. Re: RGB byte order

    Not RBG, but RGB.

    Should be:

    {R1 LSB,R1 MSB,G1 LSB,G1 MSB,B1 LSB,B1 MSB, R2 LSB,R2 MSB,G2 LSB,G2 MSB,B2 LSB,B2 MSB}

    Having said that, an RGB image with more than 8 bits per pixel is
    not supported by many of SOP Classes in DICOM that support color
    images. The Ophthalmic Photography 16 Bit Image Storage SOP Class
    is an obvious but unusual exception in this regard.

    David

    sander wrote:

    > Thanks for the info,
    >
    > If I have the following image
    >
    > little endian
    > RGB
    > bits stored 16
    > bits allocated 16
    > high bit 15
    > samples per pixel 3
    > planar configuration 0
    >
    > Would the pixel data tag contain:
    > {R1 LSB,R1 MSB,B1 LSB,B1 MSB,G1 LSB, G1 MSB, R2 LSB,R2 MSB,B2 LSB,B2
    > MSB,G2 LSB, G2 MSB}
    > LSB =Least significant byte
    > MSB =Most significant byte


+ Reply to Thread