|
3 | 3 | Python package to anonymize DICOM files. |
4 | 4 | The anonymization answer to the standard . More information about dicom fields for anonymization can be found [here](https://dicom.nema.org/medical/dicom/current/output/html/part15.html#table_E.1-1). |
5 | 5 |
|
6 | | -The default behaviour of this package is to anonymize DICOM fields referenced in [dicomfields](dicomanonymizer/dicomfields.py). |
| 6 | +The default behaviour of this package is to anonymize DICOM fields referenced in the 2023e DICOM standard. These fields are referenced in [dicomfields](dicomanonymizer/dicom_anonymization_databases/dicomfields_2023.py). |
| 7 | +Another standard can be selected, see *Change the DICOM anonymization standard*. |
7 | 8 |
|
8 | 9 | Dicom fields are separated into different groups. Each groups will be anonymized in a different way. |
9 | 10 |
|
@@ -204,6 +205,8 @@ def main(): |
204 | 205 | ) |
205 | 206 | args = parser.parse_args() |
206 | 207 |
|
| 208 | + deletePrivateTags = False |
| 209 | +
|
207 | 210 | input_dicom_path = args.input |
208 | 211 | output_dicom_path = args.output |
209 | 212 |
|
@@ -315,3 +318,17 @@ You can also add `extra_anonymization_rules` as above: |
315 | 318 | ** VR: Value Representation |
316 | 319 |
|
317 | 320 | Work originally done by Edern Haumont |
| 321 | +
|
| 322 | +# Change the DICOM anonymization standard |
| 323 | +
|
| 324 | +You can customize the DICOM standard that will be used to anonymize the dataset by giving an argument `base_rules_gen` to the function `anonymize_dicom_file` or `anonymize_dataset`. |
| 325 | +The value should be a function returning a dict of anonymization rules. Use the function `initialize_actions` to create such dict from a anonymization database from the folder `dicomanonymizer/dicom_anonymization_databases`. |
| 326 | +
|
| 327 | +Example: |
| 328 | +```python |
| 329 | +from dicomanonymizer.simpledicomanonymizer import anonymize_dataset, initialize_actions |
| 330 | +
|
| 331 | +anonymize_dataset( |
| 332 | + dataset, base_rules_gen=lambda: initialize_actions("dicomfields_2024b") |
| 333 | +) |
| 334 | +``` |
0 commit comments