Parsing and Assigning DICOM Dates in DP2

Data capturing is a very powerful and useful feature of DP2, let me provide you a an example of how to use it.  Because DICOM Printer 2 is based on the Qt framework, it employs the default QRegExp syntax, described on this page.

Let’s assume that you use DP2 to send reports to PACS and you want the application to capture study date from it, so that you wouldn’t have to edit study details in PACS every time. Since DICOM Printer 2 extracts text content from every print job and makes it available to ParseJobTextFile action, this is fairly simple feature to implement.

First you need to examine text file contents. You can do that by stopping DICOMPrinterService prior to printing. The files will become available in the queue, accessible through Start -> DP2 -> Links -> Open Queue Folder. When you open the TXT file in the queue you might find line like this:

Report Date: 15-11-12

Which tells us that the report was printed today. There is a problem with this date, though, it is not a valid DICOM date for a number of reasons:

  • it uses a reversed, day-month-year notation,
  • the year is expressed in short, two-decimal form,
  • separators are unnecessary.

A valid DICOM representation of this date would look like this:

20121115

So how can you make it work? First, let’s create a regular expression matching this line. There are many websites allowing you to create and test regular expressions online: this one is the easiest to use but I prefer another one because it not only shows if the expression is valid, but also displays captured elements. Using any of these, you should be able to create expressions quickly.

In our example here’s the result:

Report\s+Date:\s+(\d{2})-(\d{2})-(\d{2})

The expression matches a line containing the word ‘Report’ followed by a non-zero number of spaces, then the word ‘Date’, a colon, another non-zero number of spaces, two digits (decimal), dash, two digits, dash and, again, two digits. Each pair of digits is enclosed with parentheses, which means that they are captured by this expression.

Note that this expression assumes that the date contains leading zeros when the day or month are less than 10, e.g. 01-01-13 for New Year’s day of 2013.

OK, so we have the expression that matches our line and we capture the required numbers. All that is left to do is to arrange them in the DICOM manner. You can do that by using the replacePattern attribute, available to DcmTag elements of both types of parse actions. In our case we want to replace the order and prepend the year with ’20’. Here’s how the attribute should look:

replacePattern="20\3\2\1"

The slash-number notation is used to back-reference a captured group. The default replace pattern for DcmTag elements is ‘\1’, which means that it simply uses the value from the first group.

Here’s how the entire action would appear:

<ParseJobTextFile name="GetDate">
        <DcmTag tag="(0008,0020)" replacePattern="20\3\2\1">Report\s+Date:\s+(\d{2})-(\d{2})-(\d{2})</DcmTag>
</ParseJobTextFile>

You could also add the ‘mandatory’ flag, if you would like DP2 to stop processing when the date is missing from the report.

As always, remember to call your new action from the Workflow block, like so:

  <!-- Your preceding action definitions -->
  <ParseJobTextFile name="GetDate">
        <DcmTag tag="(0008,0020)" replacePattern="20\3\2\1">Report\s+Date:\s+(\d{2})-(\d{2})-(\d{2})</DcmTag>
  </ParseJobTextFile>
</ActionsList>
<Workflow>
  <Perform action="GetDate" onError="Hold" />
  <!-- Rest of your workflow -->
</Workflow>

Flux Inc to Provide DICOM to WhiteFox

We are pleased to have recently been chosen to take part in the DICOM-enablement of an exciting entrant into the Cone Beam Computed Tomography market: WhiteFox, from de Götzen S.r.l. of Italy. WhiteFox is the 2011 winner of the reddot Product Design Award, and provides technological enhancements well ahead of other products in the fields of Cephalometry, Orthodontics and Gnathology, TMJ Analysis, Inplantology planning, Oral and Maxillofacial Surgery, and Endodontics.

As part of our work over the following month, we will be helping to extend WhiteFox to integrate fully into an Integrated Health Environment.

We are honoured to take part in the advancement of such an exciting product and we look forward to making full use of our expertise to help it achieve the prominence it deserves.

New Year, New DICOM Printer Versions

We’re happy to announce the release of new versions of both of our flagship DICOM Printer applications.

Download DICOM Printer

DICOM Printer 1.7.0

DICOM Printer 1.7.0 is a significant improvement over 1.6.5, offering substantial stability and logging enhancements, a re-styled interface, rock-solid compatibility across Windows versions, as well as a brand new DICOM CD folder creation function.  For a full list of changes, please refer to the release notes during application installation.

DICOM Printer Main Form Screenshot

DICOM Printer 2.1.6

DICOM Printer 2.1.6 sports a brand-new configuration wizard, allowing quick deployment and management for print to PACS, and print to film applications.  It also includes:

  • A secure and Windows 7 compatible user interface plug-in architecture.  This enhancement makes it possible for DP2 to operate in a networked multi-user environment, allowing interfaces to be presented across user sessions from a centrally hosted installation of the utility.
  • We have included several important plug-ins, including those allowing instant query of PACS and DICOM Modality Worklist prior to storage or print.
  • A new utility called Drop Monitor, which allows PDF, PNG, JPEG, and other image format injection into PACS using a designated watch folder.
  • A new log view and tail interface, providing instant feedback of process results.

DICOM Printer 2.1.6 is the result of many months of development, and we’d be thrilled to hear feedback about our users’ impression of the changes.  Please be sure to send us your comments after you have given it a whirr.

Licensed User Upgrades

Upgrades are available for free for those users who purchased their 1.6.5 and 2.1.5 licenses within the last 3 months, and a low-cost upgrade path is available for those who purchased before that time.  Please contact us for further information if you fall into either of these two categories.