Skip to main content

[JAI-IMAGEIO] Jpeg / Jpeg-Lossless - Colorspaces

6 replies [Last post]
Anonymous

Hello,

I am trying to do some more advanced troubleshooting on some medical
images I am receiving. From my interpretation, the DICOM image standard
calls for Image Pixel information to be stored in the same format that
is declared in the DICOM Tag information: (0028,0004 : Photometric
Interpretation).

I am having trouble verifying and/or figuring out if the Jpeg Lossless
decoder/encoder in ImageIO does any Colorspace conversion with 3-band
data before it compresses it. This is very important, as I need to
prepare any image data and represent it in the DICOM tags correctly.
Is the RGB <-> yCbCr conversion implicit with the compression? Or does
ImageIO just compress/decompress the data exactly how it sees it?

Thanks,
*_Michael J Hess_*

*Nighthawk Radiology Services*
------------------------------------------------------------------------
CONFIDENTIALITY NOTICE:
This email, including any attachments, contains information from
NightHawk Radiology Services, which may be confidential or privileged.
The information is intended to be for the use of the individual or
entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited. If you have received this email in error,
please notify NightHawk Radiology Services immediately by forwarding
this message to mhess@nighthawkrad.net
and destroy all electronic and hard
copies of the communication, including attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
James Cheng

Hi Mike,

I'd like to add a bit to what Brian had said, namely, "The JAI-Image I/O
Tools lossless JPEG and JPEG-LS plug-ins do not perform any color
conversion on the data while either encoding or decoding." For the
current implementation of the JPEG-LOSSLESS and JPEG-LS codecs, the
encoders do not write APP0 or APP14, and the decoders ignore APP0
and APP14.

Thanks,
-James

On 02/06/06 11:15 AM, Michael J Hess wrote:
> Wow, thanks for the link Brian.
>
> That just made everything just a little bit more... "complex". And,
> given that the JAI Image I/O tools don't return the IIOMetadata for
> Jpeg-Lossless images.. I am going to have to mess around with trying to
> read headers and such from the JPEG stream itself...
>
> Mike.
>
> Brian Burkhalter wrote:
>
>>Hence the need for all this:
>>
>>http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html#color
>>
>>
>>Anyway, thanks for the clarification.
>>
>>Brian
>>
>>On Sun, 5 Feb 2006, David Clunie wrote:
>>
>>
>>>Brian Burkhalter wrote:
>>>
>>>>>I am trying to do some more advanced troubleshooting on some medical
>>>>>images I am receiving. From my interpretation, the DICOM image
>>>>>standard calls for Image Pixel information to be stored in the same
>>>>>format that is declared in the DICOM Tag information: (0028,0004 :
>>>>>Photometric Interpretation).
>>>>
>>>>So you can end up with the same information (Photometric
>>>>Interpretation)
>>>>stored in two different places?
>>>
>>>Actually it has to be stored in DICOM because there is nowhere
>>>in a JPEG bitstream to specify what color space has been used.
>>>
>>>Folks just assume that three channel JPEGs are YCbCr, but there
>>>is nothing in the marker segments that says that they are.
>>>
>>>David
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>>>For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>>
>>>
>>
>>----------------
>>Brian Burkhalter
>>Java Media, Imaging, and Graphics
>>Sun Microsystems, Inc.
>>
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>This email message is for the sole use of the intended recipient(s)
>>and may contain confidential and privileged information. Any
>>unauthorized review, use, disclosure or distribution is prohibited.
>>If you are not the intended recipient, please contact the sender by
>>reply email and destroy all copies of the original message.
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>>For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

> I am trying to do some more advanced troubleshooting on some medical images I
> am receiving. From my interpretation, the DICOM image standard calls for
> Image Pixel information to be stored in the same format that is declared in
> the DICOM Tag information: (0028,0004 : Photometric Interpretation).

So you can end up with the same information (Photometric Interpretation)
stored in two different places?

> I am having trouble verifying and/or figuring out if the Jpeg Lossless
> decoder/encoder in ImageIO does any Colorspace conversion with 3-band data
> before it compresses it. This is very important, as I need to prepare any
> image data and represent it in the DICOM tags correctly. Is the RGB <->
> yCbCr conversion implicit with the compression? Or does ImageIO just
> compress/decompress the data exactly how it sees it?

The JAI-Image I/O Tools lossless JPEG and JPEG-LS plug-ins do not perform any
color conversion on the data while either encoding or decoding.

Brian

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

David Clunie

Brian Burkhalter wrote:
>> I am trying to do some more advanced troubleshooting on some medical
>> images I am receiving. From my interpretation, the DICOM image
>> standard calls for Image Pixel information to be stored in the same
>> format that is declared in the DICOM Tag information: (0028,0004 :
>> Photometric Interpretation).
>
> So you can end up with the same information (Photometric Interpretation)
> stored in two different places?

Actually it has to be stored in DICOM because there is nowhere
in a JPEG bitstream to specify what color space has been used.

Folks just assume that three channel JPEGs are YCbCr, but there
is nothing in the marker segments that says that they are.

David

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

Hence the need for all this:

http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files...

Anyway, thanks for the clarification.

Brian

On Sun, 5 Feb 2006, David Clunie wrote:

> Brian Burkhalter wrote:
>>> I am trying to do some more advanced troubleshooting on some medical
>>> images I am receiving. From my interpretation, the DICOM image
>>> standard calls for Image Pixel information to be stored in the same
>>> format that is declared in the DICOM Tag information: (0028,0004 :
>>> Photometric Interpretation).
>>
>> So you can end up with the same information (Photometric Interpretation)
>> stored in two different places?
>
> Actually it has to be stored in DICOM because there is nowhere
> in a JPEG bitstream to specify what color space has been used.
>
> Folks just assume that three channel JPEGs are YCbCr, but there
> is nothing in the marker segments that says that they are.
>
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Michael J Hess

Wow, thanks for the link Brian.

That just made everything just a little bit more... "complex". And,
given that the JAI Image I/O tools don't return the IIOMetadata for
Jpeg-Lossless images.. I am going to have to mess around with trying to
read headers and such from the JPEG stream itself...

Mike.

Brian Burkhalter wrote:
> Hence the need for all this:
>
> http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files...
>
>
> Anyway, thanks for the clarification.
>
> Brian
>
> On Sun, 5 Feb 2006, David Clunie wrote:
>
>> Brian Burkhalter wrote:
>>>> I am trying to do some more advanced troubleshooting on some medical
>>>> images I am receiving. From my interpretation, the DICOM image
>>>> standard calls for Image Pixel information to be stored in the same
>>>> format that is declared in the DICOM Tag information: (0028,0004 :
>>>> Photometric Interpretation).
>>>
>>> So you can end up with the same information (Photometric
>>> Interpretation)
>>> stored in two different places?
>>
>> Actually it has to be stored in DICOM because there is nowhere
>> in a JPEG bitstream to specify what color space has been used.
>>
>> Folks just assume that three channel JPEGs are YCbCr, but there
>> is nothing in the marker segments that says that they are.
>>
>> David
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>
>>
>
> ----------------
> Brian Burkhalter
> Java Media, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>

--
*_Michael J Hess_*

*Nighthawk Radiology Services*
------------------------------------------------------------------------
CONFIDENTIALITY NOTICE:
This email, including any attachments, contains information from
NightHawk Radiology Services, which may be confidential or privileged.
The information is intended to be for the use of the individual or
entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited. If you have received this email in error,
please notify NightHawk Radiology Services immediately by forwarding
this message to mhess@nighthawkrad.net
and destroy all electronic and hard
copies of the communication, including attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

Mike,

Sorry about the metadata situation. I suggest that you submit an enhancement
request at jai-imageio-core.dev.java.net so that the issue (metadata support
in
the jai-imageio JPEG plug-ins) gets tracked and people can vote on it.

Brian

On Mon, 6 Feb 2006, Michael J Hess wrote:

> Wow, thanks for the link Brian.
>
> That just made everything just a little bit more... "complex". And, given
> that the JAI Image I/O tools don't return the IIOMetadata for Jpeg-Lossless
> images.. I am going to have to mess around with trying to read headers and
> such from the JPEG stream itself...
>
> Mike.
>
> Brian Burkhalter wrote:
>> Hence the need for all this:
>>
>> http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files...
>>
>> Anyway, thanks for the clarification.
>>
>> Brian
>>
>> On Sun, 5 Feb 2006, David Clunie wrote:
>>
>>> Brian Burkhalter wrote:
>>>>> I am trying to do some more advanced troubleshooting on some medical
>>>>> images I am receiving. From my interpretation, the DICOM image
>>>>> standard calls for Image Pixel information to be stored in the same
>>>>> format that is declared in the DICOM Tag information: (0028,0004 :
>>>>> Photometric Interpretation).
>>>>
>>>> So you can end up with the same information (Photometric Interpretation)
>>>> stored in two different places?
>>>
>>> Actually it has to be stored in DICOM because there is nowhere
>>> in a JPEG bitstream to specify what color space has been used.
>>>
>>> Folks just assume that three channel JPEGs are YCbCr, but there
>>> is nothing in the marker segments that says that they are.
>>>
>>> David
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>>
>>>
>>
>> ----------------
>> Brian Burkhalter
>> Java Media, Imaging, and Graphics
>> Sun Microsystems, Inc.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> This email message is for the sole use of the intended recipient(s)
>> and may contain confidential and privileged information. Any
>> unauthorized review, use, disclosure or distribution is prohibited.
>> If you are not the intended recipient, please contact the sender by
>> reply email and destroy all copies of the original message.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>
>
> --
> *_Michael J Hess_*
>
> *Nighthawk Radiology Services*
> ------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE:
> This email, including any attachments, contains information from NightHawk
> Radiology Services, which may be confidential or privileged. The information
> is intended to be for the use of the individual or entity named above. If you
> are not the intended recipient, be aware that any disclosure, copying,
> distribution or use of the contents of this information is prohibited. If you
> have received this email in error, please notify NightHawk Radiology Services
> immediately by forwarding this message to mhess@nighthawkrad.net
> and destroy all electronic and hard
> copies of the communication, including attachments.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net