How XNAT Determines Project Membership for Incoming DICOMS

Mapping DICOM to XNAT metadata

XNAT gathers information from DICOM header field to retrieve important metadata. Because these  fields are used differently under various conditions, XNAT makes several passes over the headers to gather the required information.From the scanner console, attempts should be made to satisfy the first or second pass rules. From tools like XNAT’s DICOM Browser and DICOM Batch Editor, the third or fourth pass rules may be easier.

First pass

In the first pass over the DICOM header content, XNAT looks for all relevant metadata in the Patient Comments field (0010,4000). This is a freeform field that technicians can populate at the console.  On   Siemens’ Syngo system, the field can be populated from the ‘Additional Information’ box below the patient information (name, date of birth, etc) section. The metadata should be entered as follows:

Project:Project_ID
Subject:Subject_ID
Session:Session_ID 

The metadata fields should be separated by newlines (as above),   commas, or semi-colons.  All other content is ignored. The metadata values should have no spaces or special characters in them   (underscores are ok).  Project_ID should match an existing project in the XNAT host to which the images are being sent.

If one or more of the Project, Subject, and Session fields are found,   then no further passes are necessary. Otherwise, XNAT continues with   its second pass.

Second pass

Same as above, except using the Study Comments (0032,4000) field.   This field is another freeform field entered at the Syngo console   under “Study comments”

Third pass

In the third pass, XNAT looks for each metadata field in individual   DICOM fields, as below:

 DICOM Tag       Tag Name                XNAT Field
 -----------------------------------------------------------------------
 (0008,1030)     Study Description       Project ID
 (0010,0010)     Patient Name            Subject ID
 (0010,0020)     Patient ID              Session ID 

Fourth pass

Same as above, except Accession Number (0008,0050) is used Project ID

Fifth pass

There is no fifth pass.  If after the four passes described above,   XNAT has not satisfactorily matched identified the metadata, it leaves   these fields marked as invalid in the generated XML document.  If no   Project was identified, the DICOM files will be placed in the   ‘Unidentified’ prearchive box.  If project was identified but Subject   and/or Session was not, the DICOM files will be placed in the   appropriate project prearchive box, but the automatic matching tool   will not be functional and additional data entry will be required.

In addition to the default rules, DicomServer allows one additional,   user-defined method for identifying the project, using the   "project_spec" property.  This custom rule is third in precedence,   after the Patient Comments and Study Comments rules (1 and 2 above)   but before passes 3, 4, and 5.  The content of this property should   look like this:

(gggg,eeee):regular expression[:optional matching group index]

The first component, (gggg,eeee), is the DICOM attribute to be   examined.  The second, a regular expression (in the format of   java.util.regex.Pattern) is used to match the content of the indicated   DICOM attribute.  The last, and optional, component, is the matching   group index specifying which group in the regular expression should be   used as a prospective project name (defaulting to 1, the first   matching group).

If the given attribute matches the given pattern, and the prospective   project name matches an actual project name in the XNAT instance, then   the session is sorted into that matching project.