Author | Project | Documentation | Build Status |
---|---|---|---|
N. Curti E. Giampieri |
MedicalImageAnonymizer | Linux/MacOS : Windows : |
Code quality |
---|
Different kind of anonymizers for the most common bio-medical image formats.
Image fmt | Windows | Linux/MacOS |
---|---|---|
.SVS (or .Tiff) | 👍 | 👍 |
.dcm | 👍 | 👍 |
.nii | 👍 | 👍 |
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
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()
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.
See also the list of contributors who participated in this project.
The MedicalImageAnonymizer
package is licensed under the MIT "Expat" License.
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.
Thanks goes to all contributors of this project.
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}},
}