FMRIVAST Dicom Data Anonymization

Dicom Date Stripping Prior to Transfer to fmrivast.ucsd.edu

Upon finalizing an imaging session at CFMRI, you are likely to have a cfmricp_log.txt that looks something like this:

cfmricp_log.txt

***************************************
Session
***************************************

Initiation Date: 4-Nov-2020 08:17:48

Protocol:   C_QA_8ch_32ch_MBfmri
Coil type:  8HRBRAIN
Start time: 4-Nov-2020 08:17:48
End time:   4-Nov-2020 08:37:58
Duration:   00:20:10

***************************************
DICOMs
***************************************

p folder: p1797
exam #: e3013
patient id: birnQA
s28566: 3Plane Loc 8ch
s28567: New BIRN 1 8ch
s28568: New BIRN 2 8ch
s28569: 8CH-QA 8ch

Dicom Date Stripping

After transferring your data to one of the CFMRI supported server (fmri1, fmri2, fmri3, fmriserver, cfmri, etc.), you can further anonymize the dicom data by using the dicomDate software provided on these servers.

Confirm the date of your dicom data acquisition

dicom_hdr s*/*.1 | grep "ID Acquisition Date"
  • In this example, the output of the command above is:

ID Acquisition Date// 20201104  # s28566
ID Acquisition Date// 20201104  # s28567
ID Acquisition Date// 20201104  # s28568
ID Acquisition Date// 20201104  # s28569

Run the anonymization script

“dicomDate” will remove the date from all dicom files and replace it a pseudo-random string of numbers

  • The command used should be “dicomDate [key] [dicom]”

cd ~/data/MyData/e3013

dicomDate 9999 *

In this example, a series of mathematical operations will be performed on the “key” (9999) to generate a new series of numbers, and replace every date within your dicom headers (potentially 10K+ files) with this new value.

The “key” can be any string of numbers, but each key used will generate a unique number used to replace the date in your data.

Confirm the date removal in the updated dicom headers

dicom_hdr s*/*.1 | grep "ID Acquisition Date"

The output should now look something like the sample below. The date “20201104” has been replaced with a code “3302”.

ID Acquisition Date// 3302  # s28566
ID Acquisition Date// 3302  # s28567
ID Acquisition Date// 3302  # s28568
ID Acquisition Date// 3302  # s28569

If your lab wants to keep track of the “keys” used and the codes generated, it would be possible to modify the files again to restore the original date. I suspect most labs will find other methods to identify the date of acquisition (subject ID, etc.), which do not violate any of the current privacy regulations.

The dicomDate code was developed and written by Alan Simmons for the purpose of remaining compliant with data privacy regulations at the VA. We appreciate his support very much! Thanks, Alan!