[go: up one dir, main page]

Skip to content

eDIMESLab/MedicalImageAnonymizer

Repository files navigation

Author Project Documentation Build Status
N. Curti
E. Giampieri
MedicalImageAnonymizer docs Linux/MacOS : travis
Windows : appveyor

GitHub pull-requests GitHub issues

GitHub stars GitHub watchers

Code quality Codacy CODEBEAT

Medical Image Anonymizer - MIA

Different kind of anonymizers for the most common bio-medical image formats.

Image fmt Windows Linux/MacOS
.SVS (or .Tiff) 👍 👍
.dcm 👍 👍
.nii 👍 👍
  1. Installation
  2. Authors
  3. License
  4. Contributions
  5. Acknowledgments
  6. Citation

Installation

First of all ensure that a right Python version is installed (Python >= 3.5 is required). The Anaconda/Miniconda python version is recommended.

Download the project or the latest release:

git clone https://github.com/eDIMESLab/MedicalImageAnonymizer
cd MedicalImageAnonymizer

To install the prerequisites type:

pip install -r ./requirements.txt

In the MedicalImageAnonymizer directory execute:

python setup.py install

or for installing in development mode:

python setup.py develop --user

Usage

The simplest usage of this package is given by its GUI version. You can simply run the gui.py script and obtain a very simple interface to manage the file anonymisation.

python ./MedicalImageAnonymizer/GUI/gui.py

or inside Python

import MedicalImageAnonymizer as mia

mia.GUI()

Medical Image Anonymizer Graphic Interface

If you want a more deep usage of this package you can import the different modules into your Python code. Lets take as example the SVS anonymisation.

First of all import the appropriated module

import MedicalImageAnonymizer as mia

# Create the Anonymizer object
svsfile = 'test.svs'
anonym = mia.SVSAnonymize(svsfile)

# Anonymize the input file
anonym.anonymize(infolog=True)

# Invert the anonymization using the informations stored in the informations log created
anonym.deanonymize(infolog=True)

Now you can notice that two additional files are created by this script: test_anonym.svs and test_info.json. The test_anonym.svs is the anonymized version of the input file (test.svs). All the informations related to the patients are nuked in the anonymized file version and they are stored into the information log file (test_info.json). In this way you can simply revert the anonymization using the deanonymize member function which re-apply the sensitive informations to the original file.

To check this condition you can run

diff test.svs test_anonym.svs

and (if you had manually copied the input file before the anonymization into test_original.svs)

diff test_original.svs test.svs

This can be useful if you want to share and process the images stored into the original file keeping safe the sensitive informations and only at the end resume these informations.

DANGER ZONE - However, you can turned off the information storage using infolog=False: in this way the original file will be overwritten by its anonymous version.

The same syntax could be used for the different file formats.

Authors

See also the list of contributors GitHub contributors who participated in this project.

License

The MedicalImageAnonymizer package is licensed under the MIT "Expat" License. License

Contributions

Any contribution is more than welcome. Just fill an issue or a pull request and I will check ASAP!

If you want update the list of layer objects please pay attention to the syntax of the layer class and to the names of member functions/variables used to prevent the compatibility with other layers and utility functions.

Acknowledgments

Thanks goes to all contributors of this project.

Citation

Please cite MedicalImageAnonymizer if you use it in your research.

@misc{MedicalImageAnonymizer,
  author = {Enrico Giampieri and Nico Curti},
  title = {Medical Image Anonymizer},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/eDIMESLab/MedicalImageAnonymizer}},
}

Releases

No releases published

Packages

No packages published

Languages