Skip to content

dcm4che based DICOM de-identification lib

Notifications You must be signed in to change notification settings

UMEssen/DicomDeidentify

 
 

Repository files navigation

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

About

dcm4che based DICOM de-identification lib

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Scala 100.0%