Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

9/1/23, 8:52 ClearCanvas ImageServer Team User's Guide

Sample JPEG Baseline Rule


The following sample 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>

Sample JPEG Extended Rule


The following sample 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>

Sample JPEG Lossless Rule


The following sample 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>

Sample RLE Rule


The following sample 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>

Sample SOP Processed RLE Rule


The following sample 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>

https://documentation.clearcanvas.ca/Documentation/UsersGuide/ImageServer/3_5/Team/index.html?sample_compression_rules.htm 1/2
9/1/23, 8:52 ClearCanvas ImageServer Team User's Guide
<!-- 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>

Sample JPEG 2000 Lossless Compression Rule


The following sample rule is for specifying a rule to use JPEG 2000 lossless compression on CT,MR, CR and MG studies. Note some photometric interpretations are
NOT supported and convertFromPalette is specified because palette color has to be converted to RGB before compression.

<!-- This rule instructs the server to use JPEG 2000 lossless compression on CT, MR, CR and MG studies.
2 threads will be used by the compressor. Finally, the Photometric Interpretations not supported by
the Kakadu codec are disabled in the rule.-->
<rule>
<condition expressionLanguage="dicom">
<and>
<!-- Unsupported Photometric Interpretations for the Kakadu Codec -->
<not-equal test="$PhotometricInterpretation" refValue="YBR_FULL" />
<not-equal test="$PhotometricInterpretation" refValue="YBR_FULL_422" />
<not-equal test="$PhotometricInterpretation" refValue="YBR_PARTIAL_422" />
<not-equal test="$PhotometricInterpretation" refValue="YBR_PARTIAL_420" />
<or>
<equal test="$Modality" refValue="CT" />
<equal test="$Modality" refValue="MR" />
<equal test="$Modality" refValue="CR" />
<equal test="$Modality" refValue="MG" />
</or>
</and>
</condition>
<action>
<kakadu-j2k-lossless time="10" unit="weeks" threads="2" convertFromPalette="true"/>
</action>
</rule>

Sample JPEG 2000 Lossy Compression Rule


The following sample rule is for specifying a rule to use JPEG 2000 lossy compression on DX and CR studies. The compression ratio is set to 8.5:1. Note some
photometric interpretations are NOT supported and convertFromPalette is specified because palette color has to be converted to RGB before compression.
<!-- This rule instructs the server to use Kakdu JPEG 2000 Lossy compression on DX and CR studies. The Compression ratio in this example is
2 threads will be used by the compressor. Finally, the Photometric Interpretations not supported by the Kakadu codec are disabled in the ru
<rule>
<condition expressionLanguage="dicom">
<!-- Unsupported Photometric Interpretations for the Kakadu Codec -->
<not-equal test="$PhotometricInterpretation" refValue="YBR_FULL"/>
<not-equal test="$PhotometricInterpretation" refValue="YBR_FULL_422"/>
<not-equal test="$PhotometricInterpretation" refValue="YBR_PARTIAL_422"/>
<not-equal test="$PhotometricInterpretation" refValue="YBR_PARTIAL_420"/>
<or>
<equal test="$Modality" refValue="DX"/>
<equal test="$Modality" refValue="CR"/>
</or>
</condition>
<action>
<kakadu-j2k-lossy ratio="8.5" time="10" unit="weeks" threads="2" convertFromPalette="true"/>
</action">
</rule>

https://documentation.clearcanvas.ca/Documentation/UsersGuide/ImageServer/3_5/Team/index.html?sample_compression_rules.htm 2/2

You might also like