Adding a logo to DICOM Printer 2 output

Please note that adding these custom elements to DICOM Printer 2 workflows is a task that requires a little knowledge of XML. If you feel that the post is too technical for you, then ask someone with IT experience to help.

Recap

In our previous post, we went through installation and configuration of basic film output. Although this is great for basic use, most facilities we’ve come across like to see their identity expressed on their product.

So, we’ll want to go from this:

Ceph image without logo

To this!

Ceph image with facility and logo

First Things First

In the previous post, we used the Configuration Wizard. The Wizard does the basics, but to add a logo we need to dig into the actual configuration file. To see it, launch the DICOM Printer Control Center. It can be found via the Start Menu, or by searching in Windows 8.

Accessing DICOM Printer 2 control from the start menu

You will then see the main control window.

DICOM Printer 2 Control Center main window

Switch to the Configuration tab. If you followed the previous tutorial, you will see the following text:

<?xml version="1.0" encoding="UTF-8"?>
<DicomPrinterConfig>
    <General>
        <CheckingInterval>1</CheckingInterval>
        <SuspensionTime>1</SuspensionTime>
        <Verbosity>30</Verbosity>
    </General>
    <ActionsList>
        <Print name="PrintOnDevice">
            <Resolution>320 x 320</Resolution>
            <PrintMode>Grayscale12</PrintMode>
            <ConnectionParameters>
                <MyAeTitle>DICOM_PRINTER</MyAeTitle>
                <PeerAeTitle>DS5302</PeerAeTitle>
                <Host>192.168.1.100</Host>
                <Port>5040</Port>
                <AssociationTimeout>10</AssociationTimeout>
                <DimseTimeout>10</DimseTimeout>
            </ConnectionParameters>
        </Print>
        <Trim name="TrimImages">
            <Left>auto</Left>
            <Right>auto</Right>
            <Top>auto</Top>
            <Bottom>auto</Bottom>
        </Trim>
    </ActionsList>
    <Workflow>
        <Perform action="TrimImages" onError="Ignore"/>
        <Perform action="PrintOnDevice" onError="Discard"/>
    </Workflow>
</DicomPrinterConfig>

The configuration is comprised of three parts. General settings, the ActionsList, which is the list of things DP2 will be doing, and the Workflow, which is the order in which they will be performed.

In this example, any printed document pages are “trimmed”, i.e., margins are completely removed:

<Perform action="TrimImages" onError="Ignore"/>

and then they are sent to the DS5302 dry imager at IP address 192.168.1.100 and port 5040:

<Perform action="PrintOnDevice" onError="Discard"/>

If the imager happens to be unavailable, or communication fails, the document is “Discarded”. This is so we don’t create a long queue of documents.

Since we want our logo to appear at the top left, and not overlay the image, we will:

  1. Remove the Trim action, and
  2. Replace it with an action that puts the logo into place.

Remove Trim

Simply get rid of the parts of the configuration that relate to Trim. Leaving only:

<?xml version="1.0" encoding="UTF-8"?>
<DicomPrinterConfig>
    <General>
        <CheckingInterval>1</CheckingInterval>
        <SuspensionTime>1</SuspensionTime>
        <Verbosity>30</Verbosity>
    </General>
    <ActionsList>
        <Print name="PrintOnDevice">
            <Resolution>320 x 320</Resolution>
            <PrintMode>Grayscale12</PrintMode>
            <ConnectionParameters>
                <MyAeTitle>DICOM_PRINTER</MyAeTitle>
                <PeerAeTitle>DS5302</PeerAeTitle>
                <Host>192.168.1.100</Host>
                <Port>5040</Port>
                <AssociationTimeout>10</AssociationTimeout>
                <DimseTimeout>10</DimseTimeout>
            </ConnectionParameters>
        </Print>
    </ActionsList>
    <Workflow>
        <Perform action="PrintOnDevice" onError="Discard"/>
    </Workflow>
</DicomPrinterConfig>

Add the Logo

First, we need to save the logo image to a location where DICOM Printer can find it. The best place for this is the DICOM Printer config folder:

Open up the DICOM Printer Control center and click the shortcut to the config folder.

