Skip to content

Logo Logo

How to De-identify Private DICOM Tags

Introduction

It is important to remove personal health information (PHI), or de-identify data,before importing it to Flywheel. If your institution uses DICOM tags outside of the standard tags, you can de-identify those tags before importing the DICOMs in to Flywheel.

The process works by defining DICOM tag names for private tags. These values are passed into the CLI command in the form of a CSV file. Once tag names are defined for the Private tags, the new tag names can be used in the de-identification profile like any standard DICOM tag.

For more robust de-identification of private DICOM tags, upgrade to Flywheel version 15.4 or later. The improved de-id profile features allow you to de-identify private DICOM tags alongside standard fields. Learn more about creating a de-id profile.

The method described in this article still applies to Flywheel sites on versions earlier than 15.4.

Instruction Steps

Step 1: Define Your Private Tags in a CSV File

Follow these steps to define your private DICOM tags in a CSV:

  1. Open a spreadsheet application such as Microsoft Excel or Google Sheets.
  2. In the first row of the spreadsheet, add the following criteria as column titles:

  3. Tag

  4. VR
  5. Keyword
  6. Description
  7. VM

See NiBabel's documentation for more information about these values.

  1. In the second row, define these values for your private DICOM tag. For example:
Tag VR Keyword Description VM
0x111021b0 UN UnknownProperty1 An unknown property 1
  1. Continue adding rows until you have defined all of the private tags.
  2. Once complete, save the file as a CSV:

    • Google Sheets: Go to File > Download , and select comma-separated values (.csv, currentsheet)
    • Excel: Go to File > Save As.... From the File Format menu, select Comma Separated Values (.csv).

Step 2: Add the Private DICOM Tags to your De-identification Profile

  1. Follow the steps to Create your de-identification profile
  2. Add the Keyword you defined in the CSV for each private DICOM tag.
  3. For each keyword, designate a field transformation. For example:
- name: UnknownProperty1
  replace-with: XXXX

Step 3: Preview Your De-identified DICOM Tags

Before importing your data to Flywheel, verify that the tags are de-identified as expected.

  1. Download and install the Flywheel CLI if you have not already.
  2. Open Terminal or Windows Command Prompt.
  3. Use the import dicom command along with the --private-dicom-tags, --profile, and --output-folder options. For example:
fw import dicom --private-dicom-tags ExamplePrivateTag.csv 
--profile ~Documents/StudyDeIDProfile --output-folder ~Documents/PreviewTags 
~/Documents/StudyData Psychology "Anxiety Study"
  1. The Flywheel CLI displays a hierarchy of the DICOM data it found. When prompted with Confirm upload (yes/no) , enter yes.

    The Flywheel CLI displays its progress. The Flywheel CLI does not upload the data to Flywheel when you have the --output-folder flag.

  2. Go to the location of the de-id log you set in the profile. The log file shows the value of each field before and after de-identification.

    Warning: The de-identification log includes PHI because it shows the DICOM fields before and after the de-identification. Depending on your environment, you may need to delete the log file after you review it.

  3. Once you have confirmed that the fields are de-identified correctly, run the import dicom command without the --output-folder option. For example:

fw import dicom --private-dicom-tags ExamplePrivateTag.csv 
--profile** ~Documents/StudyDeIDProfile  
~/Documents/StudyData Psychology "Anxiety Study"