DICOM PS3.18 2024d - Web Services

8.7.8 Selected Media Type and Transfer Syntax

The selection of the media type and transfer syntax by the origin server are interrelated.

8.7.8.1 Selected Media Type

The Selected Media Type is the media type selected by the origin server for the representation in the response payload. The media types in the Accept Query Parameter and the media ranges in the Accept header field shall each be separately prioritized according to the rules defined in [RFC7231] Section 5.3.1.

For multipart payloads, the Selected Media Type is determined independently for each message part in the response.

The Selected Media Type of each message part depends on the Resource Category of the Instance and the Acceptable Media Types for that Resource Category.

The Selected Media Type is chosen as follows:

  1. Identify the target's Resource Category

  2. Select the representation with the highest priority supported media type for that category in the Accept Query Parameter.

  3. If no media type in the Accept Query Parameter is supported, select the highest priority supported media type for that category in the Accept header field, if any.

  4. Otherwise, select the default media type for the category, if the Accept header field contains a wildcard media range matching the category, if any.

  5. Otherwise, return a 406 (Not Acceptable).

Note

  1. If the Selected Media Type is the Explicit VR Little Endian and the pixel data is compressed and when uncompressed is of such length that it cannot contained in a value field, then the origin server will respond with a 406 (Not Acceptable), and the user agent may try again with a different set of Acceptable Media Types.

  2. If transcoding to the Explicit VR Little Endian Transfer Syntax, a VR of UN may be needed for the encoding of Data Elements with explicit VR whose value length exceeds 65534 (216-2) (FFFEH, the largest even length unsigned 16-bit number) but which are defined to have a 16-bit explicit VR length field. See Section 6.2.2 “Unknown (UN) Value Representation” in PS3.5.

For a set of media types in the Accept Query Parameter (step 2 above), or for a set of media ranges in the Accept header field (step 3 above), the highest priority supported media type is determined as follows:

  1. Assign a qvalue of 1 to any member of the set that does not have a one.

  2. Assign each representation supported by the origin server the qvalue of the most specific media type that it matches.

  3. Select the representation with the highest qvalue. If there is a tie, the origin server shall determine which is returned.

For example, consider an origin server which receives a request with the following Accept header field:

Accept: text/*; q=0.5, text/html; q=0.4, text/html; level=1, text/html; level=2; q=0.7,
        image/png, */*; q=0.4

Suppose that for the resource indicated in the request, the origin server supports representations for the following media types:

text/html (regular, level 1 and level 2)
text/rtf
text/plain
text/x-latex

These media types are assigned the following qvalues, based on the media ranges above:

Table 8.7.8-1. Media Type QValue Example

Media Type

qvalue

Determining Media Range

text/html; level=1

1.0

text/html; level=1

text/html; level=2

0.7

text/html; level=2

text/plain

0.5

text/*

text/rtf

0.5

text/*

text/html

0.4

text/html

text/x-latex

0.4

*/*


Although "image/png" has been assigned a default qvalue of 1.0, it is not among the supported media types for this resource, and thus is not listed.

The selected media type is 'text/html; level=1' since it is the supported media type in the Text Category with the highest qvalue.

DICOM PS3.18 2024d - Web Services