Save the logo here:

When making your logo image, please note the image type (PNG in this case) and the dimensions. We are using 200 x 100 px. The full path of the logo is:

%ProgramData%\Flux Inc\DICOM Printer 2\config\logo.png

Which, on English machines, is actually the same as:

C:\ProgramData\Flux Inc\DICOM Printer 2\config\logo.png

Create the Action

The logo can be placed onto every page using a PrintImage action, like so:

<PrintImage name="addLogo">
    <ImagePath>C:\ProgramData\Flux Inc\DICOM Printer 2\config\logo.png</ImagePath>
    <X>1</X>
    <Y>1</Y>
    <Width>16</Width>
    <Height>16</Height>
    <Aspect>keep</Aspect>
</PrintImage>

Note that:

  • We’ve called the action addLogo. We’ll use this name later to call the action in the workflow.
  • We’ve also instructed DICOM Printer 2 to place the logo 1% from the top (Y) and 1% from the left (X) of the page, and,
  • The logo is going to be placed into a box that is 16% of the page wide and 16% of the page tall. If you are unsure of your logo dimensions, then we recommend this size.
  • DP2 will fit the image into the box, and keep the original aspect ratio.

When included as part of the original configuration, the addLogo action looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<DicomPrinterConfig>
    <General>
        <CheckingInterval>1</CheckingInterval>
        <SuspensionTime>1</SuspensionTime>
        <Verbosity>30</Verbosity>
    </General>
    <ActionsList>
        <Print name="PrintOnDevice">
            <Resolution>320 x 320</Resolution>
            <PrintMode>Grayscale12</PrintMode>
            <ConnectionParameters>
                <MyAeTitle>DICOM_PRINTER</MyAeTitle>
                <PeerAeTitle>DS5302</PeerAeTitle>
                <Host>192.168.1.100</Host>
                <Port>5040</Port>
                <AssociationTimeout>10</AssociationTimeout>
                <DimseTimeout>10</DimseTimeout>
            </ConnectionParameters>
        </Print>
        <PrintImage name="addLogo">
          <ImagePath>C:\ProgramData\Flux Inc\DICOM Printer 2\config\logo.png</ImagePath>
          <X>1</X>
          <Y>1</Y>
          <Width>16</Width>
          <Height>16</Height>
          <Aspect>keep</Aspect>
        </PrintImage>
    </ActionsList>
    <Workflow>
        <Perform action="addLogo" onError="Ignore"/>
        <Perform action="PrintOnDevice" onError="Discard"/>
    </Workflow>
</DicomPrinterConfig>

Adding the Facility name

Next up, the facility name at the bottom of the page. It requires a separate action, which looks something like this:

<PrintText name="addFooter">
  <Text>Clinica Odontologica – R. Odontologica 131 – São Paulo, Brasil</Text>
  <X>10</X>
  <Y>97</Y>
  <Width>80</Width>
  <Height>3</Height>
  <Color>0xFFFFFF</Color>
  <BackgroundColor>0x80000000</BackgroundColor>
</PrintText>

This is a PrintText action called addFooter, and it will:

  • Place the text “Clinica Odontologica – R. Odontologica 131 – São Paulo, Brasil”.
  • 10% from the left (X), and 97% from the top (Y) of the page.
  • The text box will be 80% wide and 3% tall, with the font automatically adjusted to fit.
  • The foreground colour will be white (0xFFFFFF) and the background will be a semi-transparent (0x80), black (000000) rectangle. This will allow the text to be read even when overlaying part of the image.

The completed configuration, with the addFooter action added to the workflow, looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<DicomPrinterConfig>
    <General>
        <CheckingInterval>1</CheckingInterval>
        <SuspensionTime>1</SuspensionTime>
        <Verbosity>30</Verbosity>
    </General>
    <ActionsList>
        <Print name="PrintOnDevice">
            <Resolution>320 x 320</Resolution>
            <PrintMode>Grayscale12</PrintMode>
            <ConnectionParameters>
                <MyAeTitle>DICOM_PRINTER</MyAeTitle>
                <PeerAeTitle>DS5302</PeerAeTitle>
                <Host>192.168.1.100</Host>
                <Port>5040</Port>
                <AssociationTimeout>10</AssociationTimeout>
                <DimseTimeout>10</DimseTimeout>
            </ConnectionParameters>
        </Print>
        <PrintImage name="addLogo">
          <ImagePath>C:\ProgramData\Flux Inc\DICOM Printer 2\config\logo.png</ImagePath>
          <X>1</X>
          <Y>1</Y>
          <Width>16</Width>
          <Height>16</Height>
          <Aspect>keep</Aspect>
        </PrintImage>
        <PrintText name="addFooter">
          <Text>Clinica Odontologica – R. Odontologica 131 – São Paulo, Brasil</Text>
          <X>10</X>
          <Y>97</Y>
          <Width>80</Width>
          <Height>3</Height>
          <Color>0xFFFFFF</Color>
          <BackgroundColor>0x80000000</BackgroundColor>
        </PrintText>
    </ActionsList>
    <Workflow>
        <Perform action="addLogo" onError="Ignore"/>
        <Perform action="addFooter" onError="Ignore"/>
        <Perform action="PrintOnDevice" onError="Discard"/>
    </Workflow>
</DicomPrinterConfig>

And That’s It!

Now, save and restart the DP2 service, like so:

And then,

Your next print job will have your logo at the top right and facility name at the bottom!

Ceph image with facility and logo

Thanks for reading! Be sure to check out our downloads page, where you can download fully functional 60 day evaluations.

At 495 USD, DICOM Printer is a stupendously inexpensive application. We’re excited that so many people find it useful.

Printing to film using DICOM Printer 2

This is the first in a series of posts explaining how to use DICOM Printer 2. It’s a complex tool, with some very simple uses. Despite our best efforts to make the world wholly digital, this is one of the most popular!

Goal

To print true-size images of dental x-ray, with a facility logo in the corner of the film.

We’re looking to create something like this:
Ceph image printed with DICOM Printer 2

Note that:
1. There is logo at top left.
2. Patient information is outputted at top right.
3. Clinic information appears at the bottom.

This tutorial will go through the few steps required to output the image. We will tackle the logo and patient demographics in a separate post.

Details

Source application: Dental Imaging software, like DBSWIN or SIDEXIS
Destination: AGFA Drystar 5302 (or any other DICOM Print SCP device)

Let’s Get Started!

Collect your imager connection parameters. This means:

  • The IP address, AE title and port number of the imager
  • Make sure that the DICOM_PRINTER AE title is able to connect to it. You can get help with this part from your imaging vendor.

Download DICOM Printer 2 from our website:
https://store.fluxinc.ca/files

Run the Setup Wizard to install:

DICOM Printer 2 setup start

The Setup Wizard will take you through the process and then offer to run the Configuration Wizard. In the first screen, select Film Printer:

DICOM Printer Configuration Wizard screen 1

You will be presented with the following screen:

DP2 Film configuration

  1. Select our imager model family from the drop down, e.g., AGFA Drystar 5300. If you don’t see your imager, select Generic, or the closest match from the same vendor.
    DICOM Printer 2 configuration wizard printer dropdown
  2. If you choose Generic, then be sure to look up your imager dot pitch and enter it into the Standard Resolution field. The best place to find this is usually the imager brochure from the manufacturer website.

    If the imager brochure lists the dot pitch in microns, then you can convert this value to DPI using Google. For example, if your imager lists a 50 micron dot size, then Google ’50 microns to inches’, then divide 1 by the result. The answer in this case 1 / 0.00196850394 = 507.9, or 508 x 508.

  3. You should probably leave the defaults unchanged for this example.
  4. Enter the Printer AE Title, IP Address and Port Number of the imager.

Printer configuration completed

Then click Commit!

DICOM Printer 2 Wizard end

You’re Ready to Print!

Launch your application and Print, then select the DICOM Printer 2 printer from the print dialog.

DICOM Printer print dialog selection

Please ensure to select the right film size!

Film size selection

If you experience any trouble, send us an email!

Proceed to Part 2: Adding a logo and footer