Skip to main content

[JAI-IMAGEIO] Problem with 12-bit grayscale lossless JPEG image

10 replies [Last post]
Anonymous

Hi.

I am experiencing some problems when trying to decode a lossless JPEG
grayscale image through the native JPEG decoder contained in the JAI Image
Image I/O Tools. This grayscale lossless JPEG image is extracted from a
DICOM medical image file.

The decoded image shall contain pixel values ranging from 0 (min pixel
value) to 713 (max pixel value), according to the meta-information contained
in the original DICOM dataset, and also according to what other image
viewers display when requested to load the same sample image.

But, when decoded by the JIIO lossless JPEG decoder (through JAI's
"ImageRead" operator), the resulting image contains pixel values ranging
from 0 to 65533, which seems to be incorrect. The final result after
contrast adjustment is an "all-white" image, and not the correct MR medical
image, as displayed by other viewers.

The sample lossless JPEG image can be downloaded from:

http://test.neologica.it/Lossless.jpg

Do you believe what I noticed may derive from a decoding bug of the lossless
JPEG JIIO Image Reader?

I have also prepared a self-contained test case which loads the image and
displays it after the contrast adjustment suggested in the original DICOM
dataset, and which is incorrectly displayed as all-white. Please let me know
if you are interested in this test case.

Best regards,

Marco Sambin.

---------------------------------------------------------------------
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.
robert engels

Nothing I have, including libjpeg can read the image.

They all error with:

Unsupported JPEG process: SOF type 0xc3

On Nov 22, 2007, at 8:56 AM, Marco Sambin - NeoLogica wrote:

> Hi.
>
> I am experiencing some problems when trying to decode a lossless JPEG
> grayscale image through the native JPEG decoder contained in the
> JAI Image
> Image I/O Tools. This grayscale lossless JPEG image is extracted
> from a
> DICOM medical image file.
>
> The decoded image shall contain pixel values ranging from 0 (min pixel
> value) to 713 (max pixel value), according to the meta-information
> contained
> in the original DICOM dataset, and also according to what other image
> viewers display when requested to load the same sample image.
>
> But, when decoded by the JIIO lossless JPEG decoder (through JAI's
> "ImageRead" operator), the resulting image contains pixel values
> ranging
> from 0 to 65533, which seems to be incorrect. The final result after
> contrast adjustment is an "all-white" image, and not the correct MR
> medical
> image, as displayed by other viewers.
>
> The sample lossless JPEG image can be downloaded from:
>
> http://test.neologica.it/Lossless.jpg
>
> Do you believe what I noticed may derive from a decoding bug of the
> lossless
> JPEG JIIO Image Reader?
>
> I have also prepared a self-contained test case which loads the
> image and
> displays it after the contrast adjustment suggested in the original
> DICOM
> dataset, and which is incorrectly displayed as all-white. Please
> let me know
> if you are interested in this test case.
>
> Best regards,
>
> Marco Sambin.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net
>

[att1.html]

Marco Sambin - NeoLogica

Hi,

I can correctly display this lossless JPEG image through a sample image
viewer by Accusoft which supports 12-bit grayscale lossless JPEG images. See
attached screenshot.
Also, several DICOM viewers that I have on my desktop are able to display
the image starting from the original DICOM file containing this lossless
JPEG image, hence it means that they are able to correctly decode it (and
they display it the same way as the attached screenshot).

Also, when I try to decode it through JAI's "ImageRead" operator, using
JIIO's native JPEG image reader (which shall support lossless JPEG), I do
not get any decoding exception, I "simply" obtain wrong pixel values.

Any comment would be appreciated.

Regards,

Marco.

_____

From: robert engels [mailto:rengels@ix.netcom.com]
Sent: giovedì 22 novembre 2007 16.57
To: interest@jai-imageio.dev.java.net
Subject: Re: [JAI-IMAGEIO] Problem with 12-bit grayscale lossless JPEG image

Nothing I have, including libjpeg can read the image.

They all error with:

Unsupported JPEG process: SOF type 0xc3

On Nov 22, 2007, at 8:56 AM, Marco Sambin - NeoLogica wrote:

Hi.

