Example JPEG Baseline Rule
The following example rule specifies that 8 bit images for US and RF modality studies should be JPEG Baseline compressed with a quality factor of 80. The compression will occur 10 weeks after the study is processed.
Note, the quality factor has a range of 1 to 100, with 100 implying the highest quality (with little or no compression) and 1 being the lowest quality. JPEG Compression is controlled by a set of quantization tables. Typically, there are two such tables in each JPEG image: one for the luminance (brightness) information and the other for the chrominance (color) information. These tables are 8x8 matrices that determine how the 8x8 blocks of discrete cosine coefficients are quantized. The quality factor determines these quantization tables, and is the input to the Independent JPEG Group code we use to do JPEG compression. (A search for "IJG quality factor" on the web shows a number of web sites that recommend quality factors.)
<!--
This rule instructs the server to use JPEG baseline compression
on 8-bit US and RF studies.
-->
<rule>
<condition expressionLanguage="dicom">
<and>
<equal test="$BitsAllocated" refValue="8" />
<or>
<equal test="$Modality" refValue="US" />
<equal test="$Modality" refValue="RF" />
</or>
</and>
</condition>
<action>
<jpeg-baseline quality="80" time="10" unit="weeks" />
</action>
</rule>
Example JPEG Extended Rule
The following example rule specifies that CT and MR modality studies should be compressed using JPEG Extended compression with a quality factor of 75 10 weeks after the study is initially processed.
<rule>
<condition
expressionLanguage="dicom">
<or>
<equal test="$Modality" refValue="CT" />
<equal test="$Modality" refValue="MR" />
</or>
</condition>
<action>
<jpeg-extended quality="75" time="10" unit="weeks" />
</action>
</rule>
Example JPEG Lossless Rule
The following example rule specifies that CT and MR modality studies should be JPEG lossless compressed 2 weeks after the study is initially processed.
<rule>
<condition
expressionLanguage="dicom">
<or>
<equal test="$Modality" refValue="CT" />
<equal test="$Modality" refValue="MR" />
</or>
</condition>
<action>
<jpeg-lossless time="2" unit="weeks" />
</action>
</rule>
Example RLE Rule
The following example rule specifies that US modality studies should be RLE compressed 10 weeks after the Study Date.
<rule>
<condition expressionLanguage="dicom">
<equal test="$Modality" refValue="US" />
</condition>
<action>
<rle time="10" unit="weeks" refValue="$StudyDate" />
</action>
</rule>
Example SOP Processed RLE Rule
The following example rule is for specifying a rule where US and RF modality images that have not been compressed already are RLE compressed. Note that in prior examples, it was assumed an exempt rule was being used to prevent studies from being recompressed. In this example,
<!--
This rule instructs the server to use RLE compression on 8-bit US and RF studies that have not been compressed already.
-->
<rule>
<condition expressionLanguage="dicom">
<and>
<!-- RLE -->
<not-equal test="$TransferSyntaxUid" refValue="1.2.840.10008.1.2.5"/>
<!-- JPEG Baseline -->
<not-equal test="$TransferSyntaxUid" refValue="1.2.840.10008.1.2.4.50"/>
<!-- JPEG Extended -->
<not-equal test="$TransferSyntaxUid" refValue="1.2.840.10008.1.2.4.51"/>
<!-- JPEG Lossless -->
<not-equal test="$TransferSyntaxUid" refValue="1.2.840.10008.1.2.4.70"/>
<!-- JPEG 2000 Lossless -->
<not-equal test="$TransferSyntaxUid" refValue="1.2.840.10008.1.2.4.90"/>
<!-- JPEG 2000 Lossless/Lossy -->
<not-equal test="$TransferSyntaxUid" refValue="1.2.840.10008.1.2.4.91"/>
<equal test="$BitsAllocated" refValue="8"/>
<not-equal test="$PhotometricInterpretation" refValue="PALETTE COLOR"/>
<or>
<equal test="$Modality" refValue="US"/>
<equal test="$Modality" refValue="RF"/>
</or>
</and>
</condition>
<action>
<rle-sop/>
</action>
</rule>