Skip to content

Commit 3266e11

Browse files
committed
a bug fix
1 parent 6987755 commit 3266e11

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

dicomanonymizer/simpledicomanonymizer.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
from dataclasses import dataclass
77

88
from dicomanonymizer.dicomfields import (
9-
D_TAGS, Z_TAGS, X_TAGS, U_TAGS, Z_D_TAGS, X_Z_TAGS, X_D_TAGS, X_Z_D_TAGS, X_Z_U_STAR_TAGS)
9+
D_TAGS,
10+
Z_TAGS,
11+
X_TAGS,
12+
U_TAGS,
13+
Z_D_TAGS,
14+
X_Z_TAGS,
15+
X_D_TAGS,
16+
X_Z_D_TAGS,
17+
X_Z_U_STAR_TAGS,
18+
)
1019
from dicomanonymizer.format_tag import tag_to_hex_strings
1120

1221

@@ -349,8 +358,12 @@ def initialize_actions(dicom_version: str = "2013") -> dict:
349358
anonymization_actions.update({tag: empty_or_replace for tag in Z_D_TAGS})
350359
anonymization_actions.update({tag: delete_or_empty for tag in X_Z_TAGS})
351360
anonymization_actions.update({tag: delete_or_replace for tag in X_D_TAGS})
352-
anonymization_actions.update({tag: delete_or_empty_or_replace for tag in X_Z_D_TAGS})
353-
anonymization_actions.update({tag: delete_or_empty_or_replace_UID for tag in X_Z_U_STAR_TAGS})
361+
anonymization_actions.update(
362+
{tag: delete_or_empty_or_replace for tag in X_Z_D_TAGS}
363+
)
364+
anonymization_actions.update(
365+
{tag: delete_or_empty_or_replace_UID for tag in X_Z_U_STAR_TAGS}
366+
)
354367
return anonymization_actions
355368

356369

@@ -443,8 +456,12 @@ def get_private_tags(
443456
return private_tags
444457

445458

446-
def anonymize_dataset(dataset: pydicom.Dataset, extra_anonymization_rules: dict = None,
447-
delete_private_tags: bool = True) -> None:
459+
def anonymize_dataset(
460+
dataset: pydicom.Dataset,
461+
base_rules_gen: Callable = initialize_actions,
462+
extra_anonymization_rules: dict = None,
463+
delete_private_tags: bool = True,
464+
) -> None:
448465
"""
449466
Anonymize a pydicom Dataset by using anonymization rules which links an action to a tag
450467

0 commit comments

Comments
 (0)