{"id":21111886,"url":"https://github.com/cyrilzakka/phantom","last_synced_at":"2025-10-05T16:48:40.048Z","repository":{"id":106687889,"uuid":"591024500","full_name":"cyrilzakka/Phantom","owner":"cyrilzakka","description":"Effective DICOM anonymization in Python","archived":false,"fork":false,"pushed_at":"2023-01-20T08:22:14.000Z","size":2395,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-04T23:47:28.068Z","etag":null,"topics":["anonymization","dicom","medical-image-processing","medical-imaging","pydicom"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyrilzakka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-19T18:57:17.000Z","updated_at":"2024-06-10T16:33:52.000Z","dependencies_parsed_at":"2023-05-15T03:31:20.090Z","dependency_job_id":null,"html_url":"https://github.com/cyrilzakka/Phantom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cyrilzakka/Phantom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilzakka%2FPhantom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilzakka%2FPhantom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilzakka%2FPhantom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilzakka%2FPhantom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrilzakka","download_url":"https://codeload.github.com/cyrilzakka/Phantom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilzakka%2FPhantom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278486276,"owners_count":25994941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anonymization","dicom","medical-image-processing","medical-imaging","pydicom"],"created_at":"2024-11-20T01:14:34.072Z","updated_at":"2025-10-05T16:48:39.988Z","avatar_url":"https://github.com/cyrilzakka.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/banner.png\" height=\"\" /\u003e\n\u003c/p\u003e\n\n# Phantom: DICOM Anonymization\nPhantom is a simple python module intended to simplify medical DICOM anonymization for medical machine-learning applications. Please keep in mind that we do NOT guarantee IRB-validated outputs and are not liable for any breaches of patient privacy.\n\n## Installation\n```bash\ngit clone https://github.com/cyrilzakka/Phantom.git\ncd Phantom\n```\nPhantom relies on a few dependencies to run:\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n### Metadata (Alpha)\nPhantom maintains a very strict paradigm for anonymization to ensure a maximum degree of privacy. Identifiers specified in a `base.yaml` are kept within the metadata of the DICOM file, while everything else, inluding private metadata is purged. Pixel data is always preserved.\n\nTo anonymize DICOM metadata, simply run:\n```bash\npython meta/metadata.py -s /path/to/dicoms -c /path/to/config.yaml\n```\nwhere `config.yaml` is a simple YAML specifying the attributes to keep in the DICOM. \n```yaml\n--- base.yaml ---\nbase:\n  keep: ['PatientsSex']            # keys to keep in the DICOM metadata     list\u003cstr\u003e\n  jitter: {'PatientBirthDate': 30} # keys to jitter specified as a dict     dict\u003cstr:int\u003e\n  generate: ['PatientID']          # keys to replace with a randomized ID   list\u003cstr\u003e\n``` \n\nAs DICOMs become more complex, we resort to modularity to keep anonymization manageable. Phantom configs can be composed together to create more complex anonymization pipelines. As an example, here we create a new `echo.yaml` configuration that inherits from `base.yaml` above. while appending modality-specific attributes like `HeartRate` or `NumberOfFrames`. Please keep in mind that in the case of inheritance any keys specified within either configuration files will be kept.\n```yaml\n--- echo.yaml ---\necho:\n  defaults: 'base'\n  keep: ['HeartRate', 'NumberOfFrames']\n  jitter: {'AcquisitionDateTime': 30, 'StudyDate': 30}\n  generate: []  \n``` \n\n### Burned Annotations\nDICOM modalities occasionally contain burned annotations, or patient data embedded within the pixels of the images. While this is often difficult to detect and remove without some sort of machine-learning approach, medical imaging modalities with a temporal dimension (e.g. echocardiograms) offer a simple solution via static pixel masking. This can be quickly achieved using the `TemporalMaskingPipeline`:\n```bash\npython pixel/temporal_mask.py -s /path/to/dicoms -d /path/to/destination\n```\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/input.gif\" height=\"224\" width=\"275\" /\u003e\n  \u003cimg src=\"media/output.gif\" width=\"224\"/\u003e\n\u003c/p\u003e\n\n## Disclaimer\nThis project is still in the alpha phase of development and is likely to experience some breaking changes as a result. If you run into any errors, please make sure to update the package first before opening an issue.\n\n## Issues\nIf you have an issues, feature requests, or simply want to contribute, please do not hesitate to submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrilzakka%2Fphantom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrilzakka%2Fphantom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrilzakka%2Fphantom/lists"}