I am experiencing some problems when trying to decode a lossless JPEG
grayscale image through the native JPEG decoder contained in the JAI Image
Image I/O Tools. This grayscale lossless JPEG image is extracted from a
DICOM medical image file.

The decoded image shall contain pixel values ranging from 0 (min pixel
value) to 713 (max pixel value), according to the meta-information contained
in the original DICOM dataset, and also according to what other image
viewers display when requested to load the same sample image.

But, when decoded by the JIIO lossless JPEG decoder (through JAI's
"ImageRead" operator), the resulting image contains pixel values ranging
from 0 to 65533, which seems to be incorrect. The final result after
contrast adjustment is an "all-white" image, and not the correct MR medical
image, as displayed by other viewers.

The sample lossless JPEG image can be downloaded from:

http://test.neologica.it/Lossless.jpg

Do you believe what I noticed may derive from a decoding bug of the lossless
JPEG JIIO Image Reader?

I have also prepared a self-contained test case which loads the image and
displays it after the contrast adjustment suggested in the original DICOM
dataset, and which is incorrectly displayed as all-white. Please let me know
if you are interested in this test case.

Best regards,

Marco Sambin.

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

[att1.html]
[Screenshot.jpg]
---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

James Cheng

Hi Marco,

This looks like the same problem as that shown in issue 158,
https://jai-imageio-core.dev.java.net/issues/show_bug.cgi?id=158
for which I have a fix in hand, and I will try to check it into
the cvs tree in a near future.

Thanks,
-James

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

Marco Sambin - NeoLogica

Hi James,

thanks a lot for your prompt feedback. I would really appreciate having a
daily build with this problem fixed, in such a way I could test it and
report my feedback.
By the way, I forgot to mention that I tested with the latest daily builds,
both on Windows and on Linux, and obtained the same "white" image.

Best regards,

Marco Sambin.

________________________________________
Ing. Marco Sambin
Project Manager - NeoLogica Medical
E-mail: marco.sambin@neologica.it

NeoLogica s.r.l.
Viale della Libertà, 56
17014 Cairo Montenotte (SV)
Italy
http://www.neologica.it
________________________________________

> -----Original Message-----
> From: James Cheng [mailto:James.Cheng@Sun.COM]
> Sent: giovedì 22 novembre 2007 22.33
> To: interest@jai-imageio.dev.java.net
> Subject: Re: [JAI-IMAGEIO] Problem with 12-bit grayscale
> lossless JPEG image
>
> Hi Marco,
>
> This looks like the same problem as that shown in issue 158,
> https://jai-imageio-core.dev.java.net/issues/show_bug.cgi?id=158
> for which I have a fix in hand, and I will try to check it
> into the cvs tree in a near future.
>
> Thanks,
> -James
>
> ---------------------------------------------------------------------
> 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

James Cheng

Hi Marco,

On 2007/11/23 02:33 AM, Marco Sambin - NeoLogica wrote:
> Hi James,
>
> thanks a lot for your prompt feedback. I would really appreciate having a
> daily build with this problem fixed, in such a way I could test it and
> report my feedback.

The daily build of 2007-12-04 (available in about five hours)
will have this problem fixed. Let us know if it's not the case.

Thanks,
-James

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

Marco Sambin - NeoLogica

James,

you are great!

The daily build 2007-12-04 of the JAI Image I/O Tools perfectly decodes my
12-bit grayscale lossless JPEG image, extracted from a medical DICOM file.
The displayed image now looks OK, and also an analysis of the individual
pixel values leads to the expected and correct result.

Can you provide a rough estimate of when JIIO v1.2 will be officially
released? Dec 2007, Jan 2008, Feb 2008 or probably later?

Thanks again and best regards,

Marco.

> -----Original Message-----
> From: James Cheng [mailto:James.Cheng@Sun.COM]
> Sent: martedì 4 dicembre 2007 4.54
> To: interest@jai-imageio.dev.java.net
> Subject: Re: [JAI-IMAGEIO] Problem with 12-bit grayscale
> lossless JPEG image
>
> Hi Marco,
>
> On 2007/11/23 02:33 AM, Marco Sambin - NeoLogica wrote:
> > Hi James,
> >
> > thanks a lot for your prompt feedback. I would really appreciate
> > having a daily build with this problem fixed, in such a way I could
> > test it and report my feedback.
>
> The daily build of 2007-12-04 (available in about five hours)
> will have this problem fixed. Let us know if it's not the case.
>
> Thanks,
> -James
>
> ---------------------------------------------------------------------
> 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

James Cheng

Hi Marco

Marco Sambin - NeoLogica wrote:
> James,
>
> you are great!

Not really. ;-) It happened to be the same problem reported by others a bit
earlier.

> The daily build 2007-12-04 of the JAI Image I/O Tools perfectly decodes my
> 12-bit grayscale lossless JPEG image, extracted from a medical DICOM file.
> The displayed image now looks OK, and also an analysis of the individual
> pixel values leads to the expected and correct result.

I am glad to hear that. Thanks for your prompt feedback

> Can you provide a rough estimate of when JIIO v1.2 will be officially
> released? Dec 2007, Jan 2008, Feb 2008 or probably later?

I don't know the answer, but I guess it will not be this year.

Thanks,
-James

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

bpb
Offline
Joined: 2004-06-23

> > Can you provide a rough estimate of when JIIO v1.2
> will be officially
> > released? Dec 2007, Jan 2008, Feb 2008 or probably
> later?
>
> I don't know the answer, but I guess it will not be
> this year.

No, definitely not this year. Probably there will be one or two "early access" milestones before a final 1.2 version is available. The exact content and schedule are still indeterminate right now.

Brian

Marco Sambin - NeoLogica

Hi Brian,

thank you for the info.

I guess it would not be possible for us to redistribute daily builds of JIIO
together with our application, right? This would allow us to provide a quick
fix to our users.
Regards,

Marco.

> -----Original Message-----
> From: jai-imageio@javadesktop.org
> [mailto:jai-imageio@javadesktop.org]
> Sent: venerdì 7 dicembre 2007 3.14
> To: interest@jai-imageio.dev.java.net
> Subject: Re: [JAI-IMAGEIO] Problem with 12-bit grayscale
> lossless JPEG image
>
> > > Can you provide a rough estimate of when JIIO v1.2
> > will be officially
> > > released? Dec 2007, Jan 2008, Feb 2008 or probably
> > later?
> >
> > I don't know the answer, but I guess it will not be this year.
>
> No, definitely not this year. Probably there will be one or
> two "early access" milestones before a final 1.2 version is
> available. The exact content and schedule are still
> indeterminate right now.
>
> Brian
> [Message sent by forum member 'bpb' (bpb)]
>
> http://forums.java.net/jive/thread.jspa?messageID=248931
>
> ---------------------------------------------------------------------
> 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

bpb
Offline
Joined: 2004-06-23

Hi Marco,

I don't see anything in the license that I would interpret to preclude redistribution but that is my personal assessment only as a non-lawyer and does not represent Sun's position.

Brian

> Hi Brian,
>
> thank you for the info.
>
> I guess it would not be possible for us to
> redistribute daily builds of JIIO
> together with our application, right? This would
> allow us to provide a quick
> fix to our users.
> Regards,
>
> Marco.
>
>
>
> > -----Original Message-----
> > From: jai-imageio@javadesktop.org
> > [mailto:jai-imageio@javadesktop.org]
> > Sent: venerdì 7 dicembre 2007 3.14
> > To: interest@jai-imageio.dev.java.net
> > Subject: Re: [JAI-IMAGEIO] Problem with 12-bit
> grayscale
> > lossless JPEG image
> >
> > > > Can you provide a rough estimate of when JIIO
> v1.2
> > > will be officially
> > > > released? Dec 2007, Jan 2008, Feb 2008 or
> probably
> > > later?
> > >
> > > I don't know the answer, but I guess it will not
> be this year.
> >
> > No, definitely not this year. Probably there will
> be one or
> > two "early access" milestones before a final 1.2
> version is
> > available. The exact content and schedule are still
>
> > indeterminate right now.
> >
> > Brian
> > [Message sent by forum member 'bpb' (bpb)]
> >
> >
> http://forums.java.net/jive/thread.jspa?messageID=2489
> 31
> >
> >
> ------------------------------------------------------
> ---------------
> > 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