DICOM: JPEG + APP2 marker

59 views
Skip to first unread message

Mathieu Malaterre

unread,
Mar 18, 2022, 6:10:20 AMMar 18
to
Dear all,

[Yet another nitpick]

Current DICOM edition (PS 3.5) states:

[...]
If APP2 marker segments with an identifier of "ICC_PROFILE" (as defined in Annex B of [ISO 15076-1]) are present in the compressed data stream, their concatenated value shall be identical to the value of ICC Profile (0028,2000) Attribute, if present, excluding padding.
[...]

* https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.html#para_c82ff006-e1a8-46d4-a5db-0f63db0fd123

So I understand what is expected when receiving a DICOM+JPEG+APP2+ICCProfile attribute. However I fail to understand the case where I receive DICOM+JPEG+APP2 (no ICCProfile attribute).

The standard mandates:

[...]
The Pixel Data characteristics included in the JPEG Interchange Format shall be used to decode the compressed data stream.
[...]

But I believe it is missing:

The JFIF APP2 marker segment is NOT required to be present in DICOM encapsulated JPEG bit streams, and should not be used for the rendering of the image.

David Clunie

unread,
Mar 18, 2022, 8:32:14 AMMar 18
to
JPEG Interchange Format (all tables present) and JFIF are not the same thing.

ISO 10918-1 - describes the "Interchange Format" - "The representation of compressed image data for exchange between application
environments" - "is a compressed image data representation which includes all table specifications used in the encoding process"

ISO 10918-5 - JPEG File Interchange Format (JFIF)

On Friday, March 18, 2022 at 6:10:20 AM UTC-4, Mathieu Malaterre wrote:
>
> "the JPEG Interchange Format".
> ...
> The "JFIF" APP2 marker segment ...

Mathieu Malaterre

unread,
Mar 18, 2022, 11:06:45 AMMar 18
to
On Friday, March 18, 2022 at 1:32:14 PM UTC+1, dcl...@dclunie.com wrote:
> JPEG Interchange Format (all tables present) and JFIF are not the same thing.
>
> ISO 10918-1 - describes the "Interchange Format" - "The representation of compressed image data for exchange between application
> environments" - "is a compressed image data representation which includes all table specifications used in the encoding process"
>
> ISO 10918-5 - JPEG File Interchange Format (JFIF)

Thanks !

FYI I've build 4 VL Photographic Image Storage instances from the same image.

Copyright is same as:

https://cloud.githubusercontent.com/assets/1139185/23364727/3da8c474-fcce-11e6-9f39-7e074e78aa33.jpg

img.dcm:
All APPn markers removed (colors muted)

img_app2.dcm
Only APP2 marker in original JPEG kep (no ICCProfile)

img_app2_iccprofile.dcm
Only APP2 marker in original JPEG kep (with exact ICCProfile copied in attribute)

img_jpgicc.dcm
jpgicc was used to apply ICC Profile

See:
http://gdcm.sourceforge.net/icc/icc.tar.gz

Enjoy

David Clunie

unread,
Mar 18, 2022, 11:44:50 AMMar 18
to
Thanks for these very useful test files.

One permutation that you don't have is:

All APPn markers removed, ICCProfile in DICOM attribute

Mathieu Malaterre

unread,
Mar 18, 2022, 12:38:13 PMMar 18
to

David Clunie

unread,
Mar 18, 2022, 1:22:49 PMMar 18
to
I thought that might be a good test - my display code now applies the profile twice!

On Friday, March 18, 2022 at 12:38:13 PM UTC-4, Mathieu Malaterre wrote:
> On Friday, March 18, 2022 at 4:44:50 PM UTC+1, dcl...@dclunie.com wrote:
> > One permutation that you don't have is:
Reply all
Reply to author
Forward
0 new messages