/DicomDeidentify

dcm4che based DICOM de-identification lib

Primary LanguageScala

CI/CD Status: Build Status

DICOM De-Identify

A small and configurable Scala library to de-identify DICOM files according to http://dicom.nema.org/medical/dicom/current/output/html/part15.html#table_E.1-1.

Using

Add as as a dependency to your project. Start coding.

de.stereotypez.Deidentify

val din = new DicomInputStream(new File("yourfile.dcm"))
val fmi = din.readFileMetaInformation()
val att = din.readDataset(-1, -1)
din.close()

// runs with side effects (will modify 'att')
Deidentify()
  .keep(Tag.PatientSex, Tag.PatientSize, Tag.PatientWeight)
  .withOptions(RetainLongModifDatesOption)
  .execute(Seq(fmi, att))

// write to new DICOM file
val dout = new DicomOutputStream(new File("de-identified.dcm"))
dout.writeDataset(fmi, att)
dout.close()

Running the tests

mvn test

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments