radiopaedia / dicom-anonymiser

GNU Affero General Public License v3.0
3 stars 5 forks source link

DICOM-anonymiser

With the generous support of the Advanced Radiology Services Foundation (ARSF), Radiopaedia is building support to upload cases as DICOM rather than requiring files to be exported to JPG/PNG. A critically important part of this project is to ensure that no patient data is inadvertently sent to our servers. We have, therefore, developed a DICOM anonymiser and have made that available as an open source project so that anyway can review the code we are running.

Additionally, we have built this page where you can see the fields we process. All of this code runs client-side (i.e. no data is sent to Radiopaedia or anywhere else from this page). In fact, once you have loaded this page, you can disconnect your internet and everything will still work.

We’d love to hear any feedback you may have. Just write to general@radiopaedia.org

Folder structure

How it works

The DICOM Anonymizer uses a whitelist policy to remove personally identifying metadata from DICOM formatted images.

The application explicitly supports the following DICOM SOP Classes:

(Other image types can be anonymized, however some functional information may be stripped)

The policy (src/Policies.ts) for a given SOP Class can either remove, replace or regenerate a tag value. DICOM uses UIDs to structure a series across multiple files. Where necessary, these UIDS are regenerated using a cryptographically secure SHA-512 hash. Regenerated UIDS can be identified by the prefix "1.2.826.0.1.3680043.10.341." and do not include personal information.

Usage

  import * as dcmio from "dicomanon"
  var reader = new FileReader()
  reader.onload = function(e) {
      dicomData = dcmio.Message.readFile(e.target.result);
      dicomData.dict = dcmio.Anonymize(dicomData.dict);
      warnings = dcmio.Validator(dicomData.dict);
      var buffer = dicomData.write();
  }

Limitations

The anonymiser won't be able to identify or remove burnt-in information within an image, and works under the assumption that input images are DICOM standard conformant. We recommend manually reviewing the output of the tool before sharing any images.