// blog

How to Remove Your Name From a DICOM File Before Sharing It

Your name, patient ID, birth date and other identifying details are stored in DICOM tags such as (0010,0010) Patient Name, (0010,0020) Patient ID and (0010,0030) Patient Birth Date. You can replace or erase them with the free OFFIS DICOM Toolkit’s dcmodify, and remove vendor-private tags with -ep. Also check for text burned into the image itself, which no tag edit removes. Work on a copy, and don’t remove your name from files you send to your own doctor.

Last updated 2 min read

Remove your name from a DICOM file: a tag list with the name, ID, birth date and hospital struck through and the name replaced by ANONYMOUS

A DICOM file is a record as much as an image: your name, your patient number, your birth date and the hospital’s name travel with every slice. That’s what you want when the files go to your doctor. It’s not what you want when you post a scan in a forum, use it in a course, or send it to a developer.

Where your details are

Open a file in our DICOM viewer and filter the tag table on Patient. The ones that identify you most directly:

Tag Name Holds
(0010,0010) Patient Name Your name
(0010,0020) Patient ID Your hospital number
(0010,0030) Patient Birth Date Your birth date
(0010,1000) Other Patient IDs More numbers that identify you
(0008,0050) Accession Number The order number of the exam
(0008,0080) Institution Name The hospital or imaging center
(0008,0090) Referring Physician Name Your doctor

Dates (study, series, acquisition) and the unique IDs (UIDs) can also link a file back to you, and vendors keep their own private tags that may hold anything.

Remove them with dcmodify

The free, open-source OFFIS DICOM Toolkit (DCMTK) does it in one command. Work on a copy.

text
dcmodify -nb -imt \
  -ma "(0010,0010)=ANONYMOUS" -ma "(0010,0020)=ANON001" \
  -ea "(0010,0030)" -ea "(0010,1000)" -ea "(0008,0050)" \
  -ea "(0008,0080)" -ea "(0008,0090)" -ep scan.dcm
  • -ma replaces a value everywhere in the file, -ea erases a tag everywhere.
  • -ep erases all private tags.
  • -imt carries on when a tag isn’t there; -nb skips the backup file (that’s why you work on a copy).

For a whole folder, run it on every file, for example with dcmodify ... DICOM/*/*/* on a copied CD.

We ran exactly this on our chest CT sample: the name and ID were replaced, the others gone, no private tags left.

Where tags can’t help

  • Burned-in text. Ultrasound images, screen captures and some X-rays have text drawn into the pixels: names, dates, the hospital. The tag (0028,0301) Burned In Annotation says whether a file has it, but not every file sets it. Look at every image.
  • Dates and UIDs. For full de-identification, the DICOM standard’s confidentiality profile (PS3.15, Annex E) lists hundreds of attributes to remove, replace or keep. Our command covers the obvious ones, not all of them.
  • File and folder names you chose yourself, like Jane Doe MRI.

Check the result

Open the copy in the viewer, filter on Patient and Private, and look through the images. Nothing is uploaded while you check.

Key takeaways

  • Your name, ID and birth date are in group 0010 tags; the hospital and your doctor in group 0008.
  • dcmodify -ma ... -ea ... -ep replaces and removes them; work on a copy.
  • Burned-in text in the pixels needs checking by eye.
  • Don’t anonymize files meant for your own doctor.

Building software that shares scans? We’re glad to share what we know, and when you want anonymizing built into your own portal or upload, we’ll do it for you; with AI-assisted development, it costs far less than you might expect. Let’s talk.

Frequently asked questions

Should I remove my name before sending scans to my doctor?

No. Your doctor, or another hospital, needs to know the images are yours. Remove identifying details only when sharing with people who shouldn't know who you are: a forum, a course, a developer.

Is removing these tags enough to make a file anonymous?

Not always. Names can be burned into the pixels, private vendor tags can hold details, and dates or unique IDs can link a file back to you. The DICOM standard's confidentiality profile lists hundreds of attributes for full de-identification.

Can I do this without the command line?

Some desktop viewers offer an anonymize option on export. Whichever tool you use, open the result in a viewer afterwards and check the tag list and the image yourself.

Sources

  1. DICOM PS3.15 Annex E: Attribute Confidentiality Profiles
  2. DCMTK dcmodify documentation