DICOM rules

Each DICOM rule contains two parts:

  1. Identify and extract the DICOM attribute from the DICOM header.
  2. Compare the value of the attribute against a value based on a particular criteria.

Defining a DICOM attribute

The DICOM attribute finder contains three sections: search filter, common attributes, and custom attributes input.

  1. The common attributes area provides quick access to the most common DICOM attributes such as series description and modality image type.

  2. Use the search filter area to search through all of the DICOM attributes. You can search for an attribute by number or description. Note that the search does not include proprietary DICOM tags.

  3. To define a vendor specific tag or to use advanced definitions, select <click to add custom attribute>. A text box appears. You can now enter an attribute using the following syntax:
    • A single attribute should be enclosed in parentheses. Example: (0008,0008) for image type.
    • It is possible to extract a single value from a multi-value attribute. For example, (0008, 0008)[2] will extract the third value. If the image type is ORIGINAL/PRIMARY/M_FFE/M/FFE, then this value would be M_FFE.
    • It is possible to extract a particular attribute from a sequence, such as (0040,0260)[*].(0008,0100) Performed Protocol Code Sequence/Code Value. This definition states that all [*] the (0008,0100) attributes will be extracted from the (0040,0260) sequence and concatenated using /. It is also possible to extract only the code value of the fourth sequence item by using the syntax (0040, 0260)[3].(0008, 0100), although in practice using [*] covers the most common scenarios where a single item is present in a sequence.
    • Multiple sequences can be linked. For example, (0008,1140)[0].(0008,1160)[2] will look up the Referenced Image Sequence, take the first sequence item, then look up the Referenced Frame Number sequence inside this sequence item, and finally extract the third item.

Evaluate the extracted value

Once the value of the DICOM attribute is defined, the status and value of the attribute is evaluated using the following comparison criteria:

  • Exists, Does not exist, Is null, and Is empty will verify if the attribute matches the condition (for example, whether it is defined in the header or has a null value).
  • Contains allows you to specify a string that will be searched inside the value. For example contains LAT will match an attribute that has a value of Lateral or LAT or lat. The search is case-insensitive.
  • Contains any of allows you to specify multiple words separated by , or ; or \. For example, a manufacturer string can be searched against the string PHILIPS, MARCONI, ELSCINT. If any of the string matches, then the rule is a successful match.
  • Does not contain and Does not contain any function the same way as their “contains” counterparts. Note that all DICOM headers are evaluated for a does not contain rule. If a contains rule matches the first image, the rest of the images in the series are not evaluated. However a does not contain rule must go through all the headers before it can be considered as a match.
  • Is exactly also performs a case-insensitive search but compares the full word. For example, modality is OP will not match OPT.
  • Is smaller and Is bigger will first attempt to determine if the value is a number or a date and will perform a number or date comparison. If the value is not a number or a date, a string compare rule will be used (where a is smaller than c, for example).
  • Matches RegEx pattern allows you to define a complex regular expression rule. The syntax is beyond the scope of this document but there are many useful patterns available on the Internet (search for “Microsoft regular expression syntax”).