Published
Never load real patient data, including your own scans, and never point these tools at a hospital system without permission. The script is not a validated de-identification tool, and this page is not legal advice.
What you will do
- Anonymize a study in Orthanc with the Basic profile from DICOM PS3.15, Annex E.
- Match each change in the header to one of the profile's actions.
- Mask text burned into an image, and set Burned In Annotation to
NO. - Check the profile, the pixels, the private tags, and the link back before you share a study.
What you need
- Docker: Docker Desktop on Windows 11 or macOS, or Docker Engine with the Compose plugin on Linux. Docker Desktop is free for personal use, education, and small businesses, and larger organizations need a paid subscription, so ask your IT team before you install it on a work computer.
- At least 8 GB of RAM and about 3.5 GB of free disk space.
- Stop any earlier lab first, with
docker compose downin its folder. All the labs use ports 8042 and 4242.
Why de-identify a study
Studies leave the hospital for a vendor's support team, a research group, a teaching file, or an AI project. Each of them needs the images and has no need for the patient's identity. In the US, HIPAA's minimum necessary standard says to share only what the other side needs, and the GDPR's data minimisation principle says much the same.
Start the lab and load the study
Start the PACS, download the study, and load it
load sends the newer CT study to the PACS, with a screen capture that has the patient's name, ID, and study date written into the image, the way some workstations label one.
docker compose up -ddocker compose run --rm downloaddocker compose run --rm tools loadSent 226 CT images and 1 screen capture to the PACSOpen http://localhost:8042 and sign in with user orthanc and password orthanc. The list shows one study, patient PAN_03. PAN_03 is the data set's code, and the dates were shifted before publication.
Anonymize the study
Click the study to open it, then click Anonymize, the button with a person on it. Keep the new name and ID that Orthanc fills in. Clear the StudyDescription field: the dialog copies it from the original, although the profile removes that tag. Delete the text itself, because the trash icon next to the field doesn't stop the dialog from sending the value.
Click Anonymize in the dialog, wait for the bar to fill, click Close, and refresh the page. Orthanc applies the Basic Application Level Confidentiality Profile, writes the result as a new study, and keeps the original, so the list now shows two studies.
The profile gives each attribute one of these actions, from its Table E.1-1. Options in PS3.15, E.3, keep more, such as dates for research that follows a patient over time, or clean more, such as text in the pixels.
| Action | What it does |
|---|---|
| D | Replaces the value with a dummy |
| Z | Empties the value, or replaces it with a dummy |
| X | Removes the attribute |
| K | Keeps it |
| C | Cleans it: replaces identifying values with similar ones that don't identify |
| U | Replaces a UID with a new one, the same new one wherever it appears |
Check what changed
CT image 111 went from 215 tags to 78. Private tags are vendor data the standard can't list one by one, so the Basic profile removes them all.
| Tags | What happened | Action |
|---|---|---|
| Patient's name and ID | Replaced with new values | Z |
| Study date and time, patient's sex | Emptied | Z |
| Study description | Emptied by hand in the dialog | X in the profile |
| Patient's age, series description, other dates, private tags | Removed: 137 tags in all, 122 of them private | X |
| Every UID | Replaced with a new one | U |
Compare the original and the copy
compare reads CT image 111 and the screen capture from both studies and lists what happened to each tag.
docker compose run --rm tools compareCT image 111: 215 tags before, 78 after
Replaced PatientName PAN_03 → Anonymized 1a52a67e
Replaced PatientID PAN_03 → 1a52a67e-ddab-42b9-919f-55179722b724
Emptied StudyDate, ContentDate, StudyTime, ContentTime, StudyDescription, PatientSex
...
Screen capture: 30 tags before, 32 after
...
Added PatientIdentityRemoved YES
Kept BurnedInAnnotation YESYour new name, ID, and UIDs differ, because the dialog makes a random ID each time.
Text in the pixels
Open the anonymized study, then its OT series, the screen capture, and its preview. The header is clean, but the image still shows PAN_03 PAN_03 20040110 across the top, and Burned In Annotation still says YES. The profile changes tags and doesn't look at pixels.
Removing that text is the Clean Pixel Data option, PS3.15, E.3.1. It doesn't say how to remove the text, only that it has to go and that Burned In Annotation then says NO. Screen captures, scanned forms, and ultrasound images often carry text like this.
Mask the text
Black out the label
mask takes a box as x0 y0 x1 y1, in pixels from the top left corner. Here the label fits in a box 320 pixels wide and 40 high. Orthanc's pixels masker plugin fills the box with black and doesn't find the text itself, so you have to tell it where to look.
docker compose run --rm tools mask 0 0 320 40docker compose run --rm tools compareReplaced BurnedInAnnotation YES → NORefresh the browser and open the capture again. The text is gone.
Before you share a study
| Check | What to look for |
|---|---|
| The profile | The Basic one, plus the options this recipient needs |
| The pixels | Every image that might carry text |
| The private tags | Removed, unless you've checked what's in them |
| The link back | Orthanc keeps the original next to the copy, so the PACS operator can still match the two. Under the GDPR, data that can be linked back is pseudonymised, and still personal data. |
If it doesn't work
| What you see | What to do |
|---|---|
load fails at once, before Sent | Download the study first, with docker compose run --rm download. |
No anonymized study yet from compare or mask | Anonymize the study in the browser first. |
compare shows the old study after a second anonymization | It compares the newest anonymized copy. Delete older copies in the browser, or reset with docker compose down -v and run load again. |
port is already allocated | Another program uses port 8042 or 4242, often the PACS from an earlier lab. Run docker compose down in that lab's folder. |
no configuration file provided: not found | The terminal is not in the lab folder. Open it in the folder with compose.yaml. |
Cannot connect to the Docker daemon | Start Docker Desktop and wait until the engine is running. On Linux, start the Docker service. |
Sources: The current DICOM standard, PS3.15 Annex E; Orthanc anonymization; Orthanc pixels masker plugin; HIPAA minimum necessary, 45 CFR 164.502(b); GDPR, Articles 4(5) and 5(1)(c), and Recital 26; Chen, L., et al. (2022). CTpred-Sunitinib-panNET. The Cancer Imaging Archive; Docker Desktop license terms. Polyseminar is an independent publisher. See the independence notice